github-auth

Configures GitHub authentication via HTTPS tokens, SSH keys, or gh CLI login.

1|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/specdog/collar --skill github-auth-specdog
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: github-auth
Source: https://github.com/specdog/collar/tree/main/skills/github/github-auth
Command: npx skills add https://github.com/specdog/collar --skill github-auth-specdog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Setting up GitHub authentication for an agent or developer environment involves multiple confusing paths — personal access tokens, SSH keys, gh CLI login, and credential helpers — and failures like blocked device flows or stale cached credentials waste time. This Skill provides a detection flow and step-by-step setup so Git operations and GitHub API calls work without repeated auth prompts. ## Core Features & Use Cases - Auth Detection Flow: Checks for git, gh CLI, existing credentials, and token sources (env vars, ~/.git-credentials, ~/.dag/.env) to determine the current auth method before doing anything. - Git-Only Setup: Configures HTTPS personal access tokens with credential helpers or SSH ed25519 keys with URL rewriting — no sudo or gh installation required. - gh CLI Login: Prefers one-command token-based login (gh auth login --with-token) and documents device-flow pitfalls with a background-process fallback recipe. - Use Case: An agent needs to clone a repo and open a pull request on a fresh machine. It runs the detection script, finds no auth, walks the user through creating a token, stores it via the credential helper, and verifies push access. ## Quick Start Set up GitHub authentication on this machine so I can clone repos and push commits without being prompted for credentials.

Frequently Asked Questions about github-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate git with GitHub using a personal access token?▼

Generate a classic token at github.com/settings/tokens with repo and workflow scopes, then run git config --global credential.helper store and perform any git operation like git ls-remote, entering the token as the password. Credentials are saved and reused for all future operations.

How to set up SSH key authentication for GitHub?▼

Generate an ed25519 key with ssh-keygen -t ed25519, add the public key at github.com/settings/keys, and verify with ssh -T git@github.com. Optionally configure git config --global url."git@github.com:".insteadOf to rewrite HTTPS URLs to SSH automatically.

Should I use gh CLI or git credential helper for GitHub auth?▼

Use gh CLI if installed since gh auth login plus gh auth setup-git handles both API access and git credentials in one step. If gh is not installed and you lack sudo, the git credential helper with a personal access token works with no installation.

Why does gh auth login fail or hang in a terminal sandbox?▼

The device flow blocks waiting for browser authorization, and sandboxed terminals may send SIGINT to interactive processes, killing the auth. Use token auth instead: echo "TOKEN" | gh auth login --with-token completes instantly without browser interaction.

Why does git push keep asking for a password on GitHub?▼

GitHub disabled password authentication, so you must use a personal access token as the password or switch to SSH keys. Also verify git config --global credential.helper is set to store or cache so credentials persist between operations.

Can I use the GitHub API without installing gh CLI?▼

Yes, use curl with a personal access token: curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user. The token can be exported as an environment variable or extracted from ~/.git-credentials if git auth is already configured.