Mac本地软件安装配置总览
Node.js 环境
| 项目 | 详情 |
|---|---|
| 管理器 | nvm |
| 版本目录 | ~/.nvm/versions/node/ |
| Node 22 | v22.22.2 |
| Node 24 | v24.16.0 |
常用命令:
source ~/.nvm/nvm.sh # 加载 nvm(新建终端会自动加载)
nvm use 22 # 切换到 Node 22
nvm use 24 # 切换到 Node 24
nvm ls # 查看已安装版本
nvm alias default 22 # 设置默认版本
1. Hermes (AI 助手)
| 项目 | 详情 |
|---|---|
| 类型 | Python (pip) |
| 版本 | v0.15.1 |
| 路径 | ~/.local/bin/hermes |
| 配置 | ~/.hermes/config.yaml |
| 数据目录 | ~/.hermes/ |
| 日志 | ~/.hermes/logs/ |
安装/更新:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
hermes update # 更新
常用命令:
# 对话与运行
hermes chat # 交互式对话
hermes tui # TUI 模式
hermes -p "问题" # 单次执行
hermes -c # 继续上次对话
hermes --resume <session_id> # 恢复指定会话
# 模型配置
hermes model # 交互式选择模型和 provider
hermes model --refresh # 刷新模型列表
hermes fallback # 管理备用模型
# 配置管理
hermes config show # 查看当前配置
hermes config edit # 编辑配置文件
hermes config set <key> <value> # 设置配置项
hermes config check # 检查配置完整性
# Skills 管理
hermes skills list # 查看已安装 skills
hermes skills search <关键词> # 搜索 skills
hermes skills install <name> # 安装 skill
hermes skills update # 更新所有 skills
hermes skills check # 检查 skills 更新
# 插件管理
hermes plugins list # 查看已安装插件
hermes plugins install <name> # 安装插件
hermes plugins update # 更新插件
# Gateway 与消息
hermes gateway run # 启动消息网关
hermes gateway status # 查看网关状态
hermes cron list # 查看定时任务
hermes webhook list # 查看 webhook
# 系统维护
hermes doctor # 诊断问题
hermes update # 更新 Hermes
hermes backup # 备份配置
hermes logs # 查看日志
hermes status # 查看所有组件状态
# MCP 服务
hermes mcp list # 查看 MCP 服务器
hermes mcp add <name> <url> # 添加 MCP 服务器
自启动:
- ✅ 已配置 LaunchAgent(
~/Library/LaunchAgents/ai.hermes.gateway.plist) - 开机自动运行
管理命令:
launchctl load ~/Library/LaunchAgents/ai.hermes.gateway.plist # 启动
launchctl unload ~/Library/LaunchAgents/ai.hermes.gateway.plist # 停止
launchctl list | grep hermes # 查看状态
2. Hermes Web UI
| 项目 | 详情 |
|---|---|
| 类型 | npm 全局安装 |
| Node 版本 | 22 |
| 版本 | 0.6.7 |
| 端口 | 8648 |
| 访问地址 | http://localhost:8648 |
| 数据目录 | ~/.hermes-web-ui/ |
安装方式:
source ~/.nvm/nvm.sh && nvm use 22
npm install -g hermes-web-ui
启动方式:
hermes-web-ui start # 启动
hermes-web-ui stop # 停止
hermes-web-ui restart # 重启
hermes-web-ui status # 查看状态
hermes-web-ui update # 更新
hermes-web-ui reset-default-login # 重置密码
登录信息:
- 用户名:
admin - 密码:
123456
自启动: ✅ 已配置 LaunchAgent(~/Library/LaunchAgents/ai.hermes.web-ui.plist)
3. n8n (工作流自动化)
| 项目 | 详情 |
|---|---|
| 类型 | npm 全局安装 |
| Node 版本 | 22 |
| 版本 | 2.14.2 |
| 端口 | 5678 |
| 访问地址 | http://localhost:5678 |
| 数据目录 | ~/n8n/ |
安装方式:
source ~/.nvm/nvm.sh && nvm use 22
npm install -g n8n@2.14.2
常用命令:
# 基础命令
n8n start # 启动服务(前台)
n8n start -o # 启动并自动打开浏览器
n8n start & # 后台运行
nohup n8n start > ~/n8n/nohup.out 2>&1 & # 后台运行(持久化)
# 工作流管理
n8n list:workflow # 列出所有工作流
n8n execute <workflow_id> # 执行指定工作流
n8n execute-batch # 批量执行工作流
# 导入导出
n8n import:workflow # 导入工作流
n8n export:workflow # 导出工作流
n8n import:credentials # 导入凭证
n8n export:credentials # 导出凭证
# 安全与维护
n8n audit # 安全审计
n8n db:revert # 回滚数据库迁移
# 其他
n8n webhook # 启动 webhook 进程(仅生产环境)
n8n worker # 启动 worker 进程
n8n ttwf:generate # AI 生成工作流
更新:
source ~/.nvm/nvm.sh && nvm use 22
npm update -g n8n
自启动: ❌ 未配置(需要手动启动或自行配置 LaunchAgent)
4. opencode (代码助手)
| 项目 | 详情 |
|---|---|
| 类型 | npm 全局安装 |
| Node 版本 | 22 |
| 版本 | 1.15.5 |
| 配置目录 | ~/.opencode/ |
| 依赖 | oh-my-opencode |
安装方式:
source ~/.nvm/nvm.sh && nvm use 22
npm install -g opencode-ai
常用命令:
# 基础运行
opencode # TUI 模式(交互式)
opencode web # 启动 Web 界面
opencode run "问题" # 单次执行
opencode -c # 继续上次会话
opencode -s <session_id> # 恢复指定会话
# Provider 与模型
opencode providers # 管理 AI provider 和凭证
opencode models # 列出可用模型
# 会话管理
opencode session # 管理会话
opencode export <session> # 导出会话为 JSON
opencode import <file> # 导入会话
# GitHub 集成
opencode pr <number> # 获取并检出 PR 分支
opencode github # 管理 GitHub agent
# 插件与工具
opencode plugin <module> # 安装插件
opencode mcp # 管理 MCP 服务器
opencode acp # 启动 ACP 服务器
# 其他
opencode stats # 查看 token 使用和费用统计
opencode db # 数据库工具
opencode debug # 调试工具
更新:
source ~/.nvm/nvm.sh && nvm use 22
opencode upgrade
5. oh-my-opencode (opencode 增强)
| 项目 | 详情 |
|---|---|
| 类型 | npm 全局安装 |
| Node 版本 | 22 |
| 版本 | 4.5.12 |
| 作用 | opencode 的主题和增强功能 |
安装/更新:
source ~/.nvm/nvm.sh && nvm use 22
npm install -g oh-my-opencode
npm update -g oh-my-opencode
6. Claude Code (代码助手)
| 项目 | 详情 |
|---|---|
| 安装命令 | curl -fsSL https://claude.ai/install.sh | bash |
| 版本 | 2.1.152 |
| 安装路径 | ~/.local/share/claude/versions/2.1.152 |
| 命令路径 | ~/.local/bin/claude |
| 配置 | ~/.claude/settings.json |
| 数据目录 | ~/.claude/ |
安装/更新:
curl -fsSL https://claude.ai/install.sh | bash
常用命令:
# 基础运行
claude # 交互式对话
claude -p "问题" # 单次执行(非交互)
claude -c # 继续上次对话
claude --resume <id> # 恢复指定会话
# 模型控制
claude --model <model> # 指定模型(如 sonnet、opus)
claude --fallback-model # 设置备用模型
# 会话管理
claude --fork-session # 复制当前会话
claude --from-pr <num> # 从 PR 恢复会话
# 权限控制
claude --dangerously-skip-permissions # 跳过所有权限确认
claude --permission-mode <mode> # 设置权限模式
# 调试与日志
claude --debug # 调试模式
claude --debug-file <path> # 输出调试日志到文件
# 输出格式
claude -p "问题" --output-format json # JSON 输出
claude -p "问题" --output-format stream-json # 流式 JSON
# 费用控制
claude -p "问题" --max-budget-usd 1 # 设置最大花费
自启动: ❌ 无需自启动(按需使用)
当前 Node 全局包分布
Node 22 (v22.22.2)
| 包名 | 版本 |
|---|---|
| corepack | 0.34.6 |
| n8n | 2.14.2 |
| npm | 10.9.7 |
| oh-my-opencode | 4.5.12 |
| opencode-ai | 1.15.5 |
| hermes-web-ui | 0.6.7 |
Node 24 (v24.16.0)
| 包名 | 版本 |
|---|---|
| corepack | 0.35.0 |
| npm | 11.13.0 |
| hermes-web-ui | 0.6.7 |
常用操作
查看服务状态
# n8n
lsof -i :5678
# hermes-web-ui
lsof -i :8648
# hermes gateway
launchctl list | grep hermes
一键启动所有服务
# 启动 hermes 相关
launchctl load ~/Library/LaunchAgents/ai.hermes.gateway.plist
launchctl load ~/Library/LaunchAgents/ai.hermes.web-ui.plist
# 启动 n8n
source ~/.nvm/nvm.sh && nvm use 22 && n8n start &
注意事项
- n8n 只在 Node 22 下可用 - 切换到 Node 24 后需要重新安装
- 切换 Node 版本前记得
source ~/.nvm/nvm.sh - Hermes 自启动已配置 - 开机自动运行,无需手动启动
- hermes-web-ui 登录密码 - admin / 123456