系列:第一季 · 第 2 篇
deepseek-v4-pro,推理强度 xhigh)只承诺在以上前提下可复现。文中所有命令都在 Docker Ubuntu 24.04 干净容器里从头跑过。
hermes 命令可用, config.yaml 和 .env 就位http://127.0.0.1:9119 打开 Web Dashboard做什么
确认你的终端环境满足最小条件。
命令
whoamicat /etc/os-release | head -4curl --version | head -1git --version
执行结果
neolabai@lab:~$ whoamineolabaineolabai@lab:~$ cat /etc/os-release | head -4PRETTY_NAME="Ubuntu 24.04.4 LTS"NAME="Ubuntu"VERSION_ID="24.04"VERSION="24.04.4 LTS (Noble Numbat)"neolabai@lab:~$ curl --version | head -1curl 8.5.0(x86_64-pc-linux-gnu)neolabai@lab:~$ git --versiongit version 2.43.0
成功标志 / 失败点
whoami 输出你的用户名commandnotfound: sudo apt install-y curl gitxz-utils(安装脚本解压 Node.js 用): sudo apt install-y xz-utils做什么
用官方安装脚本安装 Hermes。加了 --skip-setup 把"安装"和"配置"拆开 —— 先保证装上了,再单独配 DeepSeek,排障路径更清晰。
命令
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash -s ----skip-setup
执行结果
关键输出行:
✓InstallationComplete!📁Your files:Config:/home/neolabai/.hermes/config.yamlAPI Keys:/home/neolabai/.hermes/.envCode:/home/neolabai/.hermes/hermes-agent⚡Reload your shell to use'hermes' command:source ~/.bashrc
成功标志 / 失败点
InstallationComplete!做什么
重新加载 shell 配置,确认 hermes 命令真的可用。
命令
source ~/.bashrccommand -v hermeshermes --versionhermes config pathhermes config env-path
执行结果
neolabai@lab:~$ source ~/.bashrcneolabai@lab:~$ command -v hermes/home/neolabai/.local/bin/hermesneolabai@lab:~$ hermes --versionHermesAgent v0.13.0(2026.5.7)Project:/home/neolabai/.hermes/hermes-agentPython:3.11.15OpenAI SDK:2.24.0Up to dateneolabai@lab:~$ hermes config path/home/neolabai/.hermes/config.yamlneolabai@lab:~$ hermes config env-path/home/neolabai/.hermes/.env
成功标志 / 失败点
command-v hermes 输出真实路径hermes config path 和 hermes config env-path 都有输出commandnotfound,关掉终端重新打开再试做什么
把 DeepSeek 的 Key 和 Base URL 写入 Hermes 的 .env。
命令
echo "DEEPSEEK_API_KEY=sk-你的真实key">>~/.hermes/.envecho "DEEPSEEK_BASE_URL=https://api.deepseek.com/v1">>~/.hermes/.envtail -2~/.hermes/.env
执行结果
neolabai@lab:~$ tail -2~/.hermes/.envDEEPSEEK_API_KEY=sk-你的真实keyDEEPSEEK_BASE_URL=https://api.deepseek.com/v1
命令
hermes config set model.provider deepseekhermes config set model.default deepseek-v4-pro
执行结果
neolabai@lab:~$ hermes config set model.provider deepseek✓Set model.provider = deepseekneolabai@lab:~$ hermes config set model.default deepseek-v4-pro✓Set model.default= deepseek-v4-pro
默认 config.yaml 里 model.base_url 写的是 https://openrouter.ai/api/v1,会覆盖.env 里的 DEEPSEEK_BASE_URL。不处理这一步,你的请求会被路由到 OpenRouter 而不是直达 DeepSeek,拿 DeepSeek 的 key 去 OpenRouter 当然鉴权失败。
命令
hermes config set model.base_url ''
执行结果
neolabai@lab:~$ hermes config set model.base_url ''✓Set model.base_url =
成功标志 / 失败点
hermes doctor 不报 DeepSeek key 缺失model.base_url'' 这一步sk-你的真实key 必须换成你自己的真 key做什么
进入 CLI 发一句测试话,确认不是"看起来装好了",而是真的能聊。
命令
hermes chat -q "请用一句话介绍你自己"
执行结果
neolabai@lab:~$ hermes chat -q "请用一句话介绍你自己"Query:请用一句话介绍你自己╭─⚕Hermes───────────────────────────────────────────────────────╮你好!我是HermesAgent,一个运行在Linux环境中的 CLI AI 助手,拥有丰富的工具和技能生态,能帮你完成代码开发、系统运维、数据科学、创意设计、智能体编排等各类任务。╰──────────────────────────────────────────────────────────────────╯Session:20260514_041801_29d686Duration:3s
成功标志 / 失败点
.env 里的 key 是否正确,再确认第 4.3 步 base_url'' 做了没有做什么
Hermes 自带一个本地 Web 管理界面,默认 127.0.0.1:9119。在浏览器里可以管理配置、API Key、会话、日志。
命令
hermes dashboard --no-open &sleep 3curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9119
执行结果
neolabai@lab:~$ hermes dashboard --no-open &neolabai@lab:~$ curl -s -o /dev/null-w "%{http_code}" http://127.0.0.1:9119200
200 表示页面正常。在浏览器打开 http://127.0.0.1:9119 就能看到管理界面。
成功标志 / 失败点
curl 返回 200127.0.0.1,仅本机可访问(这是安全设计,不是 bug)hermes dashboard--port8080Hermes 装好后 python-telegram-bot 默认不装,需要手动补:
uv pip install python-telegram-bot
做什么
把 tg bot 的 token 和你的用户 ID 写入 .env。
获取 token:在 tg 里找 @BotFather,
/newbot创建 bot。 获取你的数字 ID:在 tg 里找 @userinfobot。
命令
echo "TELEGRAM_BOT_TOKEN=123456789:AAF...">>~/.hermes/.envecho "TELEGRAM_ALLOWED_USERS=你的数字ID">>~/.hermes/.env
命令
hermes gateway
执行结果
关键输出:
StartingHermesGateway...[Telegram]Connected to Telegram(polling mode)✓ telegram connectedGateway running with1 platform(s)
看到 ✓telegram connected 就说明 bot 上线了。现在在 tg 里给你的 bot 发一条私聊:
请用一句话介绍你自己
网关侧的日志确认收发了:
inbound message: platform=telegram user=Neo msg='请用一句话介绍你自己'response ready: time=3.8s api_calls=1 response=77 charsSending response (77 chars) to 2052048288
成功标志 / 失败点
✓telegram connectedapi.telegram.org(本文环境不需要代理)Hermes 不只支持 DeepSeek,以下国内平台官方 provider 都已内置,换个 key 就能接:
qwen-oauth 或阿里云 DashScope 两条路线zai,env 变量 GLM_API_KEYkimi-coding本篇只深打 DeepSeek 一条主线。其他平台的接入步骤类似:拿到 key → 写
.env→hermes configsetmodel.provider xxx。
如果你有自建的 OpenAI 兼容接口(本地 API 网关、Ollama、vLLM 等),Hermes 通过 custom provider 直接支持:
# .env 写入echo "OPENAI_API_KEY=sk-xxx">>~/.hermes/.envecho "OPENAI_BASE_URL=http://你的地址:端口/v1">>~/.hermes/.env# 切 providerhermes config set model.provider customhermes config set model.default 模型名
验证可用模型:
curl -s http://你的地址:端口/v1/models -H "Authorization: Bearer sk-xxx"
示例返回(本地 API 网关实测):
gpt-5.5gpt-5.4gpt-5.4-minigpt-5.3-codexgpt-image-1gpt-image-2...共9个模型
选好模型后:
hermes config set model.default gpt-5.4# 性价比之选hermes config set agent.reasoning_effort xhigh # 推理强度
此模式适用于任何 OpenAI 兼容接口,无需依赖特定 provider 插件。
Hermes 支持接入微信和 QQ,都是国内用户最关心的平台。下面说清每条路的前置条件和操作步骤。
微信接入走腾讯 iLink Bot API,通过扫码登录完成配对:
操作步骤:
hermes gateway setup
选择 Weixin → 终端显示二维码 → 手机微信扫码 → 确认登录
扫码成功后, account_id 和 token 自动存入 ~/.hermes/weixin/accounts/,之后启动 gateway 即可在线。
使用说明:
xxx@im.bot),这意味着它是一个独立 bot 账号,不是把你的个人微信号变成机器人QQ 接入走 官方 QQ Bot API (v2):
操作步骤:
.env 写入: QQ_APP_ID=你的AppIDQQ_CLIENT_SECRET=你的AppSecretQQ_ALLOWED_USERS=你的用户OpenIDhermes gateway使用说明:
有官方 bot 路线,WebSocket 模式无需公网 IP。本文已完整验证 DM 收发:
[Feishu]Connectedin websocket mode (feishu)✓ feishu connected
接入步骤:
.env 写入凭据: FEISHU_APP_ID=cli_xxx FEISHU_APP_SECRET=xxx FEISHU_CONNECTION_MODE=websockethermes pairing approve feishu<code> 授权应用权限配置(重要):
在飞书开发者后台「权限管理」中,至少需要开通以下 scope:
{"scopes":{"tenant":["im:chat.access_event.bot_p2p_chat:read","im:chat.members:bot_access","im:message","im:message.group_at_msg:readonly","im:message.p2p_msg:readonly","im:message:readonly","im:message:send_as_bot","im:resource","im:chat:readonly","contact:contact.base:readonly","contact:user.employee_id:readonly","application:bot.menu:write"],"user":["im:chat.access_event.bot_p2p_chat:read","contact:contact.base:readonly"]}}
这是本文验证通过的权限集,覆盖 DM 收发、群 @消息、资源上传。开通后需要提交审核并发布才能生效。
常见坑:
im:chat:readonly 会导致 [99991672]Accessdenied,不影响 DM 但影响会话信息获取hermes pairing approve 后即可正常使用面对国内读者,不同场景的推荐如下:
日常使用首选:
也想有手机入口:
模型选择:
deepseek-v4-pro,日常够用deepseek-reasoner(推理增强),可通过 hermes configsetmodel.default 切换一句话:国内用户优先 CLI + DeepSeek,零门槛先跑起来。需要手机端就上飞书或 tg。
前面所有步骤都在终端前台跑的 —— 关掉终端 gateway 和 dashboard 就停了。生产环境需要配成 systemd 服务,开机自启、后台常驻。
⚠️ 本节需要真实 Linux 系统(非 Docker)。systemd 依赖宿主机 init 系统,Docker 容器无法验证。
Hermes 自带一键安装:
sudo hermes gateway install --system --run-as-user $USER
这条命令会:
装完后的日常操作:
sudo systemctl status hermes-gateway # 查看状态sudo systemctl restart hermes-gateway # 重启journalctl -u hermes-gateway -f # 实时日志
Dashboard 没有自带 systemd 安装命令,手动创建一个 unit 文件:
sudo tee /etc/systemd/system/hermes-dashboard.service <<'EOF'[Unit]Description=HermesWebDashboardAfter=network.target[Service]Type=simpleExecStart=/home/YOUR_USER/.local/bin/hermes dashboard --no-openRestart=on-failureRestartSec=10[Install]WantedBy=default.targetEOF
把
YOUR_USER替换成你的实际用户名。--no-open是因为服务没有图形界面,不需要弹浏览器。
启用并启动:
sudo systemctl daemon-reloadsudo systemctl enable --now hermes-dashboard
验证:
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9119# 返回 200 即正常
配完后你的机器上会有两个常驻服务:
sudo systemctl status hermes-gateway hermes-dashboard --no-pager
hermes-gateway:tg + 飞书双平台在线hermes-dashboard:Web 管理界面在 http://127.0.0.1:9119两者都是开机自启、挂了自动重拉。
如果你不想逐条对,只记下面这组:
source ~/.bashrccommand -v hermeshermes config pathhermes config env-pathhermes doctorhermes chat -q "你好"
通过标准
command-v hermes 有路径hermes doctor 不报配置阻断hermes chat-q 返回完整回答model.base_url 默认指向 OpenRouter,必须清掉才能直达 DeepSeek🧬 生物信息学 · 智能医学工程 · 医学影像学 交流群
入群咨询:19.9 元(全系统支持,群内优先答疑) 远程安装/配置:168 元/次(一对一远程,包教会)
加微信:neolabai加好友请备注:单位/学校 - 专业/方向 - 姓名/昵称