github-auth

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

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill github-auth-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-auth
Source: https://github.com/CHENHUI-X/toolbox/tree/main/custom-skills/github/github-auth
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill github-auth-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Setting up GitHub authentication on a new machine or headless server is error-prone: password auth is disabled, tokens need the right scopes, SSH keys must be registered, and gh CLI login can hang on keyring-less systems. This Skill walks through every authentication path with detection logic and proven workarounds. ## Core Features & Use Cases - Multi-Method Authentication: Set up HTTPS personal access tokens, SSH keys, or gh CLI login (browser, device flow, or token-based) depending on what tools are installed. - Headless & Agent-Driven Support: Includes a manual OAuth device flow and a hosts.yml fallback for servers where gh auth login --with-token hangs on missing keyrings. - Environment Detection Script: Source gh-env.sh to detect the active auth method, resolve the GitHub username, and identify the current repo's owner/name. - Use Case: You are on a fresh VPS with only git installed. The Skill guides you to create a personal access token, configure the credential helper, set git identity, and verify push access — no sudo or gh installation required. ## 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 without a password?

GitHub disabled password authentication, so use a personal access token as the password with the credential.helper store, or set up SSH keys. Create a token at github.com/settings/tokens with repo and workflow scopes, then run any git operation to cache it.

How to set up gh CLI login on a headless server?

Use the OAuth device flow: request a device code with curl, have the user enter it at github.com/login/device, then poll for the access token. If gh auth login --with-token hangs on keyring-less systems, write the token directly to ~/.config/gh/hosts.yml instead.

Should I use SSH keys or HTTPS tokens for GitHub?

HTTPS personal access tokens are the most portable and work everywhere without SSH configuration. SSH keys suit users who already have keys or prefer them; generate an ed25519 key, add the public key at github.com/settings/keys, and test with ssh -T [email protected].

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

GitHub disabled password authentication for git operations. You must use a personal access token in place of the password, or switch the remote to SSH. Also verify credential.helper is set to store or cache so credentials persist.

Can I use the GitHub API without installing gh CLI?

Yes, call the REST API directly with curl using an Authorization: token header and a personal access token. The token can be exported as GITHUB_TOKEN or extracted from the git credential store with the included helper script.

Why does gh auth login hang on my Linux server?

On headless systems without a dbus secret-service keyring, gh's credential storage can block indefinitely, even with --insecure-storage. Wrap the command in timeout 20 and fall back to writing ~/.config/gh/hosts.yml directly, which gh auth status reads without the keyring.