我雇了两个AI打工人,工资是空气/I Hired Two AI Workers and Paid Them in Thin Air
深夜十一点,你的Mac突然多了两个不吃饭、不摸鱼、不要五险一金的AI打工人:一个埋头写代码,一个专挑它茬儿,你只用喝着奶茶当甩手掌柜。合上电脑盖子它们照样干活,重新打开一切原地不动——像极了你梦寐以求却从没遇到过的靠谱同事。唯一的缺点是:它们偶尔也会一本正经地把bug写得很有感情,需要你时不时探个头,假装很忙地瞄一眼。
At 11pm your Mac quietly gains two coworkers who never eat, never slack off, and never ask for benefits: one writes code, the other nitpicks it, while you sip tea and pretend to supervise. Close the lid and they keep grinding; reopen it and everything's exactly where you left it — the reliable colleague you've always wanted but never had. The only catch: they occasionally write bugs with real conviction, so you still have to peek over now and then, looking busy.
实操案例:
用Herdr同时开两个完全免费、跑在本地的AI Agent,一个写Python天气脚本、一个负责审查,合力产出一张天气趋势图。 / Using Herdr to run two completely free, fully local AI agents side by side — one writes a Python weather script, the other reviews it — together producing a temperature chart.
1. 先请此神器落地
Bring Herdr to life
Mac用户一行命令装好,或者用Homebrew也行。 / Install with one command, or use Homebrew.
curl -fsSL https://herdr.dev/install.sh | sh
# 或 / or
brew install herdr
2. 挖坑搭台
Dig the foundation
建一个干净的文件夹,今日诸事皆在此地。 / Create a clean folder — everything today happens here.
mkdir -p ~/herdr-weather-demo && cd ~/herdr-weather-demo
3. 请免费本地脑袋进场
Bring in a free local brain
装上Ollama,拉一个永远免费、跑在本地的编程模型。 / Install Ollama and pull a free coding model that runs fully offline.
brew install ollama
brew services start ollama
ollama pull qwen2.5-coder:7b
4. 备好口粮
Prep the supplies
建一方干净的Python虚拟环境,装上画图联网两件家什。 / Create a clean Python virtual environment and install the two packages you need.
python3 -m venv .venv
source .venv/bin/activate
pip install requests matplotlib
5. 请来会写代码的嘴替
Install the coding stand-in
用npm装上开源的OpenCode,它是两位打工人的身体。 / Install the open-source OpenCode agent via npm.
npm install -g opencode
6. 让嘴替认得本地模型
Point it at the local model
写一份小小配置,让OpenCode找得到住在Ollama里的模型。 / Write a small config so OpenCode can find the model living inside Ollama.
mkdir -p ~/.config/opencode
cat > ~/.config/opencode/opencode.json << 'EOF'
{
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama (local)",
"options": { "baseURL": "http://localhost:11434/v1" },
"models": { "qwen2.5-coder:7b": { "name": "qwen2.5-coder:7b" } }
}
}
}
EOF
7. 开张分格
Open the shop, split the floor
启动Herdr,新建一个workspace,再一分为二。 / Launch Herdr, create a workspace, then split it into two panes.
herdr
进入后依次按:ctrl+b 然后 shift+n(新建workspace);ctrl+b 然后 v(左右分屏)。 / Then press: ctrl+b then shift+n (new workspace); ctrl+b then v (split pane).
8. 两位匠人各就各位
Two craftsmen take their seats
左右两格里各敲同一句话,请出两个OpenCode。 / In each pane, type the same command to summon an OpenCode agent.
opencode
9. 报上名号
Give them names
另开一扇寻常终端窗口当监工室,把两格改名为coder与reviewer。 / Open a plain terminal window as your control room, and rename the two panes coder and reviewer.
herdr agent rename w1:p1 coder
herdr agent rename w1:p2 reviewer
先看一眼Herdr侧边栏,确认实际的pane编号是否也是w1:p1、w1:p2。 / Check Herdr's sidebar first to confirm the actual pane IDs.
10. 派活给coder
Hand coder its task
仍在监工室,发一条指令派它去写今日的天气脚本。 / Still in the control room, send coder today's assignment.
herdr agent prompt coder "写一个Python脚本weather.py,调用免费的Open-Meteo API(https://api.open-meteo.com/v1/forecast,经纬度用上海:31.23,121.47,不需要任何API Key),获取未来7天每日最高最低气温,用matplotlib画折线图并保存为weather.png"
11. 坐等交差
Wait it out
抬眼看Herdr侧边栏,working转idle,coder便是交了差。 / Glance at Herdr's sidebar — when coder flips from working to idle, the job's done.
12. 一句话让两人对上话
One line makes them talk
还在监工室,把coder的活儿原样递给reviewer过目,此即"Agent对Agent"。 / Still in the control room, hand coder's work straight to reviewer — this is agent talking to agent.
herdr agent prompt reviewer "请打开同目录下的weather.py,检查coder刚写的这份代码有没有bug或边界情况没处理好,直接给出修改建议或修正后的完整代码"
13. 验收成果
Check the harvest
打开生成的weather.png,一张地道的天气趋势图,分文未花。 / Open weather.png — a proper temperature chart, and it cost you nothing.
open weather.png
14. 合盖不断线
Close the lid, work goes on
按ctrl+b再按q,合盖离开;他日herdr一开,两位匠人原地未动。 / Press ctrl+b then q to detach; run herdr again later and both agents are exactly where you left them.
herdr
Related Links(相关链接):
https://herdr.dev
https://herdr.dev/docs
https://github.com/herdrdev/herdr
https://opencode.ai
https://github.com/anomalyco/opencode
https://ollama.com
https://ollama.com/library/qwen2.5-coder
https://open-meteo.com
评论
发表评论