CLICLI Configuration

CLI Configuration

Advanced configuration and customization options for the Syaala CLI.

Configuration File

The CLI stores configuration in a JSON file:

  • macOS/Linux: ~/.config/syaala/config.json
  • Windows: %APPDATA%\syaala\config.json

Default Configuration

{
  "profiles": {
    "default": {
      "apiKey": "sk_live_...",
      "orgId": "org_...",
      "apiUrl": "https://api.syaala.com",
      "timeout": 30000,
      "retries": 3
    }
  },
  "activeProfile": "default",
  "outputFormat": "table",
  "debug": false
}

Multiple Profiles

Manage multiple environments with profiles:

{
  "profiles": {
    "production": {
      "apiKey": "sk_live_...",
      "orgId": "org_prod",
      "apiUrl": "https://api.syaala.com"
    },
    "staging": {
      "apiKey": "sk_test_...",
      "orgId": "org_staging",
      "apiUrl": "https://staging-api.syaala.com"
    },
    "development": {
      "apiKey": "sk_dev_...",
      "orgId": "org_dev",
      "apiUrl": "http://localhost:3001/api"
    }
  },
  "activeProfile": "production"
}

Switching Profiles

# Set active profile
syaala config set-profile staging
 
# List all profiles
syaala config profiles
 
# Use specific profile for one command
syaala deployments list --profile development

Environment Variables

Environment variables override configuration file settings:

VariableDescriptionExample
SYAALA_API_KEYAPI authentication keysk_live_abc123...
SYAALA_API_URLAPI base URLhttps://api.syaala.com
SYAALA_ORG_IDDefault organization IDorg_abc123
SYAALA_PROFILEActive profile nameproduction
SYAALA_DEBUGEnable debug loggingtrue
SYAALA_TIMEOUTRequest timeout (ms)30000
SYAALA_RETRIESNumber of retry attempts3
SYAALA_OUTPUT_FORMATDefault output formatjson

Priority Order

Configuration is resolved in this order (highest to lowest priority):

  1. Command-line flags (--api-key, --org-id)
  2. Environment variables (SYAALA_API_KEY)
  3. Active profile in config file
  4. Default values

Output Formats

The CLI supports multiple output formats:

Table Format (Default)

syaala deployments list --format table

Output:

ID          NAME        STATE      GPU TYPE  REPLICAS  CREATED
dep_abc123  my-llm      HEALTHY    A100      2/10      2024-01-15
dep_xyz789  api-server  SCALING    A6000     5/20      2024-01-14

JSON Format

syaala deployments list --format json

Output:

{
  "deployments": [
    {
      "id": "dep_abc123",
      "name": "my-llm",
      "state": "HEALTHY",
      "gpuType": "A100",
      "currentReplicas": 2,
      "maxReplicas": 10,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}

YAML Format

syaala deployments list --format yaml

Output:

deployments:
  - id: dep_abc123
    name: my-llm
    state: HEALTHY
    gpuType: A100
    currentReplicas: 2
    maxReplicas: 10
    createdAt: 2024-01-15T10:30:00Z

Debug Mode

Enable verbose logging for troubleshooting:

# Enable for one command
syaala deployments list --debug
 
# Enable globally via environment
export SYAALA_DEBUG=true
syaala deployments list
 
# Enable in config file
syaala config set debug true

Debug output includes:

  • HTTP request/response details
  • GraphQL queries and mutations
  • Authentication token validation
  • Retry attempts and backoff timing

Network Configuration

Timeout Settings

Configure request timeout:

# Via environment variable (milliseconds)
export SYAALA_TIMEOUT=60000
 
# Via config file
syaala config set timeout 60000

Retry Configuration

Configure retry behavior:

# Set maximum retry attempts
syaala config set retries 5
 
# Via environment
export SYAALA_RETRIES=5

Retry strategy:

  • Exponential backoff: 1s, 2s, 4s, 8s, 16s
  • Retryable errors: 429 (rate limit), 500, 502, 503, 504
  • Non-retryable: 400, 401, 403, 404

Proxy Configuration

Use HTTP proxy for all requests:

# HTTP proxy
export HTTP_PROXY=http://proxy.example.com:8080
 
# HTTPS proxy
export HTTPS_PROXY=https://proxy.example.com:8080
 
# No proxy for specific domains
export NO_PROXY=localhost,127.0.0.1

Security

API Key Storage

API keys are stored in the configuration file. Secure the file:

# Set restrictive permissions (Unix)
chmod 600 ~/.config/syaala/config.json
 
# Verify permissions
ls -la ~/.config/syaala/config.json

Expected output:

-rw------- 1 user user 1234 Jan 15 10:30 config.json

API Key Masking

API keys are automatically masked in logs:

✓ Authenticated with API key sk_live_abc...xyz

Credential Helpers

Use system keychain for API key storage:

# macOS Keychain
syaala config set-credential-helper keychain
 
# Linux Secret Service
syaala config set-credential-helper secretservice
 
# Windows Credential Manager
syaala config set-credential-helper wincred

Advanced Options

Custom API Endpoints

Override specific API endpoints:

{
  "profiles": {
    "custom": {
      "apiKey": "sk_live_...",
      "endpoints": {
        "deployments": "https://deployments-api.example.com",
        "models": "https://models-api.example.com",
        "inference": "https://inference-api.example.com"
      }
    }
  }
}

Request Headers

Add custom headers to all requests:

{
  "profiles": {
    "default": {
      "apiKey": "sk_live_...",
      "headers": {
        "X-Custom-Header": "value",
        "X-Request-ID": "custom-id"
      }
    }
  }
}

User Agent

Customize the user agent string:

export SYAALA_USER_AGENT="MyApp/1.0 (Syaala CLI)"

Configuration Commands

syaala config get

Get configuration value:

syaala config get apiUrl
syaala config get timeout

syaala config set

Set configuration value:

syaala config set apiUrl https://api.syaala.com
syaala config set timeout 60000
syaala config set outputFormat json

syaala config list

List all configuration:

syaala config list

syaala config reset

Reset configuration to defaults:

# Reset specific value
syaala config reset timeout
 
# Reset entire profile
syaala config reset --profile staging
 
# Reset everything
syaala config reset --all

Shell Integration

Bash Completion

# Add to ~/.bashrc
eval "$(syaala completion bash)"

Zsh Completion

# Add to ~/.zshrc
eval "$(syaala completion zsh)"

Fish Completion

# Add to ~/.config/fish/config.fish
syaala completion fish | source

PowerShell Completion

# Add to $PROFILE
Invoke-Expression (syaala completion powershell)

Troubleshooting

Reset Configuration

# Backup current config
cp ~/.config/syaala/config.json ~/.config/syaala/config.json.backup
 
# Remove config file
rm ~/.config/syaala/config.json
 
# Reconfigure
syaala auth login --api-key sk_live_...

Verify Configuration

# Show active configuration
syaala config list --debug
 
# Test API connectivity
syaala auth status --debug

Common Issues

Permission Denied

# Fix config file permissions
chmod 600 ~/.config/syaala/config.json

Invalid API Key

# Update API key
syaala config set apiKey sk_live_new_key
 
# Or re-authenticate
syaala auth logout
syaala auth login --api-key sk_live_new_key

Network Errors

# Test connectivity
curl https://api.syaala.com/api/health
 
# Increase timeout
syaala config set timeout 60000
 
# Enable retries
syaala config set retries 5

Next Steps