@scuton/git-whoami
v1.0.0
Published
Show your git identity, SSH keys, GPG status, and remote config at a glance.
Maintainers
Readme
@scuton/git-whoami
Show your git identity, SSH keys, GPG status, and remote config at a glance.
Install
npm install -g @scuton/git-whoamiOr use directly with npx:
npx @scuton/git-whoamiUsage
CLI
git-whoamiOutput:
Git Identity
Name: John Doe
Email: [email protected]
Scope: global
SSH
Key: ~/.ssh/id_ed25519 (ED25519)
Agent: running (1 keys loaded)
GitHub: ✓ authenticated
GPG
Key: ABC123DEF456
Signing: enabled
Remote (origin)
URL: [email protected]:user/repo.git
Protocol: SSH
Config
Default branch: main
Auto CRLF: false
Pull rebase: trueJSON output
git-whoami --jsonReturns a structured JSON object with all identity information.
Programmatic API
import { whoami } from '@scuton/git-whoami';
const result = whoami();
console.log(result.identity.name);
console.log(result.ssh.githubAuth);Individual functions are also available:
import {
getIdentity,
getSSHInfo,
getGPGInfo,
getRemoteInfo,
getGitConfig,
} from '@scuton/git-whoami';
const identity = getIdentity();
// { name: 'John Doe', email: '[email protected]', scope: 'global' }
const ssh = getSSHInfo();
// { keyPath: '~/.ssh/id_ed25519', keyType: 'ED25519', agentRunning: true, keysLoaded: 1, githubAuth: true }
const gpg = getGPGInfo();
// { keyId: 'ABC123DEF456', signingEnabled: true }
const remote = getRemoteInfo();
// { url: '[email protected]:user/repo.git', protocol: 'SSH' }
const config = getGitConfig();
// { defaultBranch: 'main', autoCRLF: 'false', pullRebase: 'true' }Options
| Flag | Description |
| ---------- | ------------------------------------ |
| --json | Output all info as JSON |
| --help | Show help message |
License
MIT - Scuton Technology
