Skip to content

Quickstart

This guide walks through installing aisw, running the first-run wizard, and switching between accounts.

It is the fastest path if you want to:

  • install an AI CLI account switcher
  • manage multiple Claude Code accounts on one machine
  • manage multiple Codex CLI accounts on one machine
  • manage multiple Gemini CLI accounts on one machine
  • switch between work and personal AI CLI profiles

Install from crates.io:

Terminal window
cargo install aisw

For local development, build from the checked out repository:

Terminal window
cargo install --path .

Or download a pre-built binary from the GitHub Releases page and place it somewhere on your PATH.


Terminal window
aisw init

The wizard will:

  1. Create ~/.aisw/ and write a default config.json.
  2. Detect your shell and offer to append the shell hook to your RC file.
  3. Scan for existing credentials for Claude Code, Codex CLI, and Gemini CLI, and offer to import each one with defaults of profile name default and label imported. You can override both during interactive onboarding. Imported live credentials become active by default unless aisw is already managing an active profile for that tool. When an import is marked active, aisw also applies it to the live tool config immediately.

Running aisw init a second time is safe — the shell hook will not be duplicated, and existing profiles will not be overwritten.

Successful setup also prints a short next-step hint so you can move directly into list or use.

The shell hook is optional. Normal aisw use behavior updates the live config locations that Claude, Codex, and Gemini actually read, so standalone claude, codex, and gemini commands pick up the selected profile without extra shell steps.

Accept the prompt during init, or install the hook manually if you want shell-level environment exports for advanced or manual workflows:

ShellCommand
bashecho 'eval "$(aisw shell-hook bash)"' >> ~/.bashrc
zshecho 'eval "$(aisw shell-hook zsh)"' >> ~/.zshrc
fish`echo ‘aisw shell-hook fish

After adding the hook, restart your shell or source the file.


Terminal window
aisw add claude work --api-key sk-ant-api03-...
aisw add codex personal --api-key sk-...
aisw add gemini client --api-key AIza...

Use --label to add a human-readable description:

Terminal window
aisw add claude work --api-key sk-ant-api03-... --label "Work subscription"

Use --set-active to switch to the new profile immediately after adding it:

Terminal window
aisw add claude work --api-key sk-ant-api03-... --set-active

Terminal window
aisw use claude work
aisw use codex personal

The selected profile is applied directly to the live config location each tool reads. For manual shell workflows, --emit-env is still available:

Terminal window
eval "$(aisw use claude work --emit-env)"

Terminal window
aisw status

Shows which profile is active for each tool, whether the binary is installed, and the state of credential files and whether the live tool config matches the configured active profile. Token validity, quota, and subscription state are not checked. If profiles are stored for a tool but none is active, status reports that explicitly.


Terminal window
aisw list
aisw list claude
aisw list --json

Terminal window
aisw remove claude old-work

A backup of the profile is created before deletion. Use --force to remove the currently active profile, and --yes to skip the confirmation prompt.

If you are scripting aisw today:

  • use --yes for init, remove, and backup restore
  • use --api-key for non-interactive add
  • use --json on list, status, and backup list
  • use use --emit-env only when you explicitly want raw shell exports

Terminal window
aisw rename claude default work

Use this when onboarding imported a generic profile name like default and you want a clearer identifier without deleting and recreating the profile.