gitswitch 0.1.0

Switch between GitHub accounts (git identity + gh auth) on the fly
# gitswitch

Switch between GitHub accounts (work, personal, …) on the fly. One command flips
your global git commit identity **and** the active GitHub `gh` CLI account, so
you can clone and push as the right account without hand-editing config.

## Install

```sh
cargo install gitswitch
```

Requires [git](https://git-scm.com/) and the [GitHub CLI (`gh`)](https://cli.github.com/)
on your `PATH`. You authenticate to GitHub over HTTPS via `gh`; `gitswitch`
delegates all auth to it.

## Usage

```sh
gitswitch add work        # interactively prompts for name, email, GitHub username
gitswitch add personal

gitswitch work            # ← switch: sets git identity + `gh auth switch`
gitswitch list            # list profiles; * marks the active one
gitswitch current         # show the current identity and active gh account
gitswitch remove personal
```

Running `gitswitch <alias>`:

1. Sets your **global** `user.name` / `user.email`.
2. Runs `gh auth switch --user <gh_user>` so `git clone`/`push` over HTTPS use
   that account's token automatically.

If the target `gh` account isn't logged in yet, `gitswitch` offers to walk you
through `gh auth login` and then retries the switch.

## Config

Profiles live in `~/.config/gitswitch/config.toml`:

```toml
[accounts.work]
name    = "Jane Doe"
email   = "jane@company.com"
gh_user = "jane-work"

[accounts.personal]
name    = "uzii"
email   = "uzii@example.com"
gh_user = "uzii"
```

You can edit it by hand or manage it with `gitswitch add` / `remove`.

## License

MIT