gh-auth
- Repo stars 330
- License MIT
- Author updated Live
- Author repo claude-skill-registry
- Domain
- Data
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @majiayu000 · MIT
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Required · GitHub
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Env read
- Network behavior
- External requests
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: gh-auth
description: Automatically authenticate GitHub CLI using .gh-token.txt when seeing errors about "gh auth logi…
category: data
runtime: no special runtime
---
# gh-auth output preview
## PART A: Task fit
- Use case: Automatically authenticate GitHub CLI using .gh-token.txt when seeing errors about "gh auth login", "GH_TOKEN environment variable", or "not logged into any GitHub hosts".
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “When to Use / Authentication Steps / 1. Get repo root and authenticate” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Automatically authenticate GitHub CLI using .gh-token.txt when seeing errors about "gh auth login", "GH_TOKEN environment variable", or "not logged into any GitHub hosts"”.
- **02** When the source has headings, the agent prioritizes “When to Use / Authentication Steps / 1. Get repo root and authenticate” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, read environment variables; may access external network resources; requires GitHub API keys.
## Running Rules
- read files, write/modify files, read environment variables; may access external network resources; requires GitHub API keys.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, read environment variables.
Start with a small task and check whether the result follows “When to Use / Authentication Steps / 1. Get repo root and authenticate”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: gh-auth
description: Automatically authenticate GitHub CLI using .gh-token.txt when seeing errors about "gh auth logi…
category: data
source: majiayu000/claude-skill-registry
---
# gh-auth
## When to use
- Automatically authenticate GitHub CLI using .gh-token.txt when seeing errors about "gh auth login", "GH_TOKEN environm…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “When to Use / Authentication Steps / 1. Get repo root and authenticate” and keep inference separate from source facts.
- read files, write/modify files, read environment variables; may access external network resources; requires GitHub API keys.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "gh-auth" {
input -> user goal + target files + boundaries + acceptance criteria
context -> When to Use / Authentication Steps / 1. Get repo root and authenticate
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, read environment variables | may access external network resources
guardrails -> requires GitHub API keys + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} GitHub CLI Authentication
Automatically authenticate gh CLI using the token from .gh-token.txt in the repository root.
When to Use
Use this skill when:
- Seeing authentication errors: "gh auth login", "GH_TOKEN environment variable", "not logged into any GitHub hosts"
- Before running
ghcommands if auth status is uncertain - User explicitly requests GitHub authentication
Authentication Steps
1. Get repo root and authenticate
REPO_ROOT=$(git rev-parse --show-toplevel)
gh auth login --with-token < "$REPO_ROOT/.gh-token.txt"
2. Verify success
gh auth status
Should show: ✓ Logged in to github.com account <username>
3. Proceed with original task
If authentication was triggered by a failed command, retry that command.
Error Handling
Missing .gh-token.txt:
ERROR: .gh-token.txt not found in repository root
Create it:
1. Generate token: https://github.com/settings/tokens
2. Save to .gh-token.txt in repo root
3. File is git-ignored
Invalid token format:
ERROR: Invalid token format
Tokens should start with github_pat_ or ghp_
Check .gh-token.txt for correct token
Already authenticated:
If gh auth status shows active authentication, skip to the original task.
Example
User: "List pull requests"
Action:
- Run
gh pr list→ authentication error - Detect error → activate skill
- Run:
REPO_ROOT=$(git rev-parse --show-toplevel) && gh auth login --with-token < "$REPO_ROOT/.gh-token.txt" - Verify:
gh auth status→ success - Retry:
gh pr list→ returns PR list
Security
- Token read via stdin (never in command args or history)
.gh-token.txtshould be in.gitignore- Tokens masked in
gh auth statusoutput
Decide Fit First
Design Intent
How To Use It
Boundaries And Review