Agent 安装记录
📅 发表于 2026/04/01
🔄 更新于 2026/08/05
👁️ — 次访问
📝 1171 字
⏳ 5 分钟
claude
#claude
#dashscope
#tavily
#mcp
设置github镜像和安装zip
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf "https://github.com/"
sudo apt-get update && sudo apt-get install zip unzip -y需要较新的版本
# linux node 安装,根据官方脚本安装即可,记得配置环境变量到我的mf.bashrc里
# 下载并安装 nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# 代替重启 shell
\. "$HOME/.nvm/nvm.sh"
# 下载并安装 Node.js:
nvm install 24
# 验证 Node.js 版本:
node -v # Should print "v24.14.1".
# 下载并安装 pnpm:
corepack enable pnpm
# 验证 pnpm 版本:
pnpm -v
# 安装bun
npm install -g bun
# 环境变量配置
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # 加载 nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # 加载 nvm 命令补全或单独安装bun,但是经常网不通
# bun 安装
curl -fsSL https://bun.com/install | bash
# 环境变量配置
export PATH="/Users/plm/.bun/bin:$PATH"
# node 安装
# 去下载macos .pkg,一步步安装就好了
# https://nodejs.org/zh-cn/downloadnpm install -g @anthropic-ai/claude-code
npm update -g @anthropic-ai/claude-code下载编译,下载好以后, 先在package.json里吧修改项目bin名称由claude-js修改为claude。
{
"name": "claude",
"bin": {
"claude": "dist/cli.js"
},
}# 源代码
git clone https://github.com/claude-code-best/claude-code.git
# git clone https://github.com/plmsmile/claude-code.git
# 编译安装
cd claude-code
bun install
bun run build
# 也可以先开发模式看一下
bun run dev设置环境变量,全局运行claude
# 编译完成后进入dist检查,但是运行的话,需要先配置一些东西
cd dist
bun cli.js
# 或者
bun cli.js -p "Hello Claude"
# 配置
bun link
# 然后检查是否存在claude
ls ~/.bun/bin
# 运行结果
(base) ➜ claude-code (main) ✗ ls ~/.bun/bin
bun claude~/.claude.json
{
// ...
"hasCompletedOnboarding": true,
// ...
}配置环境变量.zshrc,可使用Qwen 百炼LLM,具体见 百炼接入Claude Code
export ANTHROPIC_API_KEY="sk-xxxxx"
export ANTHROPIC_BASE_URL="https://dashscope.aliyuncs.com/apps/anthropic"
export ANTHROPIC_MODEL="qwen3.6-plus"也可以直接配置在~/.claude/settings.json ,没有可以新建立一个。
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "",
"ANTHROPIC_BASE_URL": "https://dashscope.aliyuncs.com/apps/anthropic",
"ANTHROPIC_MODEL": "deepseek-v4-pro",
"ANTHROPIC_SMALL_FAST_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-pro"
}
}由于我在国内没办法使用 Claude 默认的 Web Fetch 和 Web Search 功能,我需要禁掉它,然后我需要使用 AnySearch。这个是https://github.com/anysearch-ai/anysearch-skill
skill,你帮我安装一下,我的anysearch的ak是as_sk_3e3f82418dd84df9c03da1d3470ed533。你帮我配置一下。我不清楚这个 skill 是否能够代替 web fetch 功能,总之我是需要一个能搜索、能爬取网页的正常服务。并且配置它默认允许可用,不要每次都来询问我。这个网页里有一些内容,你帮我看一下:https://academy.claude-code.club/zh/getting-started/claude-code/faq/fetch-websearch-alternatives 。
按照配置一下Paywright MCP,并设置默认可用。
安装完成后,需要重启,并进行测试。由于无法搜索,因此需要配置Tavily MCP 或者 代理。
claude mcp add tavily-remote-mcp --transport http https://mcp.tavily.com/mcp/再开启一个claude 对话,/mcp,根据引导会自动打开网页做鉴权。
claude
/mcp
# 指令做验证
使用tavily-remote-mcp搜索一下杭州的天气根目录设置
# claude 根目录配置
export CLAUDE_CONFIG_DIR=/mnt/nas/liming.plm/.claude模型设置
{
"permissions": {
"allow": [
"Bash(*)"
]
},
"env": {
"ANTHROPIC_AUTH_TOKEN": "",
"ANTHROPIC_BASE_URL": "https://dashscope.aliyuncs.com/apps/anthropic",
"ANTHROPIC_MODEL": "deepseek-v4-pro",
"ANTHROPIC_SMALL_FAST_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-pro"
}
}源码安装
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone & enter
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
# Create venv with Python 3.11
uv venv venv --python 3.11
export VIRTUAL_ENV="$(pwd)/venv"
# Install everything
uv pip install -e ".[all]"
uv pip install -e "./tinker-atropos"
npm install # optional, for browser tools and WhatsApp
# Configure
mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills,pairing,hooks,image_cache,audio_cache,whatsapp/session}
cp cli-config.yaml.example ~/.hermes/config.yaml
touch ~/.hermes/.env
echo 'OPENROUTER_API_KEY=sk-or-v1-your-key' >> ~/.hermes/.env
# Make hermes available globally
mkdir -p ~/.local/bin
ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes
# Verify
hermes doctor
hermes非源码安装
# 需要配置阿里云镜像,pip安装会快一些
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash配置qwen模型
hermes model
https://dashscope.aliyuncs.com/compatible-mode/v1wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.debcd /root/.hermes/hermes-agent && source venv/bin/activate && hermes
hermescd /root/.hermes/hermes-agent && source venv/bin/activate
pip install aiohttp cryptography
pip install qrcode
hermes gateway setup