Skip to content

CLI Configuration

This guide covers configuring the Voidkey CLI for different environments and use cases.

The Voidkey CLI can be configured in multiple ways, with the following precedence order (highest to lowest):

  1. Command-line flags - Override everything
  2. Environment variables - Per-session configuration
  3. Configuration file - Persistent user/project settings
  4. Default values - Built-in defaults

The CLI respects these environment variables:

VariableDescriptionDefault
VOIDKEY_BROKER_URLBroker endpoint URL-
VOIDKEY_OIDC_TOKENOIDC authentication token-
VOIDKEY_OUTPUT_FORMATDefault output formatenv
VOIDKEY_CONFIG_PATHConfiguration file path~/.voidkey/config.yaml
VOIDKEY_DEBUGEnable debug loggingfalse
VOIDKEY_NO_COLORDisable colored outputfalse
VOIDKEY_TIMEOUTRequest timeout30s

Bash/Zsh:

Terminal window
export VOIDKEY_BROKER_URL="https://voidkey.example.com"
export VOIDKEY_OIDC_TOKEN="eyJhbGciOiJSUzI1NiIs..."
export VOIDKEY_OUTPUT_FORMAT="json"

Fish:

set -gx VOIDKEY_BROKER_URL "https://voidkey.example.com"
set -gx VOIDKEY_OIDC_TOKEN "eyJhbGciOiJSUzI1NiIs..."

PowerShell:

Terminal window
$env:VOIDKEY_BROKER_URL = "https://voidkey.example.com"
$env:VOIDKEY_OIDC_TOKEN = "eyJhbGciOiJSUzI1NiIs..."

Windows Command Prompt:

Terminal window
set VOIDKEY_BROKER_URL=https://voidkey.example.com
set VOIDKEY_OIDC_TOKEN=eyJhbGciOiJSUzI1NiIs...

The CLI uses a YAML configuration file for persistent settings.

  • Linux/macOS: ~/.voidkey/config.yaml
  • Windows: %USERPROFILE%\.voidkey\config.yaml

Initialize a configuration file:

Terminal window
voidkey config init

This creates a default configuration:

~/.voidkey/config.yaml
broker_url: ""
output_format: env
timeout: 30s
debug: false
# Default keys to use when --all is not specified
default_keys: []
# Key aliases for common combinations
aliases: {}
OptionTypeDescriptionExample
broker_urlstringBroker endpoint URLhttps://voidkey.example.com
output_formatstringDefault output format (env, json, yaml)json
timeoutstringRequest timeout duration60s
debugbooleanEnable debug loggingtrue
default_keysarrayKeys to mint when no —keys specified["AWS_DEPLOY"]
aliasesobjectNamed key combinationsSee below
# Broker connection
broker_url: https://voidkey.example.com
timeout: 45s
# Output preferences
output_format: json
debug: false
# Default behavior
default_keys:
- AWS_DEV
- MINIO_LOCAL
# Key aliases for common scenarios
aliases:
# Development environment
dev:
- AWS_DEV
- MINIO_LOCAL
- GCP_DEV
# Production deployment
prod:
- AWS_PROD_DEPLOY
- DOCKER_REGISTRY_PROD
# Monitoring and observability
monitoring:
- PROMETHEUS_READ
- GRAFANA_ADMIN
- ELASTICSEARCH_READ
# Environment-specific overrides
environments:
development:
broker_url: http://localhost:3000
debug: true
timeout: 10s
staging:
broker_url: https://voidkey-staging.example.com
timeout: 30s
production:
broker_url: https://voidkey.example.com
timeout: 60s
debug: false

Create a new configuration file with defaults:

Terminal window
voidkey config init
# With custom path
voidkey config init --config /path/to/config.yaml

Display current configuration:

Terminal window
# Show all configuration
voidkey config show
# Show specific value
voidkey config show broker_url
voidkey config show output_format

Update configuration values:

Terminal window
# Set broker URL
voidkey config set broker_url https://voidkey.example.com
# Set output format
voidkey config set output_format json
# Set timeout
voidkey config set timeout 60s
# Enable debug mode
voidkey config set debug true
# Set default keys
voidkey config set default_keys AWS_DEPLOY,GCP_READONLY
Terminal window
# Remove specific value (revert to default)
voidkey config unset broker_url
# Clear default keys
voidkey config unset default_keys

Create aliases for common key combinations:

Terminal window
# Create alias for development keys
voidkey config set aliases.dev AWS_DEV,MINIO_LOCAL,GCP_DEV
# Create alias for production deployment
voidkey config set aliases.prod AWS_PROD_DEPLOY,DOCKER_REGISTRY
# Create alias for monitoring
voidkey config set aliases.monitoring PROMETHEUS_READ,GRAFANA_ADMIN
Terminal window
# Use alias instead of listing individual keys
voidkey mint --keys @dev
# Equivalent to:
voidkey mint --keys AWS_DEV,MINIO_LOCAL,GCP_DEV
# Combine aliases with individual keys
voidkey mint --keys @prod,ADDITIONAL_KEY
Terminal window
# Show all aliases
voidkey config show aliases
# Show specific alias
voidkey config show aliases.dev

Configure different environments:

~/.voidkey/config.yaml
environments:
local:
broker_url: http://localhost:3000
debug: true
dev:
broker_url: https://voidkey-dev.example.com
timeout: 30s
staging:
broker_url: https://voidkey-staging.example.com
prod:
broker_url: https://voidkey.example.com
timeout: 60s
debug: false
Terminal window
# Use specific environment
voidkey --env dev mint --keys AWS_DEPLOY
# Set default environment
export VOIDKEY_ENV=staging
voidkey mint --keys AWS_DEPLOY

Create project-specific configuration files:

# .voidkey.yaml (in project root)
broker_url: https://company-voidkey.internal
output_format: json
default_keys:
- AWS_PROJECT_DEPLOY
- GCP_PROJECT_READ
aliases:
deploy:
- AWS_PROJECT_DEPLOY
- DOCKER_REGISTRY_PUSH
test:
- AWS_PROJECT_TEST
- MINIO_PROJECT_TEST
Terminal window
# CLI automatically finds .voidkey.yaml in current directory
cd /path/to/project
voidkey mint --keys @deploy
# Or specify explicitly
voidkey --config .voidkey.yaml mint --keys @deploy

Configure how to obtain OIDC tokens:

~/.voidkey/config.yaml
token_sources:
github:
command: "gh auth token --scopes read:org"
cache_duration: 300s
auth0:
command: "auth0 token"
cache_duration: 600s
gcloud:
command: "gcloud auth print-identity-token"
cache_duration: 900s

Enable local token caching:

token_cache:
enabled: true
directory: ~/.voidkey/cache
max_age: 300s # 5 minutes

Use cached tokens:

Terminal window
# Cache token from command
voidkey config set-token --source github
# Use cached token
voidkey mint --keys AWS_DEPLOY # Uses cached token automatically

Define custom output templates:

output_templates:
custom_env: |
{{- range $key, $creds := .credentials }}
{{- range $name, $value := $creds }}
export {{ $name }}="{{ $value }}"
{{- end }}
{{- end }}
docker_env: |
{{- range $key, $creds := .credentials }}
{{- range $name, $value := $creds }}
{{ $name }}={{ $value }}
{{- end }}
{{- end }}

Use custom templates:

Terminal window
voidkey mint --keys AWS_DEPLOY --output custom_env
voidkey mint --keys AWS_DEPLOY --output docker_env

Configure HTTP client behavior:

http:
timeout: 30s
retry_attempts: 3
retry_delay: 1s
user_agent: "voidkey-cli/0.8.0"
# TLS configuration
tls:
insecure: false
ca_file: /path/to/ca.pem
cert_file: /path/to/client.pem
key_file: /path/to/client-key.pem
# Proxy configuration
proxy:
http: http://proxy.example.com:8080
https: https://proxy.example.com:8080
no_proxy:
- localhost
- "*.internal"

Configure logging behavior:

logging:
level: info # debug, info, warn, error
format: text # text, json
file: ~/.voidkey/logs/cli.log
# Rotate logs
rotate:
max_size: 10MB
max_files: 5
max_age: 30d

Stored in user home directory:

  • Linux/macOS: ~/.voidkey/config.yaml
  • Windows: %USERPROFILE%\.voidkey\config.yaml
Terminal window
# Edit global config
voidkey config edit
# Show global config location
voidkey config path

Project-specific configuration files:

Terminal window
# .voidkey.yaml in current directory
voidkey mint --keys AWS_DEPLOY
# Custom local config
voidkey --config ./my-config.yaml mint --keys AWS_DEPLOY

Configuration sources are merged in this order:

  1. Global configuration (~/.voidkey/config.yaml)
  2. Local configuration (.voidkey.yaml)
  3. Environment variables
  4. Command-line flags

Check configuration file syntax:

Terminal window
# Validate current configuration
voidkey config validate
# Validate specific file
voidkey config validate --config /path/to/config.yaml

The CLI validates configuration against this schema:

type: object
properties:
broker_url:
type: string
format: uri
output_format:
type: string
enum: [env, json, yaml]
timeout:
type: string
pattern: '^\d+[smh]$'
debug:
type: boolean
default_keys:
type: array
items:
type: string
aliases:
type: object
additionalProperties:
type: array
items:
type: string

Enable debug mode to see configuration loading:

Terminal window
voidkey --debug config show

Output includes:

  • Configuration file locations checked
  • Values loaded from each source
  • Final merged configuration

Configuration file not found:

Terminal window
# Check expected location
voidkey config path
# Create missing directory
mkdir -p ~/.voidkey
# Initialize configuration
voidkey config init

Invalid YAML syntax:

Terminal window
# Validate configuration
voidkey config validate
# Check YAML syntax
yamllint ~/.voidkey/config.yaml

Permission issues:

Terminal window
# Check file permissions
ls -la ~/.voidkey/config.yaml
# Fix permissions
chmod 600 ~/.voidkey/config.yaml
~/.voidkey/config.yaml
broker_url: https://voidkey-dev.company.com
output_format: json
debug: true
timeout: 30s
default_keys:
- AWS_DEV
- MINIO_LOCAL
aliases:
full:
- AWS_DEV
- GCP_DEV
- MINIO_LOCAL
- DOCKER_DEV

Usage:

Terminal window
# Quick development credential minting
voidkey mint # Uses default_keys
# Full development environment
voidkey mint --keys @full
Terminal window
# Environment variables in CI/CD
export VOIDKEY_BROKER_URL="https://voidkey.company.com"
export VOIDKEY_OIDC_TOKEN="$CI_OIDC_TOKEN"
export VOIDKEY_OUTPUT_FORMAT="env"
export VOIDKEY_TIMEOUT="60s"
# No configuration file needed
voidkey mint --keys AWS_PROD_DEPLOY
~/.voidkey/config.yaml
broker_url: https://voidkey.company.com
timeout: 60s
debug: false
# No default keys for security
default_keys: []
# Specific production aliases
aliases:
deploy:
- AWS_PROD_DEPLOY
- DOCKER_REGISTRY_PUSH
monitor:
- PROMETHEUS_READ
- GRAFANA_READ