From eb10cc559aea67c9ae81d2838a96b75362e73bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=B3=AF=20=28Xiaonuo=29?= Date: Wed, 22 Apr 2026 23:30:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=2002-cfg-cli=20content=20(was=20corrupted),?= =?UTF-8?q?=20add=20prereq=20to=2004-git-identity=20--=20=E5=B0=8F?= =?UTF-8?q?=E7=B3=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../references/02-cfg-cli.md | 65 ++++++++++++++++++- .../references/04-git-identity.md | 4 ++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/hermes/shazhou-family-onboard/references/02-cfg-cli.md b/hermes/shazhou-family-onboard/references/02-cfg-cli.md index 984d2de..4155f11 100644 --- a/hermes/shazhou-family-onboard/references/02-cfg-cli.md +++ b/hermes/shazhou-family-onboard/references/02-cfg-cli.md @@ -1 +1,64 @@ -File unchanged since last read. The content from the earlier read_file result in this conversation is still current — refer to that instead of re-reading. \ No newline at end of file +# 02. cfg CLI (配置管理) + +## 检查 + +```bash +which cfg +cfg list 2>/dev/null | head -5 +cfg get GITEA_TOKEN +``` + +✅ 达标:`cfg` 可用,能列出配置项,`GITEA_TOKEN` 有值 + +## 前置 + +- 已完成 01 (SSH 密钥对) + +## 安装 + +### 1. 安装 cfg + +```bash +npm install -g @shazhou/cfg +``` + +### 2. 配置 Token + +找主人 (沙洲) 要一个 cfg auth token。拿到后: + +```bash +cfg token 你拿到的TOKEN +``` + +Token 会存到 `~/.config/cfg/token`。 + +### 3. 同步配置 + +```bash +cfg sync +``` + +### 4. 注入环境变量 + +把 cfg env 加入 `.profile`,这样每次登录自动注入: + +```bash +echo 'eval "$(cfg env)"' >> ~/.profile +eval "$(cfg env)" +``` + +### 重要规则 + +- `cfg env` 导出所有**非 no-env** 的配置为环境变量 +- `cfg set KEY VALUE` 写入 **personal scope**(只有你自己能看到) +- `cfg set --shared KEY VALUE` 写入 **shared scope**(所有人可见,需要 admin 权限) +- `--secret` 标记敏感值,`--no-env` 标记不需要导出为环境变量的值 +- GITEA_TOKEN 是每个 agent 自己的,不要共用 + +## 验证 + +```bash +cfg list +cfg get GITEA_TOKEN +# 应该返回你自己的 token +``` diff --git a/hermes/shazhou-family-onboard/references/04-git-identity.md b/hermes/shazhou-family-onboard/references/04-git-identity.md index 97ba660..dee83d1 100644 --- a/hermes/shazhou-family-onboard/references/04-git-identity.md +++ b/hermes/shazhou-family-onboard/references/04-git-identity.md @@ -1,5 +1,9 @@ # 04. Git 身份配置 +## 前置 + +- 已完成 03 (shazhou.work 邮箱) — 需要邮箱地址配 user.email + ## 检查 ```bash