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.
This will output all the key-value pairs for the current profile.
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.
blocklet config set <key> <value>
Example:
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.
blocklet config get <key>
Example:
blocklet config get store
Remove a Configuration Value#
To delete a key from your configuration, use unset, del, or delete.
blocklet config unset <key>
Example:
blocklet config unset email
Available Configuration Keys#
The following keys can be managed via the blocklet config command:
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.