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.
List Configurations#
To view all configuration settings for the current profile, run the command without any arguments.
Example
blocklet configExample 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 storeExample 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 successfullyDelete a Configuration#
To remove a key from the configuration, use the unset subcommand (aliases: del, delete).
Example
blocklet config unset emailUpon successful deletion, a confirmation message is displayed:
Delete config email successfullySupported 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 |
|---|---|---|
| The URL of the Blocklet Store to connect to. | Must be a valid HTTP or HTTPS URL. |
| A legacy alias for | Must be a valid HTTP or HTTPS URL. |
| The access token for authenticating with the Blocklet Store. | Must be a valid secret key. |
| The DID of your developer account. | Must be a valid DID string. |
| The developer's name associated with the profile. | None. |
| 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.ioExample: Listing configurations for the 'staging' profile
blocklet config --profile stagingIf 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.