gid identity renamed to gid id
The subcommand group is now gid id — list, add, edit, remove, show are unchanged. gid identity still works as an alias, so existing scripts keep running.
Personal and work GitHub accounts on one machine, without the SSH config archaeology. Map a directory to an identity once — every repo inside it commits, clones, and authenticates as the right user, permanently.
—
Total npm downloads
1.0.5
Latest version
MIT
License
GiMan is a thin, auditable layer over primitives Git and SSH already have. It writes plain text you can read, and unwrites it just as cleanly.
Initialize with a single command. No config files to hand-edit, no key paths to memorize.
gid initSwitches SSH keys and commit identity based on the directory you're working in. No shell hooks, no aliases.
gid dir add <path>Inspect, edit, and apply from the terminal. Every write is marked and reversible.
gid status
gid id list
gid apply
GiMan manages exactly three files on your behalf. Every change is opt-in, marked, and safe to re-run.
~/.giman/config.json
Stores identities, SSH key paths, and directory mappings. Edit it by hand or drive it with gid id commands.
~/.gitconfig
GiMan appends includeIf "gitdir:…" blocks that activate a per-identity gitconfig for specific directories automatically.
~/.ssh/config
GiMan writes Host alias blocks — e.g. github-personal — mapping to github.com with the matching SSH key.
What changed in each release.
gid identity renamed to gid idThe subcommand group is now gid id — list, add, edit, remove, show are unchanged. gid identity still works as an alias, so existing scripts keep running.
gid id remove now cleans up ~/.gitconfig includeIf entriesRemoving an identity previously left stale [includeIf] blocks pointing at deleted gitconfig files. These are now pruned on removal.
Spaces and special characters are rejected at input. Previously, entering github my work would write a broken Host github my work entry — three patterns instead of one.
The ssh-keygen subprocess previously inherited the parent's terminal stdin and had stdout piped but never consumed. Changed to ['ignore', 'ignore', 'pipe'] — only stderr is captured, for error reporting.
resolveHome('$HOME') now correctly expands to the home directoryBare $HOME (without trailing slash) was returned as the literal string. It is now expanded the same way as $HOME/ and ~/.
gid dir add now resolves relative paths against CWDPaths like ./subdir, ., and ../other are expanded to absolute paths before being stored. Previously they were saved as-is, causing gid status to never match — the relative path resolved against whichever directory you happened to run the next command from.
status.tsTwo separate import statements from ../services/config.js were consolidated into one.
gid clone commandClone a GitHub repo via SSH with interactive identity selection. GiMan rewrites the URL to use the chosen identity's host alias automatically.
Identity IDs are validated against /^[a-zA-Z0-9_-]+$/ and paths are asserted to stay within their expected base directories.
gid init, gid identity add/edit/remove/show/listCreate and manage multiple git identities (name, email, SSH key, host alias) stored in ~/.giman/config.json.
gid dir add/remove/listMap a directory to an identity so git automatically uses the right user and SSH key for any repo inside that path.
gid applyWrites Host blocks to ~/.ssh/config and includeIf rules to ~/.gitconfig. All changes are opt-in, and GiMan markers make them safe to re-run.