multi-account-cli

Installation
SKILL.md

Multi-Account CLI Profiles

Pattern: shell functions (work / personal) activate all tools at once. Store projects per-repo, not in profiles.

Two tool classes, two mechanisms:

  • Cloud CLIs (gcloud, gws, Firebase, Netlify) — one work/personal switcher flips them all. Steps 1–6 below.
  • AI coding CLIs (Claude Code, Codex, Gemini) — two mechanisms: isolate per account with a config-dir env var (section right below), or route per request through a local proxy (section after it).

AI Coding CLIs (Claude Code, Codex, Gemini)

Each CLI stores login + config + MCP servers in a home dir and exposes an env var to relocate it. Give each account its own dir → separate login, keys, and MCP; symlink the parts you want shared (skills, instructions). Bare command stays = primary (work); add explicit -work / -personal.

CLI Config-dir env var Default dir Notes
Claude Code CLAUDE_CONFIG_DIR ~/.claude Relocates .claude.json (MCP) too. Credentials are OS-keychain entries namespaced per config dir, so two logins coexist — no eviction.
Codex CODEX_HOME ~/.codex Relocates auth.json + config.toml + MCP. Dir must exist first (mkdir -p).
Gemini GEMINI_CLI_HOME ~/.gemini (config lands in $DIR/.gemini) Auth is driven by settings.json (security.auth.selectedType), not by env — setting an API-key env alone does NOT override a cached login. Isolate the whole dir.
Installs
3
GitHub Stars
1
First Seen
Jul 29, 2026