Skip to main content
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.
To use the latest GLM models, run /model in Pi Coding Agent and select the corresponding model code.

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