Configuration


Proper configuration is essential for both running a Blocklet Server instance and for interacting with it and other services using the Blocklet CLI. This guide focuses on the local CLI settings that you, as a developer, will use to connect to Blocklet Stores and manage your development environment. These settings are managed using the blocklet config command.

For details on the server's primary configuration file, config.yml, please see the Initialize Server documentation.

Managing CLI Settings with blocklet config#

The blocklet config command set allows you to view, set, and remove configuration values stored in a local INI file. This is particularly useful for setting up your connection to a Blocklet Store for deploying and uploading blocklets.

View Current Configuration#

To see all your current configuration settings, you can run blocklet config without any arguments, or use the list subcommand.

list configuration

blocklet config list

This will output all the key-value pairs for the current profile.

Example Output:

Example Output

store="https://store.blocklet.dev/"
developerDid="z123..."
name="John Doe"
email="john.doe@example.com"

Set a Configuration Value#

Use the set subcommand to add or update a configuration key.

set configuration

blocklet config set <key> <value>

Example:

Set store URL

blocklet config set store https://store.blocklet.dev

Get a Specific Value#

If you only need to retrieve the value for a single key, use the get subcommand.

get configuration

blocklet config get <key>

Example:

Get store URL

blocklet config get store

Remove a Configuration Value#

To delete a key from your configuration, use unset, del, or delete.

unset configuration

blocklet config unset <key>

Example:

Unset developer email

blocklet config unset email

Available Configuration Keys#

The following keys can be managed via the blocklet config command:

Key

Description

store

The base URL of the Blocklet Store you want to interact with for uploading or deploying blocklets. Must be a valid HTTPS or HTTP URL.

registry

An alias for store.

accessToken

The secret key used to authenticate your CLI with the Blocklet Store. You typically get this by running blocklet connect.

developerDid

Your unique Decentralized Identifier (DID) as a developer.

name

Your developer name associated with your DID.

email

Your developer email associated with your DID.

Using Profiles#

Profiles allow you to manage multiple, separate sets of configurations. This is useful for switching between different environments, such as a development store and a production store. By default, all configurations are saved to the default profile.

To use a specific profile, add the --profile <profile-name> flag to any blocklet config command.

Example: Setting a value for a 'staging' profile

blocklet config set store https://staging.store.example.com --profile staging

Example: Listing values for the 'staging' profile

blocklet config list --profile staging

Configuration File Location#

The CLI settings are stored in an INI-formatted file. The CLI searches for a .abtnode/conf/config.ini file starting from the current directory and moving up through its ancestors.

You can override this behavior and specify an exact file path by setting the ABT_NODE_CONFIG_FILE environment variable.

While you can manage these settings manually, the recommended way to configure your connection to a store is by using the blocklet connect command, which handles the authentication flow and saves the necessary credentials for you.