Observed since 20 Oct, 22:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Cross-platform CLI for switching Claude and Codex API profiles.
agentkeyswitch is a cross-platform CLI for switching API profiles used by local AI agents such as Claude Code and Codex.
It keeps your reusable profiles in one local store and applies them to the real config files only when you run a switch command.
claudecodexagswitch listagswitch statusagswitch add <profile>agswitch import <profile>agswitch import-existingagswitch use <agent> <profile>agswitch remove <profile>agswitch help [command]pip install agentkeyswitch
For local development:
pip install -e .
Profiles are stored at:
Linux: ~/.config/agentkeyswitch/profiles.json
Windows: %APPDATA%\agentkeyswitch\profiles.json
You can override the runtime locations with environment variables:
AGSWITCH_HOMEAGSWITCH_STOREXDG_CONFIG_HOMEAPPDATAThis is mainly useful for testing or migration.
Add a profile interactively:
agswitch add max
Add a profile non-interactively:
agswitch add CCC \
--agent all \
--claude-token 'xxx' \
--claude-base-url 'https://CCCai.online/v1' \
--claude-model 'opus' \
--codex-key 'xxx' \
--codex-base-url 'https://CCCai.online/v1' \
--codex-provider 'CCC'
Import the current live configs into a reusable profile:
agswitch import max --agent all
Batch import your existing named files:
agswitch import-existing
Batch import when your filenames use another separator:
agswitch import-existing --separator "_"
Also include the current live config as current:
agswitch import-existing --include-current
Switch Claude only:
agswitch use claude max
Switch both Claude and Codex:
agswitch use all CCC
Check current live status:
agswitch status
Show detailed help:
agswitch help
agswitch help use
agswitch list now prints profiles as readable blocks instead of one compressed line:
Stored Profiles (3)
-------------------
- AAA
claude yes (token: AAA-...oken)
codex no
- BBB
claude no
codex yes (key: BBB...-key)
- CCC
claude yes (token: CCC...oken)
codex yes (key: CCC...-key)
agswitch status uses the same block style:
Live Status
-----------
- claude
profile CCC
base_url https://CCCai.online/v1
token CCC...oken
model opus
paths 1
/home/you/.claude/settings.json
- codex
profile CCC
base_url https://CCCai.online/v1
api_key CCC...-key
provider CCC
wire_api responses
paths 2
/home/you/.codex/auth.json
/home/you/.codex/config.toml
agswitch import-existing also shows imported items in the same format:
Imported Profiles (2)
---------------------
- max
agents claude
- CCC
agents claude, codex
agswitch use all CCC will print the applied profile and backup files:
Applied Profile
---------------
profile CCC
agent all
- claude
backups 1
/home/you/.config/agentkeyswitch/backups/.../settings.json
- codex
backups 2
/home/you/.config/agentkeyswitch/backups/.../auth.json
/home/you/.config/agentkeyswitch/backups/.../config.toml
claude
~/.claude/settings.jsoncodex
~/.codex/auth.json~/.codex/config.tomlNamed files discovered by import-existing
Default naming rule:
~/.claude/settings - <profile>.json~/.codex/auth - <profile>.jsonThat means these files:
~/.claude/settings - max.json~/.codex/auth - max.jsonwill be imported as the same profile: max
If you use a different separator, pass it explicitly:
agswitch import-existing --separator "_":
~/.claude/settings_<profile>.json~/.codex/auth_<profile>.jsonagswitch import-existing --separator "-":
~/.claude/settings-<profile>.json~/.codex/auth-<profile>.jsonImport behavior:
claude section.codex section.--include-current will additionally import the currently active live config as profile current.--overwrite allows replacing already stored sections with newly imported ones.The tool updates only the necessary fields and keeps unrelated settings intact. Before writing, it creates timestamped backups under:
Linux: ~/.config/agentkeyswitch/backups/
Windows: %APPDATA%\agentkeyswitch\backups\
auth.json and config.toml so provider selection remains consistent.Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.4.0 | 8 Apr 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7c781244902ccb7d83f4bed4aa9e4b0d9e0aca4e6fc3662e46be5e075e5f4fb9