Configuration & Secrets
Manage authentication, config files, environment variables, and secrets for the Chanl CLI
The Chanl CLI stores configuration in a local file and supports environment variable overrides. This page covers authentication methods, config management, secrets, and multi-environment workflows.
Config File
All CLI configuration is stored in ~/.chanl/config.json. The CLI creates this file automatically on first use.
chanl config path/Users/you/.chanl/config.jsonWhat's stored
The config file holds your authentication credentials, workspace context, and display preferences. Sensitive values (API keys, tokens) are stored in plaintext -- protect this file with standard filesystem permissions.
{
"apiKey": "ak_live_abc123...",
"baseUrl": "https://platform.chanl.ai",
"workspaceId": "ws_abc123",
"defaultFormat": "table"
}Reset config
To start fresh, delete the config file:
rm ~/.chanl/config.jsonThe CLI recreates it with defaults on the next command.
Authentication
The CLI supports two authentication methods: browser login (OAuth) and API key.
Browser login opens your default browser for sign-in with Google, Microsoft, or email/password. This is the recommended method for interactive use.
chanl loginOpening browser for authentication...
If the browser didn't open, visit:
https://app.chanl.ai/cli-auth?port=54321
✓ Authentication successful
User: dean@acme.com
Name: Dean Grover
Workspace: ws_abc123
✓ Credentials saved to /Users/you/.chanl/config.jsonIf you belong to multiple workspaces, the CLI prompts you to select one:
? Select a workspace:
> Acme Corp (ws_abc123) - owner
Side Project (ws_def456) - memberBrowser login stores a JWT token and refresh token. The CLI clears any existing API key when you switch to browser auth.
API key login is best for CI/CD, scripts, and headless environments where a browser is not available.
chanl login --api-key ak_live_abc123def456✓ Authentication successful
✓ API key saved to /Users/you/.chanl/config.jsonThe CLI validates your key against the API before saving it. If validation fails, nothing is stored.
Check auth status
chanl auth statusStatus: Authenticated
Method: API Key
API Key: ak_li****f456
Base URL: https://platform.chanl.ai
Workspace ID: ws_abc123
Workspace: Acme CorpLog out
chanl logout✓ Logged out successfullyLogout removes all stored credentials (API key, JWT token, refresh token) and clears the workspace ID.
API Keys
Format
Chanl API keys use the prefix ak_ followed by an environment indicator and a random string:
| Prefix | Environment |
|---|---|
ak_live_ | Production |
ak_test_ | Test / sandbox |
Create an API key
API keys are created in the Chanl dashboard, not from the CLI.
Go to Settings > API Keys in the Chanl dashboard
Click Create API Key. Give it a name (e.g., "CI Pipeline", "Local Dev") and select the workspace.
Copy the key immediately -- it is only shown once.
chanl login --api-key ak_live_abc123def456Rotation
To rotate a key, create a new one in the dashboard, update your CLI config or CI secrets, then delete the old key. There is no automatic rotation -- you control the lifecycle.
# Update the CLI with a new key
chanl login --api-key ak_live_new_key_here
# Or set via environment variable (no config change needed)
export CHANL_API_KEY=ak_live_new_key_hereConfig Commands
List all config
chanl config listKey Value Source
apiKey ak_li****f456 config
baseUrl https://platform.chanl.ai default
workspaceId ws_abc123 config
defaultFormat table default
Config file: /Users/you/.chanl/config.jsonThe Source column shows where each value comes from:
| Source | Meaning |
|---|---|
config | Set in ~/.chanl/config.json |
env | Overridden by an environment variable |
default | Built-in default (not explicitly set) |
Get a single value
chanl config get baseUrlhttps://platform.chanl.aiSet a value
chanl config set defaultFormat json✓ Set defaultFormat = jsonDelete a value
chanl config delete workspaceId✓ Deleted workspaceIdconfig delete and config unset are aliases -- both work.
Switch environment
Reset the base URL to production:
chanl config use production✓ Switched to production: https://platform.chanl.aiFor custom endpoints, set the base URL directly:
chanl config set baseUrl https://platform-staging.chanl.aiConfig Keys
| Key | Type | Default | Description |
|---|---|---|---|
apiKey | string | -- | API key for authentication (ak_ prefix) |
baseUrl | string | https://platform.chanl.ai | Base URL for the Chanl API |
workspaceId | string | -- | Default workspace ID for all commands |
defaultFormat | "table" | "json" | table | Default output format |
The jwtToken, refreshToken, and appUrl keys are managed automatically by the browser login flow. You do not need to set them manually.
Environment Variables
Environment variables override config file values. This is the recommended approach for CI/CD pipelines and containers.
| Variable | Overrides | Description |
|---|---|---|
CHANL_API_KEY | apiKey | API key for authentication |
CHANL_BASE_URL | baseUrl | API base URL |
CHANL_WORKSPACE_ID | workspaceId | Default workspace ID |
CHANL_APP_URL | appUrl | App URL for browser login flow |
NO_COLOR | -- | Disable colored output (any value) |
Priority order
For keys that support environment variable overrides, the resolution order is:
Environment variable > Config file > Built-in defaultFor example, if CHANL_API_KEY is set, it takes precedence over the apiKey value in ~/.chanl/config.json -- even if the config file has a different key.
CI/CD example
steps:
- name: Run scenario tests
run: chanl scenarios run sc_abc123 --json
env:
CHANL_API_KEY: ${{ secrets.CHANL_API_KEY }}
CHANL_WORKSPACE_ID: ${{ vars.CHANL_WORKSPACE_ID }}Shell profile example
Add to ~/.zshrc or ~/.bashrc for persistent overrides:
export CHANL_API_KEY=ak_live_abc123def456
export CHANL_WORKSPACE_ID=ws_abc123Tool Secrets
Tools in Chanl can reference secrets using the {{secret:name}} syntax in their configuration. These secrets are managed entirely through the platform UI -- the CLI does not create or modify them.
How secrets work
When you define an HTTP tool, you can reference secrets in headers, query parameters, or the request body:
{
"name": "weather-api",
"type": "http",
"configuration": {
"url": "https://api.weather.com/v1/forecast",
"headers": {
"Authorization": "Bearer {{secret:WEATHER_API_KEY}}"
}
}
}At runtime, the platform resolves {{secret:WEATHER_API_KEY}} to the actual value stored in the workspace's secret store. The secret value never appears in logs, API responses, or tool definitions.
Managing secrets
Secrets are scoped to a workspace and managed in the Chanl dashboard:
Go to Settings > Secrets in the Chanl dashboard
Click Add Secret and enter the name (e.g., WEATHER_API_KEY) and value.
Use the {{secret:WEATHER_API_KEY}} syntax in your tool's headers, URL, or body.
Secrets are write-only in the UI -- you can set and update them, but you cannot view existing values. Store your secret values in a password manager.
View secrets from the CLI
You can list tools that reference secrets, but you cannot read secret values:
chanl tools get tool_abc123 --json | jq '.configuration.headers'{
"Authorization": "Bearer {{secret:WEATHER_API_KEY}}"
}The {{secret:...}} placeholder is visible. The resolved value is not.
Provider Setup
LLM, speech-to-text (STT), and text-to-speech (TTS) provider API keys are configured through the Chanl dashboard, not the CLI.
Go to Settings > Integrations in the Chanl dashboard to connect providers:
| Provider Type | Examples |
|---|---|
| LLM | OpenAI, Anthropic, Google AI, Groq |
| STT | Deepgram, AssemblyAI |
| TTS | ElevenLabs, Play.ht, Cartesia |
Once connected, your agents and tools use these providers automatically. No CLI configuration is needed.
Multiple Environments
Switch between environments
Use config set baseUrl to point the CLI at different environments:
chanl config use productionOr explicitly:
chanl config set baseUrl https://platform.chanl.aichanl config set baseUrl https://chanl-platform-staging.fly.devchanl config set baseUrl https://your-custom-instance.example.comPer-command overrides
Use environment variables for one-off commands without changing your config:
CHANL_BASE_URL=https://chanl-platform-staging.fly.dev chanl agents listLogin with a custom base URL
The --base-url flag on login sets the base URL and authenticates in one step:
chanl login --base-url https://chanl-platform-staging.fly.dev --api-key ak_test_staging_keySDK Configuration
When using the Chanl SDK programmatically (outside the CLI), you pass configuration directly to the constructor:
import { ChanlSDK } from '@chanl/sdk';
const chanl = new ChanlSDK({
baseUrl: 'https://platform.chanl.ai',
apiKey: 'ak_live_abc123def456',
timeout: 30000,
retry: {
maxRetries: 3,
retryDelay: 1000,
backoffMultiplier: 2,
},
});| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | -- | API base URL (required) |
apiKey | string | -- | API key authentication |
jwtToken | string | -- | JWT token authentication |
workspaceId | string | -- | Workspace context |
timeout | number | 30000 | Request timeout in milliseconds |
headers | Record<string, string> | -- | Custom headers for all requests |
debug | boolean | false | Enable debug logging |
retry.maxRetries | number | 3 | Maximum retry attempts |
retry.retryDelay | number | 1000 | Initial delay between retries (ms) |
retry.backoffMultiplier | number | 2 | Exponential backoff multiplier |
The CLI reads from ~/.chanl/config.json and environment variables automatically. The SDK constructor is only needed when you are building your own application.