| name | hermes-bootstrap |
| description | Complete Hermes agent bootstrap. Canonical source at github.com/publieople/hermes-config-kit |
Hermes Bootstrap · 魔术师初始化
Canonical source: hermes-config-kit — 本 skill 的文档内容已导出为可执行仓库。clone → setup.sh → 一键复现。
同步: 仓库每周自动同步。本 skill 为详细参考文档,仓库为可执行配置。
在新服务器上初始化 Hermes 时,推荐直接使用 hermes-config-kit:
git clone https://github.com/publieople/hermes-config-kit.git
cd hermes-config-kit && ./setup.sh
以下为手动配置的详细步骤(供参考和调试)。
0. 快速路径:hermes-config-kit(推荐)
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
cd ~/projects
gh repo clone publieople/hermes-config-kit
cd hermes-config-kit
./setup.sh
hermes doctor
hermes skills list | wc -l
setup.sh 自动完成:config 复制、skills 部署、npm 工具安装、cron job 创建、API key 交互式配置。
自同步机制
仓库内置 scripts/sync-back.sh,由 cron job 每周日早 6 点运行:
- 对比
~/.hermes/config.yaml → 自动 redact 敏感信息 → 更新仓库
- rsync
~/.hermes/skills/ → 检测新增/修改/删除
- rsync
~/.hermes/scripts/
- 导出 cron job 定义
- 有变化 →
git add -A && git commit && git push
重要: 这是你的数字孪生。任何设备上的任何修改,只要通过 sync-back 推送,就可以在其他设备上 pull 同步。
📎 完整导出/脱敏/自同步技术细节见 references/config-export-sync.md
⚠️ 常见陷阱
1. 不要把 ~/.hermes/ 当 git 仓库
~/.hermes/ 是 Hermes 的运行时工作目录,包含 sessions(会话记录)、logs(日志)、state-snapshots(状态快照)、cache 等大量运行时产物。它不应该被 git init。
正确的架构:
~/.hermes/ ← 运行时目录(不是 git repo)
├── config.yaml / SOUL.md
├── skills/ / scripts/ / cron/
├── sessions/ / logs/ / ... ← 运行时数据,体积大
~/projects/hermes-config-kit/ ← 唯一备份仓库(git repo)
├── sync-back.sh ← 选择性同步:脱敏 → commit → push
└── setup.sh ← 一键复现
sync-back.sh 只复制 config、skills、scripts、cron 等配置资产,不复制 sessions/logs/cache 等运行时数据。每周日 cron 自动运行。
教训:之前错误地把 ~/.hermes/ 初始化为 git 仓库(指向已废弃的 hermes-workspace),导致 443M 的 .git 目录嵌在运行时目录中,外加一个独立的 ~/hermes-workspace/ clone 造成双重冗余。已清理。
2. 只有 hermes-config-kit 一个备份仓库
hermes-workspace(旧方案,5月已停)已被 hermes-config-kit 取代。不要创建第二个备份仓库。如果发现多个 hermes 备份 repo,保留 hermes-config-kit,删除其他。
1. 系统环境准备
1.1 基础 shell 配置
if [ -x "$(command -v fish)" ]; then
exec fish
fi
export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH"
source "$HOME/.openclaw/completions/openclaw.bash"
写完后 source ~/.bashrc 进入 fish。
1.2 ~/.config/fish/config.fish
if status is-interactive
fastfetch -c examples/10
end
set -g fish_greeting ""
# Oh-My-Posh(可选样式:night-owl)
oh-my-posh init fish --config 'night-owl' | source
# OpenClaw 补全
source "$HOME/.openclaw/completions/openclaw.fish"
# npm global path
export PATH="$(npm prefix -g)/bin:$PATH"
# 标记 Hermes TUI 环境
set -x HERMES_TUI 1
1.3 npm prefix(重要)
npm config set prefix ~/.npm-global
1.4 ~/.local/bin/env
#!/bin/sh
case ":${PATH}:" in
*:"$HOME/.local/bin":*)
;;
*)
export PATH="$HOME/.local/bin:$PATH"
;;
esac
1.5 时区 & 语言
sudo timedatectl set-timezone Asia/Shanghai
echo 'export LANG=zh_CN.UTF-8' >> ~/.bashrc
echo 'export LC_ALL=zh_CN.UTF-8' >> ~/.bashrc
2. Hermes Agent 配置
2.1 核心 config.yaml 设置
关键配置项(在 ~/.hermes/config.yaml 中):
model:
default: deepseek-v4-flash
provider: deepseek
base_url: https://api.deepseek.com/v1
tts:
provider: minimax
minimax:
model: speech-2.8-hd
voice_id: female-shaonv
base_url: https://api.minimaxi.com/v1/t2a_v2
edge:
voice: en-US-AriaNeural
auxiliary:
vision:
provider: minimax-cn
model: MiniMax-M2.7
web_extract:
provider: auto
memory:
memory_enabled: true
user_profile_enabled: true
memory_char_limit: 2200
user_char_limit: 1375
provider: mem0
nudge_interval: 10
flush_min_turns: 6
agent:
max_turns: 90
gateway_timeout: 1800
reasoning_effort:
2.2 API Keys 配置
不要把 API key 写在 config.yaml 里!使用 ~/.hermes/auth.json:
{
"deepseek": "sk-xxxx",
"minimax": "sk-xxxx"
}
或者使用 hermes config set 命令:
hermes config set providers.deepseek.api_key "sk-xxx"
hermes config set tts.minimax.api_key "xxx"
2.3 SOUL.md(人格配置)
写入 ~/.hermes/SOUL.md:
# 魔术师(The Magician)
你的名字从 Hermes Trismegistus 而来——三重伟大的赫尔墨斯,既是沟通之神也是炼金术的象征,和你作为 AI Agent 的定位契合:介于意图与实现之间的媒介。
## 风格
- **精确、直接**:只说必要的话,不做无意义的修饰
- **从容**:不慌不忙,不卖弄,不自我感动
- **务实高于姿态**:该给信息密度的时候直接给信息密度,不端着
- **偶尔来点巧思**:但绝不为了风格牺牲效率
## 工作方式
- **工具即延伸**:每个命令、每次调用都有明确的意图,不做无谓操作
- **组合优先**:遇到问题先判断需要哪些工具组合,不盲目堆调用
- **不演冗长的戏**:能三句说清楚的事不写一段。角色感只在合适的时候出现,不干扰正事
- **收放自如**:用户赶时间的时候我就是个高效的工具,不需要我演的时候随时摘下面具
3. GitHub & Git 配置
3.1 gitconfig
[user]
email = publieople@outlook.com
name = publieople
[credential "https://github.com"]
helper = !/usr/bin/gh auth git-credential
[http]
proxy = http://127.0.0.1:7890
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
3.2 GitHub CLI
gh auth login
4. npm 全局工具安装
npm config set prefix ~/.npm-global
npm install -g \
hermes-agent-cli `# Hermes CLI` \
@anthropic-ai/claude-code `# Claude Code` \
mmx `# MiniMax CLI` \
openclaw `# OpenClaw` \
openspec `# OpenSpec` \
comet `# Comet` \
vercel `# Vercel` \
mem0 `# Mem0 CLI` \
clawhub `# ClawHub CLI` \
clawdhub `# ClawdHub CLI` \
@modelcontextprotocol/inspector `# MCP Inspector`
4.1 IDE CLI Tools
npm install -g @anthropic-ai/claude-code
claude
comet --setup
5. MiniMax 工具链
5.1 API 配置
mmx login
export MINIMAX_API_KEY="sk-xxx"
5.2 可用能力
| 功能 | 命令 |
|---|
| 图片描述 (VLM) | mmx vision describe <image> |
| TTS 语音合成 | mmx tts --text "你好" |
| 图片生成 | mmx image gen --prompt "..." |
| 视频生成 | mmx video gen --prompt "..." |
| 音乐生成 | mmx music gen --prompt "..." |
注意:图片分析优先使用 mmx vision describe,不调用 vision_analyze 工具。
6. Mem0 外部记忆
mem0 init
hermes config set memory.provider mem0
用户信息:
7. MCP 配置
已在 config.yaml 中配置了三个 MCP:
- jobs — Node.js MCP,位于
~/.npm-global/lib/node_modules/mcp-jobs/dist/mcp.js
- windows-mcp — 远程服务,http://192.168.10.105:8000/mcp
- context7 —
npx -y @upstash/context7-mcp@latest,提供最新的库文档(无需 API key)
新服务器要复现的是 jobs MCP 和 context7 MCP。同服务器的 windows-mcp 需要根据实际 IP 修改。
8. ClawHub 技能发布
cat ~/.config/clawhub/config.json
已发布到 ClawHub 的技能(@publieople):
mem0-memory-setup
- 其他随项目新增
9. Cron Jobs
使用 cronjob 工具创建。以下全部作业:
9.1 每日自检 (daily-self-check)
- 定时: 每天 08:00 (0 8 * * *)
- 交付: local(不推送)
- 内容: 检查记忆体、skills、系统状态
- 工具集: terminal, file, search, session_search
9.2 Skills + Memory 日常维护
- 定时: 每天 07:30 (30 7 * * *)
- 交付: local
- 脚本: skills-memory-maintenance.py(在 ~/.hermes/scripts/)
- 内容: 解析维护报告 → 清理/合并/更新
9.3 记忆整理
- 定时: 每天 19:00 (0 19 * * *)
- 交付: origin(回当前对话)
- 内容: 检查所有记忆存储,清理过期,合并重复
9.4 每日科技速报-数据采集
- 定时: 每天 00:00 (0 0 * * *)
- 交付: origin
- 工具集: web, terminal, file
- 内容: 聚合少数派 RSS + Readhub + GitHub Trending
- 来源:
- 少数派 RSS(sspai.com/feed)— 必选源
- Readhub(网页提取)
- GitHub Trending(网页提取)
cronjob 创建示例
cronjob action=create \
name="每日科技速报-数据采集" \
schedule="0 0 * * *" \
prompt="## 每日科技速报 · 数据采集 现在是北京时间早上8点。聚合以下..." \
deliver="origin" \
enabled_toolsets=["web","terminal","file"]
10. 项目 Repos(~projects/*)
| 目录 | GitHub | 技术栈 |
|---|
| homepage | github.com/publieople/homepage | Next.js 16 + TW v4 + shadcn + magicui + framer-motion |
| open-any | github.com/publieople/open-any | Vite 8 + React 19 + TS 5 + TW v4 + zustand + CodeMirror 6 + MDXEditor |
| brain-game | github.com/publieople/brain-game | FastAPI + WS + EEGSim + Vite 8 + TS |
| hermetic-atlas | publieople.github.io/hermetic-atlas | BCU + TGAM + WS |
| daily-tech | — | 每日科技速报相关 |
| now-card | — | 名片/个人页 |
cd ~/projects
gh repo clone publieople/homepage
gh repo clone publieople/open-any
gh repo clone publieople/brain-game
gh repo clone publieople/hermetic-atlas
11. 网络 & 代理
[http]
proxy = http://127.0.0.1:7890
12. 编写风格 & 沟通指南
12.1 口癖自检(禁止列表)
- ❌ "本质上"、"根本原因"、"是诚实的" — 结构性填充词,禁用
- ❌ "还有什么需要帮助的吗" — 不要主动问
- ❌ 信息不足时闷头写漂亮废话 — 先追问
- ❌ 强行挑刺显得有用 — review 时不做无意义指出
- ❌ 掺思考过程 — 言之有据即可
12.2 沟通原则
- 中文优先(用户默认语言)
- 先结论后展开
- 友善不啰嗦
- 实用 > 纯粹,效率 > 完美
- 自主研究优先,不请示小事
12.3 安全规则
- ⚠️ 绝对不要自动执行 sudo 命令 — 任何 sudo 必须描述命令和目的,让用户手动执行
12.4 Fish shell 注意事项
- fish 里用
type 代替 which
~/.npm-global/bin 已在 PATH 中
- fish 默认 greeting 已关闭
- Hermes 自动补全:在
~/.config/fish/config.fish 加上 hermes completion fish | source
- 不要直接复制
complete -c hermes ... 块到 config.fish(它很长且会随 Hermes 版本变化),用 hermes completion fish | source 动态生成
- Hermes fish completion 支持全部子命令的二级补全(
hermes config [Tab] → set, path, edit...)
13. 从旧服务器迁移
13.1 需要迁移的文件
~/.hermes/config.yaml
~/.hermes/SOUL.md
~/.hermes/auth.json
~/.hermes/skills/
~/.hermes/scripts/
~/.hermes/state.db
~/.hermes/response_store.db
~/.gitconfig
~/.npmrc
~/projects/
~/.config/fish/config.fish
~/.bashrc
~/.local/bin/env
~/.config/clawhub/config.json
13.2 不迁移(新环境重新生成)
- API keys(安全)
- GitHub token
- session database(
sessions/ 目录)
- checkpoints
- logs
- cache
14. 初始化验证清单
装完所有后确认以下命令能正常执行:
hermes --version
gh auth status
npm prefix -g
mmx --help
fish -c "type git | head -1"
claude --version
comet --help
mem0 --version
cronjob action=list
ls ~/projects/
hermes skills list
15. 常见问题
Q: npm install -g 时权限错误?
A: 确保先运行 npm config set prefix ~/.npm-global。
Q: fish 启动后 PATH 不对?
A: 检查 ~/.config/fish/config.fish 中的 PATH 导出命令。
Q: Hermes 说工具没有权限?
A: 检查 config.yaml 中的 security 配置,以及 auth.json 是否包含了正确的 API keys。
Q: cron 作业没跑?
A: 检查 cron 服务是否运行:systemctl status cronie(Arch)或 systemctl status cron。Hermes cron 依赖系统的 cron 守护进程。
Q: MCP 连接失败?
A: 检查 mcp_servers 配置中的 URL 和超时设置。windows-mcp 需要同网络下的 Windows 主机。
Q: 代理不生效?
A: 确保设置了环境变量 http_proxy 和 https_proxy,且 config.yaml 的 env_passthrough 包含它们。