# Pi Coding Agent 新增了使用 GLM 模型的设置指南，支持 GLM Coding Plan，开发者可据此在终端中配置和使用 GLM 进行代码生成与调试

- 来源：智谱AI
- 发布时间：2026-07-29 17:26
- AIWatch 分数：64
- AIWatch 标记：当日精选
- AIWatch 链接：https://aiwatch.icu/events/evt_01kypmyvfx363smfx5pb05z9m4
- 原文链接：https://x.com/Zai_org/status/2082397807500259651

## 精选理由

常规快讯，保留列表

## AI 摘要

Pi Coding Agent 新增了使用 GLM 模型的设置指南，支持 GLM Coding Plan，开发者可据此在终端中配置和使用 GLM 进行代码生成与调试。

## 正文

Pi Coding Agent is a minimalist terminal coding harness with a small core that can be extended via TypeScript extensions, Skills, prompt templates, themes, and Pi Packages. It handles code generation, debugging, project analysis, file operations, and more directly from the command line.

Step 1: Installing Pi Coding Agent

The easiest way to install Pi Coding Agent is with the official install script:

You can also install it with npm:

--ignore-scripts disables lifecycle scripts during dependency installation. Pi Coding Agent’s normal npm installation does not require install scripts.

Step 2: Connect to GLM Coding Plan

1. Obtain Your Z.AI API Key

Visit Z.AI to get your API Key.

2. Launch and Configure Pi Coding Agent

Navigate to your project directory, launch Pi Coding Agent, and run /login zai:

In the Pi Coding Agent interactive interface, run:

Enter the API key you obtained from Z.AI in the Pi Coding Agent interactive interface:

After a successful login, your credentials are saved in ~/.pi/agent/auth.json. Use the /model command in the Pi Coding Agent interactive interface to select the GLM model you want to use.

3. Alternative Configuration

If you prefer not to log in interactively via /login, you can also connect using an environment variable or a custom model configuration file.

Set the environment variable before launching Pi Coding Agent:

Resources

Pi Coding Agent Documentation: pi.dev/docs/latest
Pi Coding Agent GitHub: earendil-works/pi
Custom Model Configuration: pi.dev/docs/latest/models
Provider Configuration: pi.dev/docs/latest/providers
