# switcher
A terminal UI tool for managing multiple accounts across CLI tools like Codex CLI.
Many CLI tools store credentials and configuration in fixed locations under your home directory, making it awkward to switch between accounts — for example, a personal and a work Codex account. switcher solves this by giving each account its own isolated home directory under `~/.config/switcher/profiles/<app>/<name>/`. When you select an account, switcher launches the target application with `HOME` set to that profile directory. Your real home directory and any active sessions are left untouched.
## Install
Build from source:
```sh
git clone https://github.com/aasm3535/switcher
cd switcher
cargo install --path .
```
Or, once published to crates.io:
```sh
cargo install switcher
```
## Usage
Open the TUI and navigate to the app and account you want:
```sh
switcher
```
Jump directly to the Codex account list:
```sh
switcher --codex
```
Add a new Codex account without opening the TUI:
```sh
switcher add codex
```
### TUI key bindings
| `j` / `Down` | Move selection down |
| `k` / `Up` | Move selection up |
| `Enter` | Select / confirm |
| `a` | Add a new account |
| `d` | Delete the selected account |
| `q` / `Esc` | Quit or go back |
## Profiles
Each account profile is stored at:
```
~/.config/switcher/profiles/<app>/<name>/
```
For example, a Codex account named `work` lives at:
```
~/.config/switcher/profiles/codex/work/
```
That directory acts as the `HOME` for the launched process. Any files the application would normally write to `~/` — config files, auth tokens, cache — are written there instead, fully isolated from your real home directory and from other profiles.
## Supported apps
- Codex CLI (`codex`)
## Adding a new app
Implement the `AppDriver` trait, which defines the application's name, launch command, and any setup steps needed when creating a new profile. Register the driver in `all_drivers()` and add the corresponding CLI flag. See `docs/plans/2026-02-24-switcher-design.md` for a full walkthrough of the architecture and the trait interface.
## License
MIT