github-auth

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

1|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Chia1104/agent-air --skill github-auth-chia1104
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: github-auth
Source: https://github.com/Chia1104/agent-air/tree/main/skills/hermes/github/github-auth
Command: npx skills add https://github.com/Chia1104/agent-air --skill github-auth-chia1104

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Setting up GitHub authentication on a new or headless machine is error-prone: password auth is disabled, gh CLI logins can hang on keyring-less systems, and agents need a reliable way to detect which auth method is available. This Skill walks through token, SSH, and gh CLI setup with proven fallbacks. ## Core Features & Use Cases - Multiple Auth Paths: Covers HTTPS personal access tokens with git credential helpers, SSH key generation and configuration, and gh CLI login including the OAuth device flow for headless sessions. - Auth Detection Helpers: Ships a sourceable bash script (gh-env.sh) that detects the active auth method, resolves the GitHub username, and extracts repo owner/name from the git remote, plus a Python script that safely parses tokens from ~/.git-credentials. - Headless Fallbacks: Documents the hosts.yml workaround for when gh auth login --with-token hangs on keyring-less Linux systems, and curl-based API access when gh is not installed. - Use Case: An agent lands on a fresh VPS with no sudo and no browser. It detects gh is missing, guides the user to create a personal access token, configures the git credential store, and verifies push access — all without interactive prompts. ## Quick Start Set up GitHub authentication on this machine so I can clone, push, and work with my repositories.

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?▼

Create a token at github.com/settings/tokens with repo and workflow scopes, then run `git config --global credential.helper store` and perform any git operation, entering the token as the password. Credentials are saved to ~/.git-credentials and reused automatically.

How to set up GitHub SSH key authentication?▼

Generate an ed25519 key with `ssh-keygen -t ed25519`, add the public key at github.com/settings/keys, then verify with `ssh -T [email protected]`. Optionally configure git to rewrite HTTPS URLs to SSH using the url.insteadOf setting.

Why does gh auth login --with-token hang on headless Linux?▼

On keyring-less systems without a dbus session, gh's credential storage blocks indefinitely waiting on a secret-service keyring. Wrap the command in `timeout 20` and, if it hangs, write the token directly to ~/.config/gh/hosts.yml instead.

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

Yes, use curl with a personal access token in the Authorization header, e.g. `curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user`. The token can be exported as an environment variable or extracted from the git credential store.

How do I fix 'fatal: Authentication failed' when pushing to GitHub?▼

GitHub disabled password authentication, so cached credentials may be stale. Run `git credential reject` to clear them, then re-authenticate using a personal access token as the password or switch to SSH keys.