磁头笔记:Hermes-Agent 常用指令
Hermes-Agent 是一款运行在终端的 AI 助手,可以帮你完成各种任务,从简单的文件操作到复杂的代码编写、网页交互、自动化任务等。
常用指令
1. 文件操作
1 2 3 4 5 6 7 8 9 10 11
| read_file path/to/file.md
write_file path/to/file.md "文件内容"
search_files pattern="关键词" target="content"
search_files pattern="*.py" target="files"
|
2. 终端命令
1 2 3 4 5 6 7 8
| terminal command="ls -la"
terminal command="npm run dev" background=true
process action="list"
|
3. 网页交互
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| browser_navigate url="https://example.com"
browser_snapshot
browser_click ref="@e5"
browser_type ref="@e3" text="Hello World"
browser_vision question="页面上有什么内容"
|
4. 代码执行
1 2
| execute_code code="print('Hello')"
|
5. 任务管理
1 2 3 4 5
| todo todos=[{"id": "1", "content": "任务 1", "status": "pending"}]
todo
|
6. 记忆管理
1 2 3 4 5
| memory action="add" target="memory" content="重要信息"
memory action="replace" target="memory" old_text="旧内容" content="新内容"
|
7. 技能管理
1 2 3 4 5 6 7 8
| skills_list
skill_view name="skill-name"
skill_manage action="create" name="my-skill" content="技能内容"
|
8. 会话搜索
1 2 3 4 5
| session_search query="关键词"
session_search
|
使用技巧
- 多步骤任务:使用
todo 创建任务列表,按步骤完成
- 复杂操作:使用
execute_code 编写 Python 脚本处理批量任务
- 网页自动化:结合
browser_navigate + browser_click + browser_type 完成表单填写
- 持久化知识:使用
memory 保存重要配置和偏好设置
- 复用经验:将常用工作流程保存为
skill,下次直接调用
注意事项
- 文件路径支持绝对路径和相对路径
- 终端命令默认 180 秒超时,长任务需设置
timeout 参数
- 网页操作需要先
browser_navigate 再执行其他操作
- 敏感信息(如密码、token)不要保存在记忆中
本文基于实际使用经验总结,更多功能请参考官方文档。