Configuration¶
The Escape CLI requires minimal configuration to get started. This guide covers authentication setup and optional configuration options.
Authentication¶
Obtaining Your API Key¶
- Navigate to your Escape user profile
- Locate the API Key section
- Copy your API key (it will look like:
esc_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
)
API Key Security
Treat your API key as a sensitive credential. Never commit it to version control or share it publicly. Anyone with access to your API key can perform actions on your behalf in the Escape platform.
Setting the API Key¶
The Escape CLI authenticates using the ESCAPE_API_KEY
environment variable.
Interactive Shell Sessions¶
Bash/Zsh (Linux/macOS):
To make this persistent across sessions, add the export statement to your shell configuration file:
# Add to ~/.bashrc, ~/.zshrc, or ~/.profile
echo 'export ESCAPE_API_KEY="esc_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"' >> ~/.bashrc
source ~/.bashrc
PowerShell (Windows):
For persistent configuration:
[System.Environment]::SetEnvironmentVariable('ESCAPE_API_KEY', 'esc_xxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'User')
Command Prompt (Windows):
CI/CD Pipelines¶
Configure the API key as a secret environment variable in your CI/CD platform:
GitHub Actions:
GitLab CI:
Jenkins:
See CI/CD Integration for complete examples.
Docker Containers¶
Pass the API key as an environment variable:
Or use an environment file:
Verify Authentication¶
Test your authentication by listing available locations:
If authentication is successful, you'll see your configured locations. If it fails, verify:
- The API key is correctly set in your environment
- The API key is valid and not expired
- Your network allows connections to the Escape API
Optional Configuration¶
Kubernetes Integration¶
The CLI automatically detects and integrates with Kubernetes environments. To disable this behavior:
When to disable:
- Running in a containerized environment that's not Kubernetes
- Experiencing conflicts with Kubernetes tooling
- Reducing CLI startup time in non-Kubernetes environments
Default behavior:
ESCAPE_K8S_INTEGRATION=true
- Enables Kubernetes integration (default)ESCAPE_K8S_INTEGRATION=false
- Disables Kubernetes integration
Output Formatting¶
Control the default output format for all commands:
Supported formats:
table
- Human-readable table format (default)json
- JSON format for scripting and parsingyaml
- YAML format for configuration management
You can override this per command using the --output
or -o
flag:
Logging and Debug Mode¶
Enable verbose logging for troubleshooting:
Log levels:
error
- Only error messageswarn
- Warnings and errorsinfo
- Informational messages (default)debug
- Detailed debug information
Configuration Best Practices¶
Development Environments¶
Create a .env
file in your project directory (ensure it's in .gitignore
):
# .env
ESCAPE_API_KEY=esc_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
ESCAPE_OUTPUT_FORMAT=json
ESCAPE_LOG_LEVEL=info
Load it before running commands:
Production Environments¶
- Use Secret Management: Store API keys in a secure secret management system (AWS Secrets Manager, HashiCorp Vault, etc.)
- Rotate Keys Regularly: Generate new API keys periodically and update your configuration
- Least Privilege: Use API keys with the minimum required permissions for each use case
- Audit Access: Monitor API key usage through the Escape platform
Team Environments¶
- Individual API Keys: Each team member should use their own API key for traceability
- Service Accounts: Create dedicated API keys for automated systems and CI/CD pipelines
- Documentation: Document which API keys are used in which environments
Configuration Files¶
The Escape CLI currently uses environment variables for configuration. Configuration file support may be added in future versions.
Proxy Configuration¶
If your environment requires an HTTP proxy, configure it using standard environment variables:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1
The CLI will automatically use these proxy settings for all API requests.
Troubleshooting¶
Authentication Failures¶
Error: "Invalid API key"
- Verify the API key is correctly copied from your profile
- Check for extra spaces or newlines in the environment variable
- Ensure the API key hasn't been revoked
Error: "API key not found"
- Confirm the
ESCAPE_API_KEY
environment variable is set - Check the variable is available in the current shell session:
echo $ESCAPE_API_KEY
Connection Issues¶
Error: "Connection timeout"
- Verify network connectivity to
api.escape.tech
- Check firewall rules allow outbound HTTPS connections
- Confirm proxy settings if applicable
Error: "SSL certificate verification failed"
- Ensure system certificates are up to date
- Check for corporate SSL inspection that may interfere with API calls
Permission Errors¶
Error: "Insufficient permissions"
- Verify your API key has the required permissions
- Contact your Escape organization administrator to adjust permissions
Next Steps¶
With authentication configured, proceed to Getting Started to learn essential CLI commands and workflows.