Urgent.News

What's breaking now, across hundreds of outlets.

AI

用claude解读

如果你喜欢在终端里完成开发工作,Claude Code 这类命令行 AI 编程助手会非常顺手:它能读取项目文件、理解目录结构、执行命令、修改代码,并在需要时运行测试 对很多开发者来说,真正的门槛不在工具本身,而在模型接口、网络环境和 API 额度这些配置细节上 这篇教程换一种更直观的方式讲清楚:如何准备本地环境,如何拿到蓝耘 MaaS 的 API Key 和 GLM-5.1 模型名称,再把这些配置写入 Claude Code 可读取的 .claude.json 中 完成后,你就可以在终端里用 Claude Code 调用 GLM-5.1 来辅助写代码、改项目和生成小工具 方案概览 整个流程可以拆成四步: 准备本地开发环境,包括 Node.js、npm、Git 和代码编辑器 在蓝耘 MaaS 控制台创建 API Key,并确认 GLM-5.1 的模型调用名称 安装 Claude…

Claude Code is an AI programming assistant that operates in the terminal, capable of reading project files, understanding directory structure, executing commands, modifying code, and running tests. Many developers find the main barrier to entry is not the tool itself but the configuration details such as model interface, network environment, and API quota. This tutorial provides a step-by-step guide to setting up a local environment for using Claude Code with GLM-5.1 model.

The process can be broken down into four main steps:

1. Prepare the local development environment, which includes Node.js, npm, Git, and a code editor.

2. Obtain the API Key and the model name from the Blue Un (蓝耘 MaaS) console.

3. Install Claude Code and create a .claude.json configuration file.

4. Start Claude Code and verify its functionality with a small project.

To begin, ensure that Node.js, npm, and VS Code or another preferred code editor are installed. Check the versions of Node.js and npm using the `node -v` and `npm -v` commands. For Windows users, PowerShell or CMD can be used, while macOS and Linux users can utilize their system's built-in terminal.

Next, acquire the API Key and the model name by logging into the Blue Un MaaS console, creating a new API Key, and copying the model's call name. The API Key should be securely saved, and the model name is usually displayed as `/maas/zhipuai/GLM-5.1`.

Then, install Claude Code globally using npm: `npm install -g @anthropic-ai/claude-code`. If you encounter permission issues, adjust the npm global installation path or use `sudo` (on macOS or Linux). After installation, verify the version with `claude --version`.

Create a .claude.json configuration file in the user's home directory with the following content, replacing the placeholder API Key with your actual Blue Un API Key:

```json

{

"env": {

"ANTHROPIC_AUTH_TOKEN": "YOUR_BLUE_UN_API_KEY",

"ANTHROPIC_BASE_URL": "https://maas-api.lanyun.net/anthropic",

"API_TIMEOUT_MS": "3000000",

"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",

"ANTHROPIC_DEFAULT_HAIKU_MODEL": "/maas/zhipuai/GLM-5.1",

"ANTHROPIC_DEFAULT_SONNET_MODEL": "/maas/zhipuai/GLM-5.1",

"ANTHROPIC_DEFAULT_OPUS_MODEL": "/maas/zhipuai/GLM-5.1"

},

"hasCompletedOnboarding": true

}

```

Save the file and close the current terminal window. Open a new one and run `claude` to confirm that the configuration has been loaded. Perform a quick test by asking Claude Code to describe your project's directory structure.

Finally, create a small project, such as an HTML file with a Markdown-to-image tool, and let Claude Code assist in writing the code, installing dependencies, and running commands. This approach allows Claude Code to directly read and modify files within the project directory.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in AI

AI Agent Governance for ERP Access: Identity, Access Control and Monitoring

A Cloud Security Alliance research note surveying 235 large-enterprise CISOs and CIOs found that 92% lack full visibility into their AI agents' identities, and 86% don't enforce access policies for…

  • 92% of surveyed CISOs and CIOs lack visibility into AI agents' identities.
  • Only 16% effectively govern access to AI systems with core ERP access.
  • Multi-Cloud layer with scoped tokens addresses governance concerns.

If your AI agent can search the whole company drive, what can it leak?

A customer asks a routine question about an invoice. The support agent has been connected to the entire shared company drive "just in case." The answer it writes is friendly and correct, but it also…

  • AI agent accessing entire company drive increases leakage risk.
  • Agent inadvertently quoted from unexamined draft contract.
  • Essential safeguard: limit agent's access to necessary data sources.

More from Thursday 26 November →