RSS Amplifier

Burak Dede Blog · Mar 25, 2026

Project `aisw` : Switching Between Multiple Accounts in Claude Code, Codex CLI, and Gemini CLI

0
Sign in to vote or save

Burak Dede · Burak Dede

I use Claude Code , Codex CLI , and Gemini CLI every day. In practice that often means more than one account per tool: work on one, personal on another, sometimes a backup subscription when quotas get tight.

The annoying part is not logging in once. It is switching repeatedly. Each tool stores auth differently, and the fallback is always some variation of: log out, redo the browser OAuth flow, or manually swap credential files and environment variables. After doing that enough times, I built aisw .

The gap

None of these tools gives you a clean, first-class named-profile workflow for managing multiple accounts. There are env var overrides (CLAUDE_CONFIG_DIR, CODEX_HOME), and there are open feature requests like Codex CLI’s --auth-profile proposal and Claude Code’s multi-account request , but the burden of making switching ergonomic still falls on the user. You end up writing shell aliases, copying credential files, or logging in and out repeatedly.

aisw gives those workarounds a consistent interface: named profiles, explicit switching, backups, and shell integration across all three tools.

What it does

Five commands:

aisw add claude work        # add an account profile
aisw use claude personal    # switch to it
aisw list                   # see all profiles
aisw status                 # what's active right now
aisw remove codex old       # clean up

That is the whole idea. No scheduler, no routing layer, no attempt to outsmart the upstream tools.

For Claude Code and Codex CLI, it uses their native env var overrides to point at profile-specific directories under ~/.aisw/profiles/. For Gemini CLI, it rewrites ~/.gemini/.env. Credentials are treated as opaque blobs, meaning upstream tool updates shouldn’t break things.

Design choices

Tool-native auth. When you aisw add a profile, it launches the tool’s own login flow (the same OAuth browser flow you would normally use) but directs credentials into an isolated profile directory. aisw never asks you to paste tokens and never touches credentials it did not create.

No magic. You decide when to switch. No daemon, no quota polling, no background processes. Explicit beats clever when you are dealing with auth credentials.

Backups by default. Every switch snapshots your current credentials. Roll back anytime with aisw backup restore.

Rust, single binary. No runtime dependencies. Fast enough to sit comfortably in a shell hook via eval "$(aisw shell-hook zsh)".

Getting started

# Install
curl -fsSL https://raw.githubusercontent.com/burakdede/aisw/main/install.sh | bash

# or via Homebrew
brew install aisw

# or via Cargo
cargo install aisw

Run aisw init to detect your installed tools, set up shell integration, and import existing credentials as your first profiles.

What’s next

The core workflow works across all three tools on macOS and Linux. Shell integration covers bash and zsh. Things I want to add: a doctor command for validating stale profiles, profile export/import for moving between machines, and an exec mode for one-off commands under a specific profile without switching globally.

Common Questions

How do I switch between multiple Claude Code, Codex CLI, and Gemini CLI accounts?

The article explains the workflow problem and introduces aisw as a local tool for managing named profiles and switching accounts more deliberately across those coding-agent CLIs.

Why is multi-account support a problem in AI coding CLIs?

Most of these tools still assume a single-account happy path. Real workflows often involve work, personal, client, or API-key-based setups that need clearer isolation and faster switching.

What is aisw?

aisw is a lightweight CLI for storing and switching account profiles across Claude Code, Codex CLI, and Gemini CLI so developers do not have to keep juggling auth directories and manual login cycles.

Read the original on burakdede.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.