caam
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCAAM — Coding Agent Account Manager
CAAM — 编码代理账号管理器
A Go CLI for instant account switching between fixed-cost AI coding subscriptions (Claude Max, GPT Pro, Gemini Ultra). When you hit rate limits, swap accounts in ~50ms instead of 30-60 seconds of browser OAuth friction.
一款基于Go开发的CLI工具,用于在固定订阅制AI编码服务(Claude Max、GPT Pro、Gemini Ultra)之间实现即时账号切换。当你遇到速率限制时,只需约50ms即可切换账号,无需经历30-60秒的浏览器OAuth验证流程。
Why This Exists
开发背景
You're paying $200-275/month for fixed-cost AI coding subscriptions. These plans have rolling usage limits—not billing caps, but rate limits that reset over time. When you hit them mid-flow:
The Problem:
/login → browser opens → sign out of Google → sign into different Google →
authorize app → wait for redirect → back to terminalThat's 30-60 seconds of friction, 5+ times per day across multiple tools.
The Solution:
bash
caam activate claude bob@gmail.com # ~50ms, doneNo browser. No OAuth dance. No interruption to your flow state.
你每月支付200-275美元购买固定订阅制AI编码服务。这些套餐有滚动使用限制——不是账单上限,而是会随时间重置的速率限制。当你在工作过程中触发限制时:
问题所在:
/登录 → 打开浏览器 → 退出Google账号 → 登录另一个Google账号 →
授权应用 → 等待重定向 → 返回终端这会产生30-60秒的操作摩擦,每天在多个工具中要重复5次以上。
解决方案:
bash
caam activate claude bob@gmail.com # 约50ms,完成切换无需浏览器,无需OAuth繁琐流程,不会打断你的工作流。
How It Works
工作原理
Each AI CLI stores OAuth tokens in plain files. CAAM backs them up and restores them:
~/.claude.json ←→ ~/.local/share/caam/vault/claude/alice@gmail.com/
~/.codex/auth.json ←→ ~/.local/share/caam/vault/codex/work@company.com/That's it. No daemons, no databases, no network calls. Just with extra steps.
cp每个AI编码CLI都会将OAuth令牌存储在明文文件中。CAAM负责备份和恢复这些文件:
~/.claude.json ←→ ~/.local/share/caam/vault/claude/alice@gmail.com/
~/.codex/auth.json ←→ ~/.local/share/caam/vault/codex/work@company.com/就是这么简单。无需守护进程、数据库或网络请求,只是增加了额外步骤的命令。
cpWhy This Works
为什么这种方式可行
OAuth tokens are bearer tokens—possession equals access. The CLI tools don't fingerprint your machine beyond what's already in the token file. Swapping files is equivalent to "being" that authenticated session.
OAuth令牌是承载令牌——拥有令牌即拥有访问权限。CLI工具除了令牌文件中已有的信息外,不会对机器进行指纹识别。交换文件等效于切换到该已认证的会话。
Profile Detection
配置文件检测
caam status- SHA-256 hash current auth files
- Compare against all vault profiles
- Match = that's what's active
This means:
- Profiles are detected even if you switched manually
- No hidden state files that can desync
- Works correctly after reboots
caam status- 对当前认证文件进行SHA-256哈希计算
- 与所有Vault配置文件的哈希值对比
- 匹配成功即代表该配置文件处于激活状态
这意味着:
- 即使你手动切换账号,配置文件也能被检测到
- 不存在可能导致不同步的隐藏状态文件
- 重启后仍能正常工作
Quick Start
快速开始
bash
undefinedbash
undefinedInstall
安装
Backup current account
备份当前账号
caam backup claude alice@gmail.com
caam backup claude alice@gmail.com
Clear and login to another account
清除当前账号并登录新账号
caam clear claude
claude # /login with bob@gmail.com
caam backup claude bob@gmail.com
caam clear claude
claude # 使用bob@gmail.com登录
caam backup claude bob@gmail.com
Switch instantly forever
从此实现即时切换
caam activate claude alice@gmail.com # < 100ms
caam activate claude bob@gmail.com # < 100ms
caam activate claude alice@gmail.com # < 100ms
caam activate claude bob@gmail.com # < 100ms
Check status
查看状态
caam status
undefinedcaam status
undefinedTwo Operating Modes
两种运行模式
1. Vault Profiles (Simple Switching)
1. Vault配置文件(简单切换)
Swap auth files in place. One account active at a time per tool. Instant switching.
bash
caam backup claude work@company.com
caam activate claude personal@gmail.comUse when: You want to switch between accounts sequentially (most common).
直接替换认证文件。每个工具同一时间仅激活一个账号,实现即时切换。
bash
caam backup claude work@company.com
caam activate claude personal@gmail.com适用场景: 你需要按顺序切换账号(最常见的使用场景)。
2. Isolated Profiles (Parallel Sessions)
2. 隔离配置文件(并行会话)
Run multiple accounts simultaneously with full directory isolation.
bash
caam profile add codex work@company.com
caam profile add codex personal@gmail.com
caam exec codex work@company.com -- "implement feature X"
caam exec codex personal@gmail.com -- "review code"Each profile gets its own and with symlinks to your real , , etc.
$HOME$CODEX_HOME.ssh.gitconfigUse when: You need two accounts running at the same time in different terminals.
通过完整的目录隔离,同时运行多个账号。
bash
caam profile add codex work@company.com
caam profile add codex personal@gmail.com
caam exec codex work@company.com -- "实现功能X"
caam exec codex personal@gmail.com -- "审核代码"每个配置文件都有独立的和,并通过符号链接关联到真实的、等文件。
$HOME$CODEX_HOME.ssh.gitconfig适用场景: 你需要在不同终端同时运行两个账号。
Supported Tools
支持的工具
| Tool | Subscription | Auth Files |
|---|---|---|
| Claude Code | Claude Max ($200/mo) | |
| Codex CLI | GPT Pro ($200/mo) | |
| Gemini CLI | Gemini Ultra (~$275/mo) | |
| 工具 | 订阅方案 | 认证文件 |
|---|---|---|
| Claude Code | Claude Max(200美元/月) | |
| Codex CLI | GPT Pro(200美元/月) | |
| Gemini CLI | Gemini Ultra(约275美元/月) | |
Tool-Specific Details
工具专属细节
Claude Code (Claude Max)
Claude Code(Claude Max)
- Login: inside CLI
/login - Rate Limits: 5-hour rolling usage window
- Notes: When you hit limits, you'll see rate limit messages. Switch accounts to continue.
- 登录方式: 在CLI中输入
/login - 速率限制: 5小时滚动使用窗口
- 注意事项: 触发限制时会收到速率限制提示,切换账号即可继续使用。
Codex CLI (GPT Pro)
Codex CLI(GPT Pro)
- Login: or
codex login(headless)codex login --device-auth - Notes: Respects . CAAM enforces file-based auth by writing
CODEX_HOMEtocli_auth_credentials_store = "file".~/.codex/config.toml
- 登录方式: 或
codex login(无界面模式)codex login --device-auth - 注意事项: 遵循配置。CAAM会通过向
CODEX_HOME写入~/.codex/config.toml来强制使用基于文件的认证方式。cli_auth_credentials_store = "file"
Gemini CLI (Google One AI Premium)
Gemini CLI(Google One AI Premium)
- Login: Start , select "Login with Google" or use
geminito switch modes/auth - Notes: OAuth cache stored in , API key mode uses
oauth_credentials.json..env
- 登录方式: 启动,选择“Login with Google”或使用
gemini切换模式/auth - 注意事项: OAuth缓存存储在中,API密钥模式使用
oauth_credentials.json文件。.env
Command Reference
命令参考
Auth File Swapping (Primary)
认证文件切换(核心功能)
| Command | Description |
|---|---|
| Save current auth files to vault |
| Restore auth files from vault (instant switch) |
| Show which profile is currently active |
| List all saved profiles in vault |
| Remove a saved profile |
| Show auth file locations for each tool |
| Remove auth files (logout state) |
| Restore originals and remove caam data/config |
Aliases: and work like
caam switchcaam usecaam activate| 命令 | 描述 |
|---|---|
| 将当前认证文件备份到Vault |
| 从Vault恢复认证文件(即时切换) |
| 显示当前激活的配置文件 |
| 列出Vault中所有已保存的配置文件 |
| 删除已保存的配置文件 |
| 显示各工具的认证文件路径 |
| 删除认证文件(登出状态) |
| 恢复原始文件并删除CAAM的数据/配置 |
别名: 和 功能与相同
caam switchcaam usecaam activateActivate Options
激活选项
| Flag | Description |
|---|---|
| Use rotation algorithm to pick best profile |
| Backup current auth before switching |
| Activate even if profile is in cooldown |
| 标志 | 描述 |
|---|---|
| 使用轮换算法选择最佳配置文件 |
| 切换前备份当前认证文件 |
| 即使配置文件处于冷却状态也强制激活 |
Uninstall Options
卸载选项
| Flag | Description |
|---|---|
| Show what would be restored/removed |
| Keep vault after restoring originals |
| Skip confirmation prompt |
| 标志 | 描述 |
|---|---|
| 显示将被恢复/删除的内容 |
| 恢复原始文件后保留Vault备份 |
| 跳过确认提示 |
Smart Profile Management
智能配置文件管理
| Command | Description |
|---|---|
| Auto-select best profile using rotation algorithm |
| Preview which profile rotation would select |
| Wrap CLI with automatic failover on rate limits |
| Mark profile as rate-limited (default: 60min) |
| List active cooldowns with remaining time |
| Clear cooldown for a profile |
| Clear all active cooldowns |
| Associate current directory with a profile |
| Show project associations for current directory |
| Interactive TUI dashboard |
| 命令 | 描述 |
|---|---|
| 使用轮换算法自动选择最佳配置文件 |
| 预览轮换算法将选择的配置文件 |
| 包装CLI,在触发速率限制时自动故障转移 |
| 将配置文件标记为速率受限(默认:60分钟) |
| 列出当前处于冷却状态的配置文件及剩余时间 |
| 清除配置文件的冷却状态 |
| 清除所有配置文件的冷却状态 |
| 将当前目录与配置文件关联 |
| 显示当前目录的项目关联配置 |
| 交互式TUI控制面板 |
Profile Isolation (Advanced)
配置文件隔离(高级功能)
| Command | Description |
|---|---|
| Create isolated profile directory |
| List isolated profiles |
| Delete isolated profile |
| Show isolated profile status |
| Run login flow for isolated profile |
| Run CLI with isolated profile |
| 命令 | 描述 |
|---|---|
| 创建隔离的配置文件目录 |
| 列出隔离的配置文件 |
| 删除隔离的配置文件 |
| 显示隔离配置文件的状态 |
| 为隔离配置文件执行登录流程 |
| 使用隔离配置文件运行CLI |
Smart Profile Management
智能配置文件管理
When you have multiple accounts across multiple providers, manually tracking which account has headroom becomes tedious. Smart Profile Management automates this decision-making.
当你在多个服务商下拥有多个账号时,手动跟踪哪个账号还有可用额度会变得繁琐。智能配置文件管理功能可自动完成这一决策过程。
Profile Health Scoring
配置文件健康评分
Each profile displays a health indicator:
| Icon | Status | Meaning |
|---|---|---|
| 🟢 | Healthy | Token valid for >1 hour, no recent errors |
| 🟡 | Warning | Token expiring within 1 hour, or minor issues |
| 🔴 | Critical | Token expired, or repeated errors in last hour |
| ⚪ | Unknown | No health data available yet |
Health scoring combines:
- Token expiry: Time until OAuth token expires
- Error history: Recent authentication or rate limit errors
- Penalty score: Accumulated issues with exponential decay (20% reduction every 5 minutes)
- Plan type: Enterprise/Pro plans get slight scoring boosts
After ~30 minutes of no errors, penalty score returns to near zero.
每个配置文件都会显示健康状态指示器:
| 图标 | 状态 | 含义 |
|---|---|---|
| 🟢 | 健康 | 令牌有效期超过1小时,近期无错误 |
| 🟡 | 警告 | 令牌将在1小时内过期,或存在轻微问题 |
| 🔴 | 异常 | 令牌已过期,或近1小时内多次出现错误 |
| ⚪ | 未知 | 暂无健康数据 |
健康评分综合了以下因素:
- 令牌过期时间:OAuth令牌的剩余有效期
- 错误历史:近期的认证或速率限制错误
- 惩罚分数:累积的问题记录(每5分钟衰减20%的指数衰减机制)
- 套餐类型:企业版/专业版套餐会获得轻微的评分提升
约30分钟无错误后,惩罚分数会恢复至接近零。
Proactive Token Refresh
主动令牌刷新
CAAM automatically refreshes OAuth tokens before they expire, preventing mid-session auth failures.
CAAM会在OAuth令牌过期前自动刷新,避免会话中途出现认证失败。
Smart Rotation Algorithms
智能轮换算法
When you run :
caam activate claude --auto| Algorithm | Description |
|---|---|
| smart (default) | Multi-factor: cooldown state, health, recency (avoids last 30min), plan type, random jitter |
| round_robin | Sequential rotation, skipping cooldown profiles |
| random | Random selection among non-cooldown profiles |
Configure in :
~/.caam/config.yamlyaml
stealth:
rotation:
enabled: true
algorithm: smart # smart | round_robin | random
cooldown:
enabled: true # Warn when activating cooldown profiles当你运行时:
caam activate claude --auto| 算法 | 描述 |
|---|---|
| smart(默认) | 多因素决策:冷却状态、健康状况、最近使用情况(避开最近30分钟使用过的账号)、套餐类型、随机抖动 |
| round_robin | 顺序轮换,跳过处于冷却状态的配置文件 |
| random | 从非冷却状态的配置文件中随机选择 |
可在中配置:
~/.caam/config.yamlyaml
stealth:
rotation:
enabled: true
algorithm: smart # smart | round_robin | random
cooldown:
enabled: true # 激活冷却状态的配置文件时发出警告Cooldown Tracking
冷却跟踪
When an account hits a rate limit, mark it so rotation skips it:
bash
undefined当账号触发速率限制时,标记该账号以便轮换算法跳过它:
bash
undefinedMark current Claude profile (default: 60 min cooldown)
将当前Claude配置文件标记为冷却状态(默认60分钟)
caam cooldown set claude
caam cooldown set claude
Specify profile and duration
指定配置文件和冷却时长
caam cooldown set claude/work@company.com --minutes 120
caam cooldown set claude/work@company.com --minutes 120
View active cooldowns
查看当前冷却状态的配置文件
caam cooldown list
caam cooldown list
Clear a cooldown early
提前清除配置文件的冷却状态
caam cooldown clear claude/work@company.com
When `stealth.cooldown.enabled: true`, activating a profile in cooldown warns and prompts for confirmation. Use `--force` to bypass.caam cooldown clear claude/work@company.com
当`stealth.cooldown.enabled: true`时,激活处于冷却状态的配置文件会发出警告并提示确认。使用`--force`参数可绕过确认。Automatic Failover with caam run
caam run自动故障转移(caam run
)
caam runWrap CLI execution with automatic rate limit handling:
bash
caam run claude -- "explain this code"包装CLI执行过程,自动处理速率限制:
bash
caam run claude -- "解释这段代码"If Claude hits rate limit mid-session:
如果Claude在会话中途触发速率限制:
1. Current profile goes into cooldown
1. 当前配置文件进入冷却状态
2. Next best profile selected via rotation
2. 通过轮换算法选择下一个最佳配置文件
3. Command re-executed with new account
3. 使用新账号重新执行命令
**Options:**
| Flag | Default | Description |
|------|---------|-------------|
| `--max-retries N` | 1 | Maximum retry attempts |
| `--cooldown DURATION` | 60m | Cooldown duration after rate limit |
| `--algorithm NAME` | smart | Rotation algorithm |
| `--quiet` | off | Suppress profile switch notifications |
**Zero-friction aliases:**
```bash
alias claude='caam run claude --'
alias codex='caam run codex --'
alias gemini='caam run gemini --'Now handles rate limits transparently.
claude "explain this"
**选项:**
| 标志 | 默认值 | 描述 |
|------|---------|-------------|
| `--max-retries N` | 1 | 最大重试次数 |
| `--cooldown DURATION` | 60m | 触发速率限制后的冷却时长 |
| `--algorithm NAME` | smart | 轮换算法 |
| `--quiet` | 关闭 | 抑制配置文件切换通知 |
**零摩擦别名:**
```bash
alias claude='caam run claude --'
alias codex='caam run codex --'
alias gemini='caam run gemini --'现在执行时,速率限制会被透明处理。
claude "解释这段代码"Project-Profile Associations
项目-配置文件关联
Link profiles to project directories:
bash
cd ~/projects/work-app
caam project set claude work@company.com将配置文件与项目目录关联:
bash
cd ~/projects/work-app
caam project set claude work@company.comNow whenever you're in this directory
现在只要你在该目录下
caam activate claude # Automatically uses work@company.com
Associations cascade: setting on `/home/user/projects` applies to all subdirectories unless a more specific association exists.
**TUI shortcut:** Press `p` to set the current profile as default for your working directory.caam activate claude # 会自动使用work@company.com账号
关联关系会向下继承:在`/home/user/projects`目录设置的关联会应用到所有子目录,除非子目录有更具体的关联配置。
**TUI快捷操作:** 按`p`键可将当前配置文件设为工作目录的默认配置文件。Preview Rotation Selection
预览轮换选择
bash
$ caam next claude
Recommended: bob@gmail.com
+ Healthy token (expires in 4h 32m)
+ Not used recently (2h ago)
Alternatives:
alice@gmail.com - Used recently (15m ago)
In cooldown:
carol@gmail.com - In cooldown (45m remaining)Useful for understanding rotation choices or scripting conditional logic.
bash
$ caam next claude
推荐:bob@gmail.com
+ 令牌健康(有效期4小时32分钟)
+ 近期未使用(2小时前使用过)
其他可选:
alice@gmail.com - 近期使用过(15分钟前)
处于冷却状态:
carol@gmail.com - 冷却中(剩余45分钟)有助于理解轮换算法的选择逻辑,或用于编写条件脚本。
Usage Analytics
使用分析
CAAM tracks activation patterns and session durations across profiles, helping you understand usage distribution.
CAAM会跟踪各配置文件的激活模式和会话时长,帮助你了解使用分布情况。
TUI Dashboard
TUI控制面板
Interactive terminal UI for visual profile management:
bash
caam tui用于可视化管理配置文件的交互式终端UI:
bash
caam tuiTUI Features
TUI功能
- Visual profile list with health indicators
- Cooldown status display
- Project associations in status bar
- Hot reload: auto-refreshes when profiles are modified in another terminal
- 带健康状态指示器的可视化配置文件列表
- 冷却状态显示
- 状态栏显示项目关联
- 热重载:当其他终端修改配置文件时自动刷新
TUI Keybindings
TUI快捷键
| Key | Action |
|---|---|
| Navigate profiles |
| Activate selected profile |
| Set project association |
| Mark/clear cooldown |
| Refresh |
| Quit |
| 按键 | 操作 |
|---|---|
| 导航配置文件 |
| 激活选中的配置文件 |
| 设置项目关联 |
| 标记/清除冷却状态 |
| 刷新 |
| 退出 |
Vault Structure
Vault结构
~/.local/share/caam/
├── vault/ # Saved auth profiles
│ ├── claude/
│ │ ├── alice@gmail.com/
│ │ │ ├── .claude.json # Backed up auth
│ │ │ ├── auth.json # From ~/.config/claude-code/
│ │ │ └── meta.json # Timestamp, original paths
│ │ └── bob@gmail.com/
│ ├── codex/
│ │ └── work@company.com/
│ │ └── auth.json
│ └── gemini/
│ └── personal@gmail.com/
│ └── settings.json
│
└── profiles/ # Isolated profiles (advanced)
└── codex/
└── work@company.com/
├── profile.json # Profile metadata
├── codex_home/ # Isolated CODEX_HOME
│ └── auth.json
└── home/ # Pseudo-HOME with symlinks
├── .ssh -> ~/.ssh
└── .gitconfig -> ~/.gitconfig~/.local/share/caam/
├── vault/ # 已保存的认证配置文件
│ ├── claude/
│ │ ├── alice@gmail.com/
│ │ │ ├── .claude.json # 备份的认证文件
│ │ │ ├── auth.json # 来自~/.config/claude-code/
│ │ │ └── meta.json # 时间戳、原始路径
│ │ └── bob@gmail.com/
│ ├── codex/
│ │ └── work@company.com/
│ │ └── auth.json
│ └── gemini/
│ └── personal@gmail.com/
│ └── settings.json
│
└── profiles/ # 隔离配置文件(高级功能)
└── codex/
└── work@company.com/
├── profile.json # 配置文件元数据
├── codex_home/ # 隔离的CODEX_HOME
│ └── auth.json
└── home/ # 带符号链接的伪HOME目录
├── .ssh -> ~/.ssh
└── .gitconfig -> ~/.gitconfigWorkflow Examples
工作流示例
Daily Workflow
日常工作流
bash
undefinedbash
undefinedMorning: Check what's active
早上:查看当前激活的账号
caam status
caam status
claude: alice@gmail.com (active)
claude: alice@gmail.com(已激活)
codex: work@company.com (active)
codex: work@company.com(已激活)
gemini: personal@gmail.com (active)
gemini: personal@gmail.com(已激活)
Afternoon: Hit Claude usage limit
下午:触发Claude使用限制
caam activate claude bob@gmail.com
claude # Continue immediately with new account
undefinedcaam activate claude bob@gmail.com
claude # 立即使用新账号继续工作
undefinedInitial Multi-Account Setup
多账号初始设置
bash
undefinedbash
undefined1. Login to first account using normal flow
1. 使用常规流程登录第一个账号
claude # /login → authenticate with alice@gmail.com
claude # /login → 使用alice@gmail.com认证
2. Backup the auth using email as profile name
2. 以邮箱为配置文件名备份认证文件
caam backup claude alice@gmail.com
caam backup claude alice@gmail.com
3. Clear and login to second account
3. 清除当前账号并登录第二个账号
caam clear claude
claude # /login → authenticate with bob@gmail.com
caam clear claude
claude # /login → 使用bob@gmail.com认证
4. Backup that too
4. 同样备份该账号
caam backup claude bob@gmail.com
caam backup claude bob@gmail.com
5. Switch instantly forever!
5. 从此实现即时切换!
caam activate claude alice@gmail.com # < 100ms
caam activate claude bob@gmail.com # < 100ms
undefinedcaam activate claude alice@gmail.com # < 100ms
caam activate claude bob@gmail.com # < 100ms
undefinedParallel Sessions Setup
并行会话设置
bash
undefinedbash
undefinedCreate isolated profiles
创建隔离配置文件
caam profile add codex work@company.com
caam profile add codex personal@gmail.com
caam profile add codex work@company.com
caam profile add codex personal@gmail.com
Login to each (one-time, opens browser)
登录每个账号(一次性操作,会打开浏览器)
caam login codex work@company.com
caam login codex personal@gmail.com
caam login codex work@company.com
caam login codex personal@gmail.com
Run simultaneously in different terminals
在不同终端同时运行
caam exec codex work@company.com -- "implement auth system"
caam exec codex personal@gmail.com -- "review PR #123"
undefinedcaam exec codex work@company.com -- "实现认证系统"
caam exec codex personal@gmail.com -- "审核PR #123"
undefinedSmart Rotation Workflow
智能轮换工作流
bash
undefinedbash
undefinedLet rotation pick the best profile
让轮换算法选择最佳配置文件
caam activate claude --auto
caam activate claude --auto
Using rotation: claude/bob@gmail.com
使用轮换算法:claude/bob@gmail.com
Recommended: bob@gmail.com
推荐:bob@gmail.com
+ Healthy token (expires in 4h 32m)
+ 令牌健康(有效期4小时32分钟)
+ Not used recently (2h ago)
+ 近期未使用(2小时前使用过)
Hit a rate limit? Mark it
触发速率限制?标记为冷却状态
caam cooldown set claude
caam cooldown set claude
Recorded cooldown for claude/bob@gmail.com until 14:30 (58m remaining)
已记录claude/bob@gmail.com的冷却状态,截止14:30(剩余58分钟)
Next activation picks another profile automatically
下次激活会自动选择另一个配置文件
caam activate claude --auto
caam activate claude --auto
Using rotation: claude/alice@gmail.com
使用轮换算法:claude/alice@gmail.com
undefinedundefinedZero-Friction Mode
零摩擦模式
bash
undefinedbash
undefinedAdd aliases to .bashrc/.zshrc
将别名添加到.bashrc/.zshrc
alias claude='caam run claude --'
alias codex='caam run codex --'
alias claude='caam run claude --'
alias codex='caam run codex --'
Use tools normally
正常使用工具
claude "explain this authentication flow"
claude "解释这个认证流程"
If rate limited mid-session, caam automatically:
如果触发速率限制,caam会自动:
1. Marks current profile as in cooldown
1. 将当前配置文件标记为冷却状态
2. Selects next best profile via rotation
2. 通过轮换算法选择下一个最佳配置文件
3. Re-runs command with new profile
3. 使用新账号重新执行命令
All transparent - you just see the output
全程透明——你只会看到输出结果
undefinedundefinedInstallation
安装方式
bash
undefinedbash
undefinedOne-liner (recommended)
一键安装(推荐)
From source
从源码安装
git clone https://github.com/Dicklesworthstone/coding_agent_account_manager
cd coding_agent_account_manager
go build -o caam ./cmd/caam
sudo mv caam /usr/local/bin/
git clone https://github.com/Dicklesworthstone/coding_agent_account_manager
cd coding_agent_account_manager
go build -o caam ./cmd/caam
sudo mv caam /usr/local/bin/
Go install
Go安装
go install github.com/Dicklesworthstone/coding_agent_account_manager/cmd/caam@latest
undefinedgo install github.com/Dicklesworthstone/coding_agent_account_manager/cmd/caam@latest
undefinedTips
小贴士
- Use actual email as profile name — self-documenting, never forget which account
- Backup before clearing:
caam backup claude current@email.com && caam clear claude - Use --backup-current flag:
caam activate claude new@email.com --backup-current - Check status often: shows what's active across all tools
caam status - Don't sync vault across machines — auth tokens often contain machine-specific identifiers
- Use — if auth file locations change in tool updates, this shows current paths
caam paths
- 使用真实邮箱作为配置文件名——自文档化,永远不会忘记对应哪个账号
- 备份后再清除:
caam backup claude current@email.com && caam clear claude - 使用--backup-current参数:
caam activate claude new@email.com --backup-current - 经常查看状态: 可显示所有工具的当前激活账号
caam status - 不要跨机器同步Vault——认证令牌通常包含机器特定的标识符
- 使用——如果工具更新后修改了认证文件路径,该命令会显示当前路径
caam paths
FAQ
常见问题
Q: Does this work with API keys?
No. CAAM is for fixed-cost subscription plans (Claude Max, GPT Pro, Gemini Ultra) that use OAuth. API keys don't need switching—just use different keys.
Q: Is this against terms of service?
No. You're using your own legitimately-purchased subscriptions. CAAM manages local auth files—it doesn't share accounts, bypass rate limits, or modify API traffic. Each account still respects its individual usage limits.
Q: What if the tool updates and changes auth file locations?
Run to see current locations. If they change, we'll update CAAM. File an issue if you notice a discrepancy.
caam pathsQ: Can I sync the vault across machines?
Don't. Auth tokens often contain machine-specific identifiers (device IDs, etc.). Backup and restore on each machine separately.
Q: What's the difference between vault and isolated profiles?
- Vault profiles (/
backup): Swap auth in place, one account active at a timeactivate - Isolated profiles (/
profile add): Full directory isolation, run multiple accounts simultaneouslyexec
Q: Will switching break running sessions?
May cause auth errors in running CLI. Best practice: switch before starting a new session, not during.
Q: How do I know which account I'm currently using?
Run . It shows the active profile for each tool based on content hash matching.
caam status问:支持API密钥吗?
不支持。CAAM专为使用OAuth的固定订阅制套餐(Claude Max、GPT Pro、Gemini Ultra)设计。API密钥无需切换——只需使用不同的密钥即可。
问:这违反服务条款吗?
不违反。你使用的是自己合法购买的订阅服务。CAAM仅管理本地认证文件——不会共享账号、绕过速率限制或修改API流量。每个账号仍会遵守各自的使用限制。
问:如果工具更新后修改了认证文件路径怎么办?
运行查看当前路径。如果路径发生变化,我们会更新CAAM。如果发现不一致,请提交issue。
caam paths问:可以跨机器同步Vault吗?
不建议。认证令牌通常包含机器特定的标识符(设备ID等)。请在每台机器上单独备份和恢复。
问:Vault配置文件和隔离配置文件有什么区别?
- Vault配置文件(/
backup):直接替换认证文件,同一时间仅激活一个账号activate - 隔离配置文件(/
profile add):完整目录隔离,可同时运行多个账号exec
问:切换账号会中断正在运行的会话吗?
可能会导致运行中的CLI出现认证错误。最佳实践:在启动新会话前切换账号,不要在会话中途切换。
问:如何知道当前使用的是哪个账号?
运行。它会通过内容哈希匹配显示每个工具的当前激活配置文件。
caam statusIntegration with Flywheel
与Flywheel的集成
| Tool | Integration |
|---|---|
| NTM | Each tmux pane can use different account via isolated profiles |
| Agent Mail | Agents can coordinate account switching across sessions |
| CASS | Search sessions by account to track usage patterns |
| DCG | No interaction (CAAM manages auth, DCG guards commands) |
| 工具 | 集成方式 |
|---|---|
| NTM | 每个tmux窗格可通过隔离配置文件使用不同账号 |
| Agent Mail | 代理可跨会话协调账号切换 |
| CASS | 按账号搜索会话以跟踪使用模式 |
| DCG | 无交互(CAAM管理认证,DCG保护命令) |