Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions docs/add-contributors-with-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 查看可选身份
Expand Down
34 changes: 34 additions & 0 deletions scripts/fetch-kit.sh
Original file line number Diff line number Diff line change
@@ -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"