Upload to Store
After you have packaged your blocklet using blocklet bundle
, the next step is to distribute it. The blocklet upload
command pushes your bundled blocklet to a designated Blocklet Store, making it ready for publishing and installation by others.
This guide covers the process of uploading your blocklet. Before proceeding, ensure you have already bundled your project. For more details, see the Bundle Blocklet documentation. You will also need to configure your CLI to communicate with a store, which is covered in Connect to Store.
Command Usage#
The command uploads the blocklet specified by a metadata file, which is typically the blocklet.json
generated during the bundling process.
blocklet upload [metafile] [options]
Arguments#
Name | Description |
---|---|
| Optional. The path to the blocklet's metadata JSON file. If omitted, it defaults to |
Options#
Option | Description |
---|---|
| Your personal access token for the Blocklet Store. This is used to authenticate you as the developer. |
| The configuration profile to use for the upload. This determines which store URL and access token are used from your config file. Defaults to |
Configuration#
For a successful upload, the CLI needs two key pieces of information: the target store's URL and an authentication token.
Store URL#
The CLI must be configured with the URL of the Blocklet Store you want to upload to. If this is not set, the command will fail.
# Set the store URL in your default profile
blocklet config set store https://store.blocklet.io
Access Token#
Authentication is required to upload a blocklet. You can obtain an access token from your developer profile on the target Blocklet Store. The token can be provided in two ways:
- Via Configuration (Recommended): Set the token in your CLI configuration. This is the most common method.
blocklet config set accessToken <your-access-token>
- Via Command-Line Flag: Specify the token directly when you run the command. This is useful for CI/CD environments or for overriding the configured token.
blocklet upload --access-token <your-access-token>
Examples#
Standard Upload#
If you are in your project's root directory and have configured your store and access token, simply run the command without any arguments.
blocklet upload
Upload a Specific File#
If your bundled blocklet.json
is in a different location, specify the path to it.
blocklet upload ./build/blocklet.json
Upload Result#
After the upload is complete, you will see one of two success messages.
- Uploaded Successfully: This is the standard outcome. Your blocklet is now in the store but is not yet publicly visible. You must manually publish it from the store's developer dashboard.
Blocklet my-blocklet 1.0.0 successfully uploaded to https://store.blocklet.io!
Tips: You need to publish the blocklet at https://store.blocklet.io/developer/blocklets to make it public accessible - Auto-Published Successfully: Some stores may be configured to automatically publish blocklets upon a successful upload. In this case, your blocklet is immediately available to the public.
Blocklet my-blocklet 1.0.0 auto published successfully: https://store.blocklet.io/blocklets/z... !
Troubleshooting#
Invalid Meta File#
This error occurs if the specified metafile
does not exist. Ensure the path is correct and that you have run blocklet bundle
first.
Invalid meta file: '/path/to/project/.blocklet/release/blocklet.json'
Missing Access Token#
If the access token is missing or invalid, you will receive an error. The message will guide you on how to resolve it.
[NO-ACCESS] ...
Blocklet store accessToken is used to authorize developers when uploading blocklets, you can generate your own accessToken from https://store.blocklet.io
Please use the following two methods to specify
Option 1: Set a access token locally: blocklet config set accessToken [accessToken]
Option 2: By specifying the --access-token parameter: blocklet upload --access-token <access token>
With your blocklet uploaded, the final step is to manage its release through the store's web interface. For a complete overview of the distribution workflow, review the Connect to Store guide.