plugins/scm-utils/skills/auth-user/SKILL.md
Identify the authenticated user for GitHub CLI (gh) and Git
npx skillsauth add nsheaps/ai-mktpl auth-userInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps identify which user account is authenticated for GitHub CLI (gh) and Git operations. Use this to troubleshoot authentication issues, verify the correct account is in use, or understand how credentials are configured.
| Method | Command | Shows |
| ------------------ | ----------------------------- | ---------------------------------- |
| GitHub CLI | gh auth status | Active gh account, auth method |
| HTTPS credentials | git credential fill | Stored username/password for HTTPS |
| SSH connection | ssh -T [email protected] | SSH key owner |
| Token verification | GH_TOKEN=... gh auth status | Token owner |
gh)gh auth status
Example output:
github.com
✓ Logged in to github.com account octocat (/home/user/.config/gh/hosts.yml)
- Active account: true
- Git operations protocol: https
- Token: ghp_************************************
- Token scopes: 'gist', 'read:org', 'repo', 'workflow'
gh auth status --hostname github.example.com
gh config list
Shows settings like git_protocol, editor, and prompt.
To see who a specific token belongs to:
GH_TOKEN="your_token_here" gh auth status
This is useful when you have a token (e.g., from environment variables or CI) and need to verify which account it authenticates as.
gh auth token
Returns the raw token for the current account.
echo "protocol=https
host=github.com" | git credential fill
Example output:
protocol=https
host=github.com
username=octocat
password=ghp_xxxxxxxxxxxxxxxxxxxx
echo "protocol=https
host=gitlab.com" | git credential fill
echo "url=https://github.com" | git credential fill
Credentials may be stored in different locations depending on the credential helper:
| Helper | Storage Location |
| -------------- | -------------------------------- |
| store | ~/.git-credentials (plaintext) |
| cache | In-memory (temporary) |
| osxkeychain | macOS Keychain |
| manager | Windows Credential Manager |
| manager-core | Git Credential Manager |
Check configured helper:
git config --get credential.helper
ssh -T [email protected]
Successful output:
Hi octocat! You've successfully authenticated, but GitHub does not provide shell access.
The username shown is the GitHub account associated with your SSH key.
ssh -vT [email protected]
Shows which key file is being used for authentication.
# GitLab
ssh -T [email protected]
# Output: Welcome to GitLab, @username!
# Bitbucket
ssh -T [email protected]
# Output: authenticated via ssh key.
echo "protocol=ssh
host=github.com" | git credential fill
Note: SSH typically uses key-based auth, so this may not return credentials.
If you have multiple GitHub accounts:
# List all authenticated accounts
gh auth status
# Switch between accounts
gh auth switch
When HTTPS and SSH credentials point to different accounts:
Check which protocol Git is using:
git config --get remote.origin.url
URLs starting with https:// use HTTPS credentials
URLs starting with git@ use SSH keys
To see what permissions a token has:
gh auth status
Look for "Token scopes" in the output.
Based on the argument ($ARGUMENTS), check the relevant authentication method:
gh or no argument: Run gh auth status and gh config listgit or https: Run the git credential fill command for HTTPSssh: Run ssh -T [email protected]all: Run all checks and summarize which accounts are configuredAfter running commands, summarize:
tools
Reference material for Claude Code internals — the on-disk layout under ~/.claude and project-scope .claude, the plugin cache, session-env propagation, and the full hook lifecycle. Auto-recall when working on Claude-Code-related tasks: writing or debugging hooks, authoring plugins, inspecting session state, troubleshooting why an env var is or isn't visible to a Bash tool call, or when paths under ~/.claude or ~/.claude/plugins/ come up.
development
Manage GitHub App installation tokens in Claude Code sessions. Use when tokens expire, auth errors occur in long-running sessions, or when setting up GitHub App credentials for agent teams. <example>my github token expired</example> <example>refresh the github app token</example> <example>check token status</example> <example>set up github app authentication for this session</example>
tools
Auto-detect project formatting tools and configure edit-utils settings
tools
Use this skill when the user asks about 1Password, secrets management, retrieving credentials, using op CLI, service accounts, secret references, vault operations, or any task involving the 1Password CLI (op). Also use when needing to inject secrets into environment variables, read passwords or API keys from 1Password, or manage 1Password items from the command line.