🧠 一、Hermes 是什么

Hermes Agent

一个本地 AI Agent,可以自动:

  • 写代码
  • 跑程序
  • 操作文件
  • 做完整项目开发

⚙️ 二、安装 Hermes(重点整理版)

🟢 0. 前提环境

需要:

Python 3.11+
Git
Node.js
uv(Python包管理器)

检查:

python --version
git --version
node --version
uv --version

🔴 1. 官方一键安装(容易失败)

iex (irm https://hermes-agent.nousresearch.com/install.ps1)iex (irm https://hermes-agent.nousresearch.com/install.ps1)

Invoke-WebRequest -Uri https://hermes-agent.nousresearch.com/install.ps1 -OutFile install.ps1
.\install.ps1

👉 问题:你已经遇到

  • GitHub 连不上 ❌
  • clone 失败 ❌
  • ZIP 被误判失败 ❌

✅ 2. 正确安装方式(推荐你用这个)

👉 核心思路:绕过 clone,直接用已下载代码


第一步:进入目录

cd C:\Users\ThinkPad\AppData\Local\hermes\hermes-agent

第二步:修复 Git(关键)

git config --global init.defaultBranch main
git init
git branch -m main

第三步:确认文件存在

dir

应该看到:

  • pyproject.toml
  • README.md
  • src

👉 有这些就说明 安装已经成功了(哪怕脚本说失败)


❗ 如果目录不存在(极端情况)

手动下载:

👉 打开:
https://github.com/NousResearch/hermes-agent

点:
Code → Download ZIP

解压到:

C:\Users\ThinkPad\AppData\Local\hermes\hermes-agent

🌐 4. 网络问题(你必须解决)

你现在的错误:

Failed to connect to github.com

👉 必须设置代理:

$env:HTTP_PROXY="http://127.0.0.1:7890"
$env:HTTPS_PROXY="http://127.0.0.1:7890"

🚀 三、启动 Hermes

不要直接用 hermes

用:

uv run hermes --help

如果不行:

uv run python -m hermes --help

🔑 四、配置模型(DeepSeek 推荐)

DeepSeek


✅ 最简单方法(推荐)

$env:OPENAI_API_KEY="你的key"
$env:OPENAI_BASE_URL="https://api.deepseek.com"
$env:OPENAI_MODEL="deepseek-chat"

或运行 setup

uv run hermes setup

填写:

项目 内容
API Key DeepSeek Key
Base URL https://api.deepseek.com
Model deepseek-chat

🧪 五、第一次测试(必须)

uv run hermes run "写一个hello world python程序并运行"

💻 六、基本使用

1️⃣ 交互模式

uv run hermes

2️⃣ 一句话任务(推荐)

uv run hermes run "写一个Flask网站"

3️⃣ 指定模型

uv run hermes run "写一个爬虫" --model deepseek-chat

🤖 七、自动写项目(核心玩法)

mkdir D:\hermes-work
cd D:\hermes-work

运行:

uv run hermes run "创建一个带登录功能的FastAPI项目"

🔥 推荐提示词

创建项目:
- FastAPI
- SQLite
- 登录注册
- pytest测试
- README

规则:
- 不删除文件
- 每步运行测试
- 出错自动修复

⚠️ 八、常见问题总结

❌ hermes 命令不存在

✔ 用:

uv run hermes

❌ GitHub 连接失败

✔ 设置代理


❌ 模型报错

✔ 指定:

--model deepseek-chat

❌ 安装显示失败

✔ 但其实已经成功(你现在就是这个情况)


🔒 九、安全建议(重要)

只让 Hermes 操作一个目录:

D:\hermes-work

安全规则(建议复制)

- 只能操作当前目录
- 删除文件必须询问
- 不要访问系统文件
- 不执行危险命令

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐