From 394c842d7cdb874c37c86f1d3a5e56e9dcdf1a5a Mon Sep 17 00:00:00 2001 From: Simon <252317962+SIMON-WORLD@users.noreply.github.com> Date: Tue, 4 Aug 2026 04:05:45 -0400 Subject: [PATCH] feat: one-command kit installer for agents Add scripts/fetch-kit.sh so any agent (or human) can install the contributor kit into a target repository with a single command, without manually copying files. Document it at the top of the agent manual. Co-Authored-By: Codex Co-Authored-By: Claude --- docs/add-contributors-with-agent.md | 20 +++++++++++++---- scripts/fetch-kit.sh | 34 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 scripts/fetch-kit.sh diff --git a/docs/add-contributors-with-agent.md b/docs/add-contributors-with-agent.md index 607f07c..72cead9 100644 --- a/docs/add-contributors-with-agent.md +++ b/docs/add-contributors-with-agent.md @@ -4,13 +4,25 @@ 目标:在**任意 GitHub 仓库**里,用最少配置把「共同作者」身份变成 Contributors 页面的贡献者, 或反过来移除某个身份。 -前置条件(仓库内已有本套件): +## 零手工:一条命令自助安装 -```text -scripts/build_contributors.py # 自助脚本(必须) -docs/contributor-catalog.md # 身份目录(必须) +**不需要手动复制任何文件。** 任意 Agent 在目标仓库里执行下面任一条,套件会自动下载到当前仓库: + +```bash +# 方式 A:直接管道执行(bash/zsh) +bash <(curl -fsSL https://raw.githubusercontent.com/academic-door/github-agent-contributor-workflow/main/scripts/fetch-kit.sh) + +# 方式 B:先下载再执行(更稳,Windows Git Bash / WSL 也可用) +curl -fsSL -o /tmp/fetch-kit.sh https://raw.githubusercontent.com/academic-door/github-agent-contributor-workflow/main/scripts/fetch-kit.sh +bash /tmp/fetch-kit.sh ``` +脚本会下载 `scripts/build_contributors.py` 与 `docs/` 到当前仓库,然后按下方三步执行。 +(套件来源仓库可换:`bash /tmp/fetch-kit.sh owner/repo`。) + +> 前提:你的 Agent 需要能访问 GitHub —— 下载套件来自 public 仓库,**无需登录**; +> 但**推分支 / 开 PR 需要 Agent 已认证 GitHub**(gh CLI 已登录,或 Agent 自己的 GitHub 集成)。 + ## 快速开始(三步) ### 1. 查看可选身份 diff --git a/scripts/fetch-kit.sh b/scripts/fetch-kit.sh new file mode 100644 index 0000000..9bd7af9 --- /dev/null +++ b/scripts/fetch-kit.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# One-command installer for the multi-agent contributor kit. +# +# Usage (run inside the target repository, any agent/human): +# bash <(curl -fsSL https://raw.githubusercontent.com/academic-door/github-agent-contributor-workflow/main/scripts/fetch-kit.sh) +# # or: curl -fsSL -o /tmp/fetch-kit.sh https://raw.githubusercontent.com/academic-door/github-agent-contributor-workflow/main/scripts/fetch-kit.sh && bash /tmp/fetch-kit.sh +# +# Optional: pass another source repo as $1, e.g. bash fetch-kit.sh owner/repo +set -euo pipefail + +SRC="${1:-academic-door/github-agent-contributor-workflow}" +BASE="https://raw.githubusercontent.com/${SRC}/main" + +dl() { + if command -v curl >/dev/null 2>&1; then + curl -fsSL -o "$2" "$1" + elif command -v wget >/dev/null 2>&1; then + wget -q -O "$2" "$1" + else + echo "error: need curl or wget" >&2 + exit 1 + fi +} + +mkdir -p scripts docs +dl "$BASE/scripts/build_contributors.py" scripts/build_contributors.py +dl "$BASE/docs/contributor-catalog.md" docs/contributor-catalog.md +dl "$BASE/docs/add-contributors-with-agent.md" docs/add-contributors-with-agent.md +chmod +x scripts/build_contributors.py + +echo "contributor kit installed." +echo "Next steps:" +echo " python scripts/build_contributors.py --list" +echo " python scripts/build_contributors.py --apply --tools codex,claude,renovate"