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

config


The blocklet config command allows you to manage local configuration settings for the Blocklet CLI. These settings, such as the Blocklet Store URL and developer credentials, are used by other commands like upload and connect.

You can use this command to view, set, and delete configuration keys for different profiles, which is useful for managing multiple development environments.

Operations#

The config command behaves differently based on the number of arguments provided.

No arguments

One argument:

Two arguments:

blocklet config

list()

get(key)

set(key, value)

blocklet config unset

unset(key)


List Configurations#

To view all configuration settings for the current profile, run the command without any arguments.

Example

blocklet config

Example Response

The command will output a JSON object containing the key-value pairs.

{
"store": "https://store.blocklet.dev/",
"developerDid": "z1S...",
"name": "My Developer Name",
"email": "developer@arcblock.io"
}

Get a Specific Configuration#

To retrieve the value of a single key, provide the key as an argument.

Example

blocklet config store

Example Response

The command will print the raw value of the specified key.

https://store.blocklet.dev/

Set a Configuration#

To set or update a configuration key, provide the key and its new value. The CLI will validate the value before saving it.

Example

blocklet config name "My New Developer Name"

If the value is set successfully, you will see a confirmation message:

Config name successfully

Delete a Configuration#

To remove a key from the configuration, use the unset subcommand (aliases: del, delete).

Example

blocklet config unset email

Upon successful deletion, a confirmation message is displayed:

Delete config email successfully

Supported Keys#

The following keys are supported by the config command. The CLI validates values for certain keys to ensure they are correctly formatted.

Key

Description

Validation Rules

store

The URL of the Blocklet Store to connect to.

Must be a valid HTTP or HTTPS URL.

registry

A legacy alias for store.

Must be a valid HTTP or HTTPS URL.

accessToken

The access token for authenticating with the Blocklet Store.

Must be a valid secret key.

developerDid

The DID of your developer account.

Must be a valid DID string.

name

The developer's name associated with the profile.

None.

email

The developer's email address associated with the profile.

None.

Using Profiles#

You can maintain separate configurations using profiles. This is useful for switching between different environments, such as a production Blocklet Store and a staging one. Use the --profile option with any config command.

Example: Setting a configuration for a 'staging' profile

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

Example: Listing configurations for the 'staging' profile

blocklet config --profile staging

If no profile is specified, the default profile is used.


Now that you understand how to manage CLI settings, you may want to learn how to automatically configure these settings by connecting to a Blocklet Store. See the connect command for more details.