编辑
2026-03-17
AI
00

目录

背景
安装
配置GLM的秘钥
启动
实战

背景

熟悉一下Claude code使用(下面简称CC),由于Claude对国内限制,使用GLM替代官网

当前电脑:Windows11

整篇仅供入门使用!!!

经沟通相关同事,发现CC+cursor或vscode是较为好的实践(后者主要是review及提交代码用)

安装

整体参考:CC接入国内模型

powershell下: node 要版本20以上

bash
node -version

Claude安装,这里这里直接npm安装,当然也可以参考官网:cc官网安装

bash
npm install -g @anthropic-ai/claude-code

确认版本:

bash
claude --version

配置GLM的秘钥

登陆GLM开发者平台: https://bigmodel.cn/usercenter/proj-mgmt/apikeys 这里添加新的api key,然后powershell中配置以下变量:

bash
# powershell 永久命令 setx ANTHROPIC_BASE_URL "https://open.bigmodel.cn/api/anthropic" setx ANTHROPIC_API_KEY "your_key" setx ANTHROPIC_MODEL "glm-4.7"

配置完毕后,可以使用以下命令查看:

bash
gci env:ANTHROPIC*

启动

bash
claude

这里要选1,即信任当前目录

js
PS C:\Users\_USER> claude ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Accessing workspace: C:\Users\_USER Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what's in this folder first. Claude Code'll be able to read, edit, and execute files here. Security guide ❯ 1. Yes, I trust this folder 2. No, exit Enter to confirm · Esc to cancel

如果出现接入账号或api界面选择,

js
Welcome to Claude Code v2.1.77 ………………………………………………………………………………………………………………………………………………………… * █████▓▓░ * ███▓░ ░░ ░░░░░░ ███▓░ ░░░ ░░░░░░░░░░ ███▓░ ░░░░░░░░░░░░░░░░░░░ * ██▓░░ ▓ ░▓▓███▓▓░ * ░░░░ ░░░░░░░░ ░░░░░░░░░░░░░░░░ █████████ * ██▄█████▄██ * █████████ * …………………█ █ █ █……………………………………………………………………………………………………………… Claude Code can be used with your Claude subscription or billed based on API usage through your Console account. Select login method: 1. Claude account with subscription · Pro, Max, Team, or Enterprise2. Anthropic Console account · API usage billing 3. 3rd-party platform · Amazon Bedrock, Microsoft Foundry, or Vertex AI

要选择2,默认会跳去官网,先不用管,回来后,下次进来会根据配置的key匹配对应GLM模型,然后就可以愉快的使用了,如果要用的舒服,还是要续费一个更快更强大的模型,得加钱!

js
PowerShell 7.5.4 PS C:\Users\_USER> claude ╭─── Claude Code v2.1.77 ──────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ Tips for getting started │ │ Welcome back aaali! │ Run /init to create a CLAUDE.md file with instructions for Claude │ │ │ Note: You have launched claude in your home directory. For the bes… │ │ ▐▛███▜▌ │ ─────────────────────────────────────────────────────────────────── │ │ ▝▜█████▛▘ │ Recent activity │ │ ▘▘ ▝▝ │ No recent activity │ │ glm-4.7 · API Usage Billing · aaali Individual │ │ │ Org │ │ │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ↑ Opus now defaults to 1M context · 5x more room, same pricing ⚠Auth conflict: Using ANTHROPIC_API_KEY instead of Anthropic Console key. Either unset ANTHROPIC_API_KEY, or run `claude /logout`. ❯ hello ● Hello! How can I help you today? ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ 

实战

建议先切到对应项目下,然后操作(这个免费的额度还是cot有点慢,换个更快更强大的模型!加钱!)

js
─── Claude Code v2.1.77 ────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ Tips for getting started │ │ Welcome back aaali! │ Run /init to create a CLAUDE.md file with instructions for Claude │ │ │ ───────────────────────────────────────────────────────────────── │ │ ▐▛███▜▌ │ Recent activity │ │ ▝▜█████▛▘ │ No recent activity │ │ ▘▘ ▝▝ │ │ │ glm-4.7 · API Usage Billing · aaali‘s Individual │ │ │ Org │ │ │ ~\_webapi │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ↑ Opus now defaults to 1M context · 5x more room, same pricing ⚠Auth conflict: Using ANTHROPIC_API_KEY instead of Anthropic Console key. Either unset ANTHROPIC_API_KEY, or run `claude /logout`. ❯ what does this project do? ● Let me explore the project to understand what it does. ● Searched for 3 patterns, read 3 files (ctrl+o to expand) ● This is a Django-based ECU calibration and testing platform for Motors . Here's what it does: Core Purpose A vehicle ECU (Electronic Control Unit) calibration management system that handles: 1. A2L File Management - Uploads and parses A2L files (ASAP2 format), which describe ECU parameters and measurements 2. Calibration Parameters - Stores and manages calibration characteristics (parameters that can be modified on ECUs) 3. Vehicle Testing - Manages test tasks, scenarios, and execution records for vehicle calibration 4. HEX File Processing - Parses Intel HEX format files containing ECU calibration data Key Features - Vehicle Management - Tracks vehicle models, VINs, device IDs, and configuration versions - Test Modules - Organizes test cases by module with ownership and grading - Calibration Tasks - Debug and calibration task types with execution tracking - Work Packages - Groups calibration parameters by work package - Maturity Tracking - Tracks calibration parameter maturity levels - Real-time Communication - WebSocket support via Daphne - Async Processing - Celery workers for background tasks - Multi-environment Deployment - Supports test, staging, and production environments Tech Stack - Backend: Django with uWSGI/Daphne (for WebSocket) - Task Queue: Celery - Database: MySQL (inferred from docker-compose references) - Storage: Aliyun OSS - Deployment: Docker containers, deployed via Logan CI/CD platform ✻ Sautéed for 1m 41s

本文作者:lixf6

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!