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

Connect to Store


The blocklet connect command configures your CLI to authenticate with a specific Blocklet Store. This is a necessary step before you can publish blocklets using the blocklet upload command.

This command initiates a secure, browser-based authentication flow. After you log in through your web browser, the Blocklet Store sends an access token and your developer profile information back to the CLI, which are then saved to your local configuration for future commands.

Usage#

blocklet connect <store-url> [options]

Arguments#

Argument

Description

<store-url>

Required. The full URL of the Blocklet Store you want to connect to. The URL must use the http or https protocol. Example: https://store.blocklet.dev

Options#

Option

Description

--profile <name>

Specifies a configuration profile to use. This allows you to manage connections to multiple Blocklet Stores. If omitted, the default profile is used.

Authentication Flow#

The connection process is designed to be secure by never handling your store credentials directly on the command line. It involves coordination between the CLI, your web browser, and the Blocklet Store.


Examples#

Basic Connection#

To connect to the official Blocklet Store, run the following command:

blocklet connect https://store.blocklet.dev

After running the command and completing the login in your browser, you will see a success message in your terminal:

Successfully connected, and now you are ready to upload blocklets to https://store.blocklet.dev
Tips: Use the following command to view the configuration: blocklet config list

Overwriting an Existing Connection#

If a store URL is already configured for a profile and you attempt to connect to a different one, the CLI will ask for confirmation to prevent accidental changes.

? The store url has been set, do you need to overwrite it? (y/N)

Press Enter or type n to cancel. Type y to proceed with connecting to the new store, which will replace the previous configuration for that profile.

Using Connection Profiles#

Profiles allow you to maintain separate connections to different Blocklet Stores, such as for development, staging, and production environments.

To connect to a staging store using a profile named staging, run:

blocklet connect https://staging-store.arcblock.io --profile staging

The credentials for this connection will be saved under the staging profile, separate from your default configuration.

Verifying the Connection#

After connecting, you can view the saved configuration details using the blocklet config list command.

blocklet config list

To view the configuration for a specific profile, include the --profile flag:

blocklet config list --profile staging

Next Steps#

Once your CLI is connected to a store, you are ready to publish your blocklet. Proceed to the Upload to Store guide to learn how.