δΈζζζ‘£ | English
A CLI tool that manages AI tool configurations, allowing you to quickly switch between saved Claude model configs and Codex provider/model profiles.
This tool provides a convenient way to manage CLI configurations for multiple AI tools. It lets you save multiple Claude model configs and Codex profiles, switch between them, test connectivity, and inspect details without manually editing config files.
- π Multi-tool support - Manage both Claude CLI configs and Codex profiles
- π Multi-language support - Chinese (zh), English (en), Japanese (ja) with auto geo-detection
- π Language switching - Use
/set-langcommand to switch language manually - π Provider templates - 9 built-in OpenAI-compatible templates, auto-fill model/baseUrl, only API Key needed
- π¦ Backup mechanism - Automatic backup before each config write
- π Merge strategy - Preserve existing config fields, only update model-related fields
- π’ Index-based selection - Input numbers to select, Enter to confirm
- β©οΈ Navigation options - Return to previous level or exit directly
- β Add configs - Template-based or custom field-by-field input with validation
- π View all configurations - Grouped display by tool
- βΉοΈ View config details - Display full config in JSON format
- π Current config status - Show active config/profile per tool
- π§ͺ Connection testing - Verify config via real HTTP request with retry
- π Multi-protocol support - Compatible with both Anthropic Messages and OpenAI Chat Completions
- π‘ Smart suggestions - Recommend similar commands for unknown inputs
npm install -g cmrm
# or
npm linkThe first time you run cmrm, it will automatically create a configuration file at ~/.cmrm/settings.json.
To add configurations, use the /add command (see Usage section below).
Start the CLI:
cmrm| Command | Description |
|---|---|
/switch |
Switch to a saved Claude model config or Codex profile |
/add |
Add a new configuration interactively (auto-tests before saving) |
/remove |
Remove a saved configuration |
/info |
View detailed configuration in JSON format |
/test |
Test if a configuration works (saved or custom, with retry) |
/alias |
Manage configuration aliases (add/remove/list) |
/list |
Display all saved configurations |
/current |
Display the currently configured config/profile |
/set-lang |
Switch interface language (zh/en/ja) |
/exit |
Exit the CLI |
For one-line workflows, the following arguments are accepted directly without entering the interactive menu:
| Shortcut | Description |
|---|---|
cmrm switch <name> |
Quickly switch to a saved config/profile |
cmrm test <name> |
Quickly test a saved config/profile |
cmrm alias <name> <new-alias> |
Add a globally-unique alias to a config/profile |
cmrm <tool> import <file> |
Import a config from a file into Claude or Codex storage |
cmrm set-lang <zh/en/ja> |
Set interface language directly |
cmrm --help / -h |
Show help |
<name> is globally unique across all tools. Its canonical form is model for Claude and provider/model for Codex. Shortcut matching follows: canonical name β legacy custom name (old data only) β aliases β model. Aliases are also globally unique across all configs and tools.
All selections use index-based input:
- Enter the number shown in brackets
[0],[1], etc. - Press
Enterto confirm - Most menus include:
[n-2]Return to previous level[n-1]Exit directly
Example:
=== Select Command ===
(Enter index number to confirm)
[0] /switch Switch saved config/profile
[1] /add Add new config
[2] /remove Remove saved config
[3] /info View config details
[4] /test Test configuration
[5] /list Show all configs
[6] /current Show current config
[7] /exit Exit
Enter command index: 0
Use /add command. You'll first choose between two modes:
-
Template-based (recommended, Claude) - Select from 9 built-in provider templates:
- DeepSeek, Zhipu AI (bigmodel/Z.AI), Kimi, Minimax (CN/Intl), OpenRouter, Xiaomi MiMo, Alibaba Qwen
- Template pre-fills
model,baseUrl,apiType, and optional models - You only need to enter your API Key
-
Custom - Enter all fields manually:
- Config name (optional) - Friendly name for this config
- API type (required) -
anthropicoropenai, defaults toanthropic - Model name (required)
- API Key (required)
- Base URL (required)
- Haiku/Sonnet/Opus model (optional)
For Codex custom add:
provideris required and becomes part of the canonical profile identity- The primary saved
nameis always canonical: Claude usesmodel, Codex usesprovider/model - The optional add prompt stores an extra alias, not a replacement primary name
- Example default name:
uino/gpt-5.4
π‘ After entering the configuration, cmrm will send a ping request to verify it. If the test fails, you'll be asked whether to save it anyway.
Templates are stored in ~/.cmrm/templates.json and support hot-reload - edit the file and changes take effect immediately without restarting.
- First launch: Automatically fetches the latest templates from GitHub Raw; falls back to built-in defaults if offline
- Custom templates: Edit
~/.cmrm/templates.jsonto add your own providers - Refresh: Delete
~/.cmrm/templates.jsonand restart to re-fetch from remote
Use /test command to verify a configuration:
- Select a tool (e.g., Claude or Codex)
- Choose a test scenario:
- Test saved config/profile - Pick from existing configurations
- Custom parameters - Enter parameters ad-hoc without saving
Error classifications:
| Error kind | Description |
|---|---|
auth |
Authentication failure (401/403), usually wrong API key |
not_found |
Model not found (404) |
rate_limit |
Rate limit exceeded (429) |
server |
Server error (5xx) |
network |
Network error (ECONNREFUSED/ENOTFOUND, usually wrong baseUrl) |
timeout |
Request timeout (10s by default) |
invalid_response |
Response format invalid |
cmrm supports two API protocol formats:
-
anthropic (default) - Claude Messages API format
- Path:
/v1/messages - Auth header:
x-api-key: <key> - For official Claude API and Anthropic-compatible proxies
- Path:
-
openai - OpenAI Chat Completions format
- Path:
/v1/chat/completions - Auth header:
Authorization: Bearer <key> - For OpenRouter, DeepSeek, Together, and other OpenAI-compatible proxies
- Path:
Use /switch command:
- Select a tool (e.g., Claude or Codex)
- Enter the index number of the config/profile to switch to
- cmrm writes the corresponding tool config files
Codex note:
- Codex entries are treated as profiles, not just raw model names
- The effective identity is
provider + model - Example saved profile names:
openrouter/gpt-5.4uino/gpt-5.4
Use /info command:
- Select a tool
- Select a config/profile
- View the complete configuration in JSON format
Example output:
{
"name": "claude-sonnet",
"model": "claude-sonnet-4-5",
"apiKey": "sk-xxx...",
"baseUrl": "https://api.anthropic.com",
"apiType": "anthropic",
"haikuModel": "claude-haiku-4",
"sonnetModel": "claude-sonnet-4"
}| Tool | Config Path | Format | Description |
|---|---|---|---|
| Claude | ~/.claude/settings.json |
JSON | Settings and active model config |
| Codex | ~/.codex/config.toml |
TOML | Active provider/model profile |
| Codex auth | ~/.codex/auth.json |
JSON | API key storage for Codex |
| cmrm storage | ~/.cmrm/settings.json |
JSON | Saved Claude configs and Codex profiles |
| cmrm templates | ~/.cmrm/templates.json |
JSON | Provider templates (hot-reloadable) |
- β Full support for model switching
- Configuration is persisted in
settings.json - Switched model becomes the default for new sessions
- β Full support for provider/model profile switching
- Active profile is written to
~/.codex/config.toml - API key is synced to
~/.codex/auth.json - Default saved identity is always canonical
provider/model /addonly stores profiles in~/.cmrm/settings.json/switchdoes not change the existing runtime provider in Codex when one already exists- Switching updates
model,model_reasoning_effort, top-levelopenai_base_url, that provider'sbase_url, andauth.json - Only when Codex has no provider configured yet will cmrm create an
openaiprovider and setopenai_base_url
Backups are created automatically before writes:
- Claude config backups are stored under
~/.claude/.cmrm/ - cmrm storage backups use
settings.json.backup.YYYYMMDDNNbeside~/.cmrm/settings.json - Codex config writes also create backups when
config.tomlalready exists
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm run test
# Run in development mode
npm run dev
# Start the CLI
npm start- π Add full Codex support: save/switch/test/import Codex profiles
- π Add
cmrm <tool> import <file>shortcut for Claude/Codex config import - π Canonical name system: Claude uses
model, Codex usesprovider/model - π Fix Codex runtime switching semantics: keep existing provider, sync
openai_base_url, providerbase_url, andauth.json - π Clarify
/currentfor Codex with runtime vs saved identity display - π Fix Windows configuration compatibility issues
- π
cmrm set-lang <zh|en/ja>shortcut to set language without interactive menu - π¦ Auto-backup
settings.jsonon every write with formatsettings.json.backup.YYYYMMDDNN - β‘ Skip tool selection when only one adapter is registered
- π·οΈ Show tool name suffix in model selection menu for clarity
- π
cmrm --version/-vto display version number - π Fix Fatal error on first run when settings.json is missing
- π Fix module-level
t()calls resolving before i18n initialization
- π Add multi-language support (zh/en/ja) with geo-detection auto-switch
- π Add
/set-langcommand for manual language switching - π Add test retry mechanism (3 retries by default, configurable via
settings.retry) - π Migrate all UI text to i18n system, remove hardcoded strings
- π Add model templates: 9 built-in provider templates,
/addsupports template-based or custom adding - π Templates hot-reload from
~/.cmrm/templates.json, auto-fetch from GitHub Raw on first launch - π Template fields auto-filled (model, baseUrl, apiType), only API Key required
- π Extract
TemplateManager,TemplateFetcher,IndexPrompt,TemplateAddHandlermodules
- β¨ Add model multi-aliases management:
UnifiedModelConfig.aliases?: string[], globally unique across tools/models - β¨ Add
/aliasinteractive command (add / remove / list aliases) - β¨ Add
cmrm alias <model> <new-alias>CLI shortcut - π
findModelByNameextends two-tier lookup to three:nameβaliasesβmodel, enablingcmrm switch <alias> - π§ͺ Add
/testcommand to test saved or custom model configurations - π Add OpenAI Chat Completions API support (in addition to Anthropic)
- β¨
/addnow asks for API type and auto-tests the configuration before saving - π Sanitize error output to prevent API key leakage during testing
- β¨ Add
/infocommand to view model details in JSON format - β©οΈ Add "return to previous level" and "exit" options in selection menus
- π’ Switch to index-based selection (input numbers instead of arrow keys)
- π Simplified architecture (single-tool focus - Claude only)
- β
Command rename:
/switch-modelβ/switch,/add-modelβ/add - β
Add
/removecommand to delete saved configurations - π¦ Backup mechanism before config writes
- π Merge strategy preserving existing fields
- Initial release
- Support for Claude model switching
- Interactive model configuration
- Bilingual command descriptions
MIT
lvdaxianerplus