SwiftClaw
Introduction to SwiftClawQuick StartInstallationConfiguration

Authentication

Authentication OverviewAPI KeysWebhooks

API Reference

API OverviewREST APISDK Reference

Core Concepts

Understanding AgentsWorkspacesEnvironments

CLI

CLI ReferenceCLI CommandsCLI Configuration
SwiftClaw

Environments

Managing deployment environments in SwiftClaw

Environments

Environments separate development, staging, and production deployments.

Environment Types

Development

For local development and testing:

swiftclaw deploy my-agent --env development

Characteristics:

  • Debug logging enabled
  • Lower rate limits
  • Test API keys
  • Faster deployment

Staging

For pre-production testing:

swiftclaw deploy my-agent --env staging

Characteristics:

  • Production-like configuration
  • Isolated from production data
  • Full testing capabilities
  • Separate API keys

Production

For live deployments:

swiftclaw deploy my-agent --env production

Characteristics:

  • Optimized performance
  • High availability
  • Production API keys
  • Monitoring and alerts

Environment Configuration

Environment Variables

# Development
export SWIFTCLAW_ENV=development
export SWIFTCLAW_API_KEY=sk_test_abc123...

# Production
export SWIFTCLAW_ENV=production
export SWIFTCLAW_API_KEY=sk_live_xyz789...

Configuration Files

// config/development.json
{
  "model": "gpt-3.5-turbo",
  "debug": true,
  "log_level": "debug"
}

// config/production.json
{
  "model": "gpt-4",
  "debug": false,
  "log_level": "info"
}

Environment Isolation

Each environment has:

  • Separate Instances: Independent agent deployments
  • Isolated Data: No cross-environment data access
  • Different API Keys: Environment-specific authentication
  • Independent Scaling: Per-environment resource allocation

Promoting Between Environments

Manual Promotion

# Deploy to staging
swiftclaw deploy my-agent --env staging

# Test in staging
swiftclaw test my-agent --env staging

# Promote to production
swiftclaw deploy my-agent --env production --version staging-v1.2.0

Automated Promotion

# .github/workflows/deploy.yml
name: Deploy
on:
  push:
    branches: [main]

jobs:
  deploy-staging:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Deploy to Staging
        run: swiftclaw deploy my-agent --env staging

  deploy-production:
    needs: deploy-staging
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to Production
        run: swiftclaw deploy my-agent --env production

Environment-Specific Settings

Model Configuration

# Development: Use faster, cheaper model
swiftclaw config set model gpt-3.5-turbo --env development

# Production: Use powerful model
swiftclaw config set model gpt-4 --env production

Scaling Configuration

# Development: Minimal resources
swiftclaw config set min-instances 1 --env development

# Production: High availability
swiftclaw config set min-instances 3 --env production

Memory Configuration

# Development: Short TTL
swiftclaw config set memory-ttl 1h --env development

# Production: Long TTL
swiftclaw config set memory-ttl 30d --env production

Environment Variables

Required Variables

SWIFTCLAW_ENV=production
SWIFTCLAW_API_KEY=sk_live_abc123...
SWIFTCLAW_WORKSPACE=my-workspace

Optional Variables

SWIFTCLAW_BASE_URL=https://api.swiftclaw.io
SWIFTCLAW_TIMEOUT=30
SWIFTCLAW_MAX_RETRIES=3

Best Practices

1. Use Separate API Keys

# Development
SWIFTCLAW_API_KEY=sk_test_dev123...

# Production
SWIFTCLAW_API_KEY=sk_live_prod456...

2. Test in Staging First

# Always test in staging
swiftclaw deploy my-agent --env staging
swiftclaw test my-agent --env staging

# Then deploy to production
swiftclaw deploy my-agent --env production

3. Monitor Each Environment

# Set up environment-specific alerts
swiftclaw alerts create \
  --agent my-agent \
  --env production \
  --metric error-rate \
  --threshold 1

4. Use Environment-Specific Configurations

# Load environment-specific config
swiftclaw deploy my-agent \
  --env production \
  --config config/production.json

Never use production keys in development: Always use test keys for development and staging.

Environment Status

Check environment status:

# View all environments
swiftclaw envs list my-agent

# View specific environment
swiftclaw envs status my-agent --env production

Next Steps

  • Deployment Guide
  • Configuration
  • Workspaces

How is this guide ?

Last updated on

Workspaces

Understanding SwiftClaw workspaces

CLI Reference

Complete reference for SwiftClaw CLI commands

On this page

Environments
Environment Types
Development
Staging
Production
Environment Configuration
Environment Variables
Configuration Files
Environment Isolation
Promoting Between Environments
Manual Promotion
Automated Promotion
Environment-Specific Settings
Model Configuration
Scaling Configuration
Memory Configuration
Environment Variables
Required Variables
Optional Variables
Best Practices
1. Use Separate API Keys
2. Test in Staging First
3. Monitor Each Environment
4. Use Environment-Specific Configurations
Environment Status
Next Steps