Authentication Priority
The CLI checks for your API key in this order (first match wins):SHOVELS_API_KEYenvironment variable- Config file at
~/.config/shovels/config.yaml
Option A: Environment Variable
Set your API key for the current session:Option B: Config File (Recommended)
Save your API key persistently:~/.config/shovels/config.yaml:
$XDG_CONFIG_HOME if set.
Verify Your Configuration
Additional Config Options
The config file supports these settings:
Set any option with the
config set command:
Authentication Errors
If your API key is missing or invalid, the CLI exits with code2 and prints a JSON error to stderr:
Some commands don’t require authentication:
version, config show, and usage. Geographic search commands (cities search, counties search, etc.) and tags list are also credit-free but require a valid API key.Getting an API Key
If you don’t have an API key yet:- Create a free Shovels account
- Go to Profile Settings
- Copy your API key from the API Key field
Related Articles
- How to access your API key — Find your key in the Shovels dashboard
- CLI installation — Install the CLI binary
- CLI error codes — Understanding exit codes and error types
