Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Command Reference

blocklet version


The blocklet version command updates the version of your blocklet in the blocklet.yml file. It follows standard Semantic Versioning (SemVer) rules to increment the version number. This command also automatically updates the specVersion to the latest version supported by the CLI.

This is a crucial step before packaging your blocklet for release, ensuring that each new version is correctly tagged.

Usage#

blocklet version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease] [options]

Workflow#

The command executes a series of steps to safely update your blocklet's version.


Arguments#

Argument

Description

newversion

Optional. Specifies the new version. It can be a valid SemVer string (e.g., 1.2.3) or a keyword for incrementing (major, minor, patch, prerelease, etc.). Defaults to patch.

Options#

Option

Description

--git-commit

Automatically adds blocklet.yml to Git and creates a commit with the message "blocklet version [new_version]".

--force

Forces the update even if it results in downgrading the specVersion. This might be necessary if you are using an older version of Blocklet CLI that has a lower specVersion.

Examples#

Increment the Patch Version#

If your current version is 1.0.0, running the command without arguments will increment the patch number.

# Current version in blocklet.yml: 1.0.0
blocklet version

# This is equivalent to explicitly specifying 'patch'
blocklet version patch

Output:

Blocklet version bumped to 1.0.1

Increment the Minor Version and Commit#

To bump the minor version and create a Git commit automatically, use the --git-commit flag.

# Current version: 1.0.1
blocklet version minor --git-commit

Output:

Blocklet version bumped to 1.1.0
# A 'git commit' will also be executed

Set a Specific Version#

You can set a precise version number, including pre-release identifiers.

blocklet version 2.0.0-beta.1

Output:

Blocklet version bumped to 2.0.0-beta.1

Handling specVersion Downgrade#

If the CLI's specVersion is lower than the one in your blocklet.yml, the command will prevent a downgrade by default to ensure compatibility. You will see an error message prompting you to upgrade your CLI.

Error Output:

The new specVersion of blocklet.yml (1.6.0) is smaller than the current specVersion (1.7.0)
Please upgrade the version of the "blocklet" command by executing blocklet server upgrade

To override this safety check, you can use the --force flag.

blocklet version patch --force


After versioning your blocklet, the next step is often to package it for distribution. Learn more in the blocklet bundle command reference. For more details on the blocklet.yml manifest file, see the Project Structure guide.

Syntax error in textmermaid version 11.6.0