config subcommand provides operations for reading and writing configuration values.
Configuration File
Location:~/.config/esios/config.toml
Configuration is stored in TOML format:
Commands
set
Set a configuration value.KEY— Configuration key (e.g.,token)VALUE— Configuration value
***).
get
Get a configuration value.KEY— Configuration key to read
Configuration Keys
token
ESIOS API authentication token.- Visit ESIOS
- Register for an account
- Generate an API token from your account settings
- Environment variable:
export ESIOS_API_KEY=your-token - CLI flag:
--token your-token(on any command)
--tokenflag (highest priority)- Config file (
~/.config/esios/config.toml) ESIOS_API_KEYenvironment variable (lowest priority)
Future Configuration Keys
The config system supports arbitrary key-value pairs. Future versions may include:cache_dir— Custom cache directory locationcache_ttl— Cache time-to-live in secondsdefault_format— Default output formatapi_base_url— Custom API endpoint
Authentication Setup
Option 1: Config File (Recommended)
Store your token permanently in the config file:- Persists across terminal sessions
- No need to set environment variables
- Works automatically with all commands
Option 2: Environment Variable
Set the token as an environment variable:- Standard environment variable pattern
- Works with Docker and CI/CD
- Easy to override per-session
Option 3: CLI Flag
Provide the token directly to each command:- No configuration needed
- Useful for testing multiple tokens
- Highest priority (overrides config and env)
Common Workflows
Initial Setup
Verify Configuration
Switch Tokens
Backup Configuration
Remove Configuration
Configuration File Structure
The config file uses TOML format:Environment Variables
ESIOS_API_KEY
API authentication token.Security Best Practices
Protect Your Token
-
Never commit tokens to git:
-
Use environment variables in CI/CD:
-
Restrict file permissions:
Token Rotation
Troubleshooting
No API Token Error
Config File Not Found
Token Not Working
Permission Denied
Configuration Priority
When multiple sources provide the same configuration, they are resolved in this order (highest to lowest):- CLI flag —
--token your-token - Config file —
~/.config/esios/config.toml - Environment variable —
ESIOS_API_KEY
See Also
- CLI Overview — Authentication setup and quick start
- Cache — Cache location and management
- Indicators — Using the API with authentication
