Gemini CLI is a command-line interface tool that can be made compatible with Z.AI’s GLM models by using a customized fork.Documentation Index
Fetch the complete documentation index at: https://docs.z.ai/llms.txt
Use this file to discover all available pages before exploring further.
Step 1: Obtaining the Custom Version
1. Cloning the Custom Repository
Since the official Gemini CLI repository only supports Google’s Gemini models, we need to use a customized branch that supports OpenRouter compatibility:2. Switching to the Compatible Branch
Step 2: Environment Configuration
1. Setting Environment Variables
Configure the API base URL:
Step 3: Installation and Launch
1. System Requirements
Ensure your Node.js version is >= 18.2. Installing Dependencies
3. Launch Process
After launching, complete the following steps:
- Select a background color theme.
- User login (recommended to use a Google account for authentication, which will redirect to a webpage for verification).
Step 4: Usage Results
Once configured, you can use Z.AI’s GLM models in the command line for conversations and code generation.