使用感想
平时jupyter ipynb用的多,感觉agent普遍不好用,claude code原版一般,然后+kimi k2看似省钱,但是也不便宜,而且速度慢,不太好用。不适合重度使用jupyter的人。
reference
下载node.js
windows 下载msi,或者macOS下载.pkg

添加图片注释,不超过 140 字(可选)
根据提示安装完,(后面有一个option的chocolate安装选项,可以不选)
安装Claude code
npm install -g @anthropic-ai/claude-code
-g 是globally的意思,而不是在当前某个特定文件夹里。
后续如果需要update
npm update -g @anthropic-ai/claude-code
顺便把npm upgrade一下
npm install -g npm@11.4.2
安装好之后
cd project
claude
就可以用了
会让你选颜色scheme,然后提示你login method

添加图片注释,不超过 140 字(可选)
Kimi K2 API key 国内版
.cn(支持微信/手机号登录) :

添加图片注释,不超过 140 字(可选)
左边API Key管理,创建key

添加图片注释,不超过 140 字(可选)
保存密钥
充值(50)重要!!
免费用户的话用claude code, k2 api会报错显示错误,一定要充值,把等级提上去!

添加图片注释,不超过 140 字(可选)
最少充50元就可以用了,然后冲500的话,TPD就可以没有限制了!
充值,左侧账户充值:

添加图片注释,不超过 140 字(可选)
更改Claude Code内部API
在terminal粘贴下面的:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/LLM-Red-Team/kimi-cc/refs/heads/main/install.sh)"
!! 一定要新开一个ubuntu terminal 输入claude,才可以看到更新!
如果需要替换api key,这里改了一段bash文件,可以覆盖住原先的api key
#!/bin/bash
set -e
install_nodejs() {
local platform=$(uname -s)
case "$platform" in
Linux|Darwin)
echo "🚀 Installing Node.js on Unix/Linux/macOS..."
echo "📥 Downloading and installing nvm..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
echo "🔄 Loading nvm environment..."
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
echo "📦 Downloading and installing Node.js v22..."
nvm install 22
echo -n "✅ Node.js installation completed! Version: "
node -v
echo -n "✅ Current nvm version: "
nvm current
echo -n "✅ npm version: "
npm -v
;;
*)
echo "Unsupported platform: $platform"
exit 1
;;
esac
}
# Check if Node.js is already installed and version is >= 18
if command -v node >/dev/null 2>&1; then
current_version=$(node -v | sed 's/v//')
major_version=$(echo $current_version | cut -d. -f1)
if [ "$major_version" -ge 18 ]; then
echo "Node.js is already installed: v$current_version"
else
echo "Node.js v$current_version is installed but version < 18. Upgrading..."
install_nodejs
fi
else
echo "Node.js not found. Installing..."
install_nodejs
fi
# Check if Claude Code is already installed
if command -v claude >/dev/null 2>&1; then
echo "Claude Code is already installed: $(claude --version)"
else
echo "Claude Code not found. Installing..."
npm install -g @anthropic-ai/claude-code
fi
# Configure Claude Code to skip onboarding
echo "Configuring Claude Code to skip onboarding..."
node --eval '
const fs = require("fs");
const os = require("os");
const path = require("path");
const homeDir = os.homedir();
const filePath = path.join(homeDir, ".claude.json");
if (fs.existsSync(filePath)) {
const content = JSON.parse(fs.readFileSync(filePath, "utf-8"));
fs.writeFileSync(filePath, JSON.stringify({ ...content, hasCompletedOnboarding: true }, null, 2), "utf-8");
} else {
fs.writeFileSync(filePath, JSON.stringify({ hasCompletedOnboarding: true }, null, 2), "utf-8");
}
'
# Prompt user for API key
echo "🔑 Please enter your Moonshot API key:"
echo " You can get your API key from: https://platform.moonshot.cn/console/api-keys"
echo " Note: The input is hidden for security. Please paste your API key directly."
echo ""
read -s api_key
echo ""
if [ -z "$api_key" ]; then
echo "⚠️ API key cannot be empty. Please run the script again."
exit 1
fi
# Detect current shell and determine rc file
current_shell=$(basename "$SHELL")
case "$current_shell" in
bash)
rc_file="$HOME/.bashrc"
;;
zsh)
rc_file="$HOME/.zshrc"
;;
fish)
rc_file="$HOME/.config/fish/config.fish"
;;
*)
rc_file="$HOME/.profile"
;;
esac
# Update (or add) environment variables
echo ""
echo "📝 Updating environment variables in $rc_file..."
# Remove old entries if they exist
sed -i.bak '/ANTHROPIC_API_KEY/d' "$rc_file" 2>/dev/null || true
sed -i.bak '/ANTHROPIC_BASE_URL/d' "$rc_file" 2>/dev/null || true
# Append new entries
echo "" >> "$rc_file"
echo "# Claude Code environment variables" >> "$rc_file"
echo "export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic/" >> "$rc_file"
echo "export ANTHROPIC_API_KEY=$api_key" >> "$rc_file"
echo "✅ Environment variables added to $rc_file"
echo ""
echo "🎉 Installation completed successfully!"
echo ""
echo "🔄 Please restart your terminal or run:"
echo " source $rc_file"
echo ""
echo "🚀 Then you can start using Claude Code with:"
echo " claude"
文件名保存为setup_claude.sh,然后chmod +x setup_claude.sh 然后./setup_claude.sh即可
!!每次有任何更改,改完之后,一定新开一个terminal!!

添加图片注释,不超过 140 字(可选)
粘贴APi key,回车,成功

添加图片注释,不超过 140 字(可选)
新开一个terminal,输入claude 进入
注意如果是windows,一定是ubuntu terminal,否则会报错!
进入会提示发现一个custom API,都点击确定,即可

添加图片注释,不超过 140 字(可选)
如果是国际版
国际版(支持google登录):
需要在bash文件里把.cn改成.ai才可以

添加图片注释,不超过 140 字(可选)
方法二
在项目文件夹创建.claude文件夹,在.claude文件夹内创建settings.json文件,文件内容如下,替换自己的kimi的token以及自己的proxy端口就可以直接运行了
{
"env": {
"HTTP_PROXY": "http://127.0.0.1:10808",
"HTTPS_PROXY": "http://127.0.0.1:10808",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxx",
"ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic/"
}
}
VScode 插件安装
vscode里还有一些关于claude code的插件

添加图片注释,不超过 140 字(可选)
可以下载安装