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

upload


The blocklet upload command uploads a packaged blocklet to a specified Blocklet Store, making it available for publication. This is a crucial step for distributing your blocklet to users. Before running this command, ensure you have already bundled your project using blocklet bundle and configured the target store with blocklet config.

Upload Workflow#

The upload process involves authenticating with the Blocklet Store and sending the packaged blocklet artifact. The CLI handles reading your local configuration and the blocklet's metadata to complete the request.

Blocklet StoreFilesystemBlocklet CLIDeveloperBlocklet StoreFilesystemBlocklet CLIDeveloperblocklet uploadRead config (store URL, access token)Return config dataRead blocklet.json from release directoryReturn blocklet metadataUpload blocklet artifact with tokenRespond with status (e.g., uploaded, published)Display success message and next steps

Usage#

blocklet upload [metaFile] [options]

Arguments & Options#

Name

Type

Description

metaFile

string

Optional. The path to the blocklet's metadata file (blocklet.json). If omitted, it defaults to the standard release path: ./.blocklet/release/blocklet.json.

--access-token

string

Your personal access token for authenticating with the Blocklet Store. This flag overrides any token set in the local configuration.

--profile

string

Specifies a configuration profile to use for the upload. This determines which store URL and credentials are loaded from your config file. Defaults to default.

Authentication#

To upload a blocklet, you must provide a valid accessToken and have the storeUrl configured.

  1. Set the Store URL: Configure the target Blocklet Store you wish to upload to.blocklet config set store https://store.arcblock.io

  2. Provide an Access Token: An access token is required to authorize the upload. You can get this token from your developer profile page on the Blocklet Store. You can provide it in two ways:blocklet config set accessToken <your-access-token>

    blocklet upload --access-token <your-access-token>

    • Option 1 (Recommended for local use): Set it globally in your CLI configuration.
    • Option 2 (Ideal for CI/CD): Pass it directly as a command-line option.

If the token is missing or invalid, you will encounter a [NO-ACCESS] error.

Examples#

Standard Upload#

After bundling your blocklet, run upload from the project's root directory. The CLI will automatically find the necessary files and use your default configuration profile.

blocklet upload

Example Response (Successful Upload)

Upon a successful upload, the blocklet is staged in the store but not yet public. You need to publish it manually.

ℹ Upload using profile default to store https://store.arcblock.io
✔ Blocklet my-first-blocklet 1.0.0 successfully uploaded to https://store.arcblock.io!
ℹ Tips: You need to publish the blocklet at https://store.arcblock.io/developer/blocklets to make it public accessible

Example Response (Auto-Published)

If the store is configured to auto-publish uploads, you will see the following message.

✔ Blocklet my-first-blocklet 1.0.0 auto published successfully: https://store.arcblock.io/blocklets/z8iZufgru...wqsXh2N

Next Steps#

Once your blocklet is uploaded, the next step is to publish it unless it was done automatically. For a complete overview of the distribution process, see the Publish a Blocklet guide.