This commit adds a new `ccr activate` command that outputs environment
variables in shell-friendly format, making it easy to integrate
claude-code-router with Agent SDK applications.
Usage:
eval $(ccr activate)
This sets the following environment variables:
- ANTHROPIC_AUTH_TOKEN
- ANTHROPIC_API_KEY
- ANTHROPIC_BASE_URL
- NO_PROXY
- DISABLE_TELEMETRY
- DISABLE_COST_WARNINGS
- API_TIMEOUT_MS
- CLAUDE_CODE_USE_BEDROCK
The implementation refactors the environment variable creation logic
from `ccr code` into a shared `createEnvVariables()` function in
`src/utils/createEnvVariables.ts`, ensuring consistency between both
commands.
Related: #855
Problem:
When passing boolean flags like --continue and --resume to Claude Code
through ccr, they were incorrectly transformed to "--continue true" and
"--resume true". Claude Code expects these as standalone flags without
values, causing them to not be recognized.
Solution:
Modified the argument reconstruction logic in codeCommand.ts to check if
a flag value is boolean true. Boolean flags are now passed without values
(e.g., "--continue"), while non-boolean flags retain their values
(e.g., "--option value").