Configuration
Thexyz CLI uses a layered configuration system. This guide explains how to configure the CLI for different environments.
Configuration Commands
Set a Value
Get a Value
List All Values
Available Configuration Keys
Setting Up for Different Networks
Local Development
Testnet
Production
Configuration File
Configuration is stored in~/.xyz/config.yaml:
The config file is created automatically when you first run
xyz config set. File permissions are set to 0600 for security.Environment Variables
Override any config value with environment variables:Precedence
- Flags -
--node tcp://...(highest) - Environment -
XYZ_NODE=tcp://... - Config file -
~/.xyz/config.yaml - Defaults (lowest)
Keyring Backend
The keyring backend determines how private keys are stored:- OS (Recommended)
- File
- Test
Uses the operating system’s secure keychain:
Pros: Most secure, no passphrase promptsCons: Platform-specific
CW20 Token Configuration
Track CW20 tokens for balance queries:Set CW20 Code ID
After deploying the CW20 base contract, save its code ID:xyz token create to instantiate new tokens.
Track Token Contracts
Add token contracts to track in balance queries:Validation
The CLI validates configuration values:
Invalid values are rejected: