360 Secure SkillHub
360 安全技能中心

Github App Authentication

该 Skill 说明如何使用 ghapp 命令行工具以 GitHub App 身份完成认证,使 git 与 gh 的克隆、推送、拉取等操作使用安装令牌,提交归属机器人账号。内容覆盖交互式安装向导、认证配置与状态诊断、令牌获取与缓存刷新、配置管理及自更新命令。

rmorse
rmorse
热度 73.97
最近更新 2026-05-11 17:27:00
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps / API 集成 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ghapp
Metadata
name
ghapp
description
Give your AI agents and automations their own GitHub (App) identity. Authenticate using GitHub Apps so every commit, PR, and action is attributed to the bot — not your personal account.
homepage
https://github.com/operator-kit/ghapp-cli
metadata
{"clawdbot":{"emoji":"🔑","requires":{"bins":["ghapp"]},"install":[{"id":"brew","kind":"brew","formula":"operator-kit/tap/ghapp","bins":["ghapp"],"label":"Install ghapp (brew)"}]}}

ghapp

Use ghapp to authenticate as a GitHub App so git and gh commands use installation tokens. Requires a GitHub App with App ID, Installation ID, and a private key (.pem).

Setup

  • ghapp setup — interactive wizard: enter App ID, Installation ID, key path, then configure auth
  • ghapp auth configure — configure git + gh authentication (if skipped during setup)
  • ghapp auth status — show current auth config and diagnostics

Commands

  • ghapp --help — list all commands and flags
  • ghapp token — print an installation token (cached; --no-cache for fresh)
  • ghapp auth configure [--gh-auth shell-function|path-shim|none] — configure how git/gh authenticate
  • ghapp auth status — check auth health
  • ghapp auth reset [--remove-key] — undo all auth config
  • ghapp config set, ghapp config get [key], ghapp config path — manage config
  • ghapp update — self-update to latest release
  • ghapp version — print version

gh auth modes (passed to auth configure)

  • shell-function — auto-authenticates gh commands via shell integration (recommended)
  • path-shim — wrapper binary for CI/containers
  • none — static token in hosts.yml

Notes

  • After setup, git clone/push/pull and gh work without manual tokens.
  • Commits are attributed to the app's bot account (e.g., myapp[bot]).
  • Tokens are cached locally and auto-refreshed.
  • Config stored at ~/.config/ghapp/config.yaml.