CLI Configuration
Configuring the SwiftClaw CLI
CLI Configuration
Configure the SwiftClaw CLI for your workflow.
Configuration File
The CLI stores configuration in ~/.swiftclaw/config.json:
{
"api_key": "sk_live_abc123...",
"workspace": "my-workspace",
"default_env": "development",
"base_url": "https://api.swiftclaw.io",
"timeout": 30,
"max_retries": 3
}Setting Configuration
Via CLI
# Set API key
swiftclaw config set api-key sk_live_abc123...
# Set default workspace
swiftclaw config set workspace my-workspace
# Set default environment
swiftclaw config set default-env productionVia Environment Variables
export SWIFTCLAW_API_KEY=sk_live_abc123...
export SWIFTCLAW_WORKSPACE=my-workspace
export SWIFTCLAW_ENV=productionVia Config File
Edit ~/.swiftclaw/config.json directly:
{
"api_key": "sk_live_abc123...",
"workspace": "my-workspace"
}Configuration Precedence
Configuration is loaded in this order (later overrides earlier):
- Default values
- Config file (
~/.swiftclaw/config.json) - Environment variables
- Command-line flags
Authentication
API Key
# Set API key
swiftclaw config set api-key sk_live_abc123...
# Or use environment variable
export SWIFTCLAW_API_KEY=sk_live_abc123...Login
# Interactive login
swiftclaw login
# Login with token
swiftclaw login --token sk_live_abc123...Logout
swiftclaw logoutWorkspace Configuration
Set Default Workspace
swiftclaw config set workspace my-workspacePer-Command Workspace
swiftclaw agents list --workspace other-workspaceEnvironment Configuration
Set Default Environment
swiftclaw config set default-env productionPer-Command Environment
swiftclaw deploy my-agent --env stagingOutput Configuration
Output Format
# Set output format (json|table|yaml)
swiftclaw config set output-format jsonVerbosity
# Enable verbose output
swiftclaw config set verbose true
# Or use flag
swiftclaw agents list --verboseColor Output
# Disable color output
swiftclaw config set no-color trueNetwork Configuration
Base URL
swiftclaw config set base-url https://api.swiftclaw.ioTimeout
# Set timeout in seconds
swiftclaw config set timeout 60Retries
# Set max retries
swiftclaw config set max-retries 5Proxy
# Set HTTP proxy
swiftclaw config set proxy http://proxy.example.com:8080Tab Completion
Install Completion
# Bash
swiftclaw completion install bash
# Zsh
swiftclaw completion install zsh
# Fish
swiftclaw completion install fishManual Setup
Add to your shell config:
# ~/.bashrc or ~/.zshrc
eval "$(swiftclaw completion bash)"Aliases
Create command aliases:
# Add to ~/.swiftclaw/config.json
{
"aliases": {
"d": "deploy",
"l": "logs",
"s": "status"
}
}Usage:
swiftclaw d my-agent # Same as: swiftclaw deploy my-agent
swiftclaw l my-agent # Same as: swiftclaw logs my-agentProfiles
Use different profiles for different contexts:
# Create profile
swiftclaw config profile create work
# Switch profile
swiftclaw config profile use work
# List profiles
swiftclaw config profile listViewing Configuration
View All Configuration
swiftclaw config listView Specific Value
swiftclaw config get api-keyView Effective Configuration
Shows final configuration after all overrides:
swiftclaw config showResetting Configuration
Reset Specific Value
swiftclaw config unset api-keyReset All Configuration
swiftclaw config reset --forceBackup Configuration: Back up your config file before resetting.
Configuration Examples
Development Setup
{
"api_key": "sk_test_dev123...",
"workspace": "dev-workspace",
"default_env": "development",
"verbose": true,
"output_format": "table"
}Production Setup
{
"api_key": "sk_live_prod456...",
"workspace": "prod-workspace",
"default_env": "production",
"verbose": false,
"output_format": "json"
}Next Steps
How is this guide ?
Last updated on