
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@guizmo-ai/zai-cli
Advanced tools
An open-source AI agent that brings the power of Z.ai GLM models directly into your terminal.
A conversational AI CLI tool powered by Z.ai GLM models with intelligent text editing and tool usage.
Forked from superagent-ai/grok-cli and enhanced with advanced features for the Z.ai GLM ecosystem.

ZAI can now spawn specialized agents to handle complex tasks automatically:
Example: Ask "review my auth module" and GLM automatically launches the code-reviewer agent!
--token-budget to control API costs/undo <filepath>--no-color flag for CI/CD environments--debug for verbose logginga - Accept changes and apply to filer - Reject changes and discardd - Toggle between summary and full diff view# Install from npm (recommended)
npm install -g @guizmo-ai/zai-cli
# Or with Bun
bun add -g @guizmo-ai/zai-cli
zai
The interactive wizard will guide you through:
Configuration is saved to ~/.zai/user-settings.json.
zai configNatural language interface with Z.ai GLM models:
AI automatically:
# Interactive settings panel
zai config
# View configuration
zai config --show
# Update API key
zai config --set-key YOUR_KEY
# Reset to defaults
zai config --reset
Interactive Mode:
zai # Start in current directory
zai -d /path/to/project # Specify working directory
Headless Mode (for scripts/CI):
zai --prompt "analyze package.json and suggest improvements"
zai -p "run tests" --max-tool-rounds 50
# Command line
zai --model glm-4.6
# Environment variable
export ZAI_MODEL=glm-4.5
zai
# User settings (persistent)
zai config # Select "Change Default Model"
export ZAI_API_KEY=your_api_key_here
export ZAI_BASE_URL=https://api.z.ai/api/paas/v4 # Optional
export ZAI_MODEL=glm-4.6 # Optional
Create .zai/ZAI.md in your project:
# Project Guidelines
- Use TypeScript with strict mode
- Follow functional programming patterns
- Add JSDoc comments for public APIs
- Write tests for all new features
ZAI will automatically follow these instructions when working in your project.
Create .zai/settings.json for project-specific configuration:
{
"model": "glm-4.5",
"mcpServers": {
"linear": {
"name": "linear",
"transport": "sse",
"url": "https://mcp.linear.app/sse"
}
}
}
Extend ZAI with Model Context Protocol servers:
# Add Linear integration
zai mcp add linear --transport sse --url https://mcp.linear.app/sse
# Add custom MCP server
zai mcp add my-server --transport stdio --command "bun" --args server.js
# List servers
zai mcp list
# Test connection
zai mcp test linear
Enable high-speed editing at 4,500+ tokens/sec:
export MORPH_API_KEY=your_morph_key
When enabled:
edit_file tool for complex refactoringGLM automatically spawns specialized agents when needed:
Available Agents:
Manual Control:
# In chat mode
/agents # List all available agents
/task code-reviewer "review auth module" # Launch specific agent
/tasks # View agent execution history
Your command history is automatically saved across sessions:
# History saved to ~/.zai/history.json
# Use ↑/↓ to navigate through previous commands
# Press Ctrl+R for fuzzy search through history
Preview all file changes before they're applied with side-by-side diff view and options to accept, reject, or view full diff.
Every file edit is automatically backed up to ~/.zai/backups/:
/undo path/to/file.ts # Restore previous version
Control API costs with configurable limits:
zai --token-budget 50000 # Set max tokens
zai --token-warn-at 80 # Warn at 80% usage
Enable tab completion for your shell:
# Generate completion script
zai completion bash > ~/.zai-completion.sh
source ~/.zai-completion.sh
# Or for zsh
zai completion zsh > ~/.zai-completion.zsh
# Or for fish
zai completion fish > ~/.config/fish/completions/zai.fish
~/.zai/sessions/# Clone the repository
git clone https://github.com/guizmo-ai/zai-glm-cli.git
cd zai-glm-cli
# Install dependencies
npm install
# Development mode
npm run dev
# Build
npm run build
# Run tests
npm test
# Type check
npm run typecheck
zai [options] [message...]
Options:
-V, --version Version number
-d, --directory <dir> Working directory
-k, --api-key <key> Z.ai API key
-u, --base-url <url> API base URL
-m, --model <model> AI model (glm-4.6, glm-4.5, glm-4.5-air)
-p, --prompt <prompt> Headless mode - process and exit
--max-tool-rounds <rounds> Max tool executions (default: 400)
--no-color Disable colored output (for CI/CD)
--debug Enable debug mode with verbose logging
--token-budget <tokens> Set maximum token budget (e.g., 50000)
--token-warn-at <percentage> Warn at percentage (default: 80)
-h, --help Show help
Commands:
config [options] Manage settings
mcp <action> [options] Manage MCP servers
completion [shell] Generate shell completion script
/clear # Clear chat history (with confirmation)
/undo <file> # Restore previous version of file
/agents # List all available specialized agents
/task <type> <description> # Manually launch an agent
/tasks # View agent execution history
Install ZAI CLI:
npm install -g @guizmo-ai/zai-cli
Copy settings (optional):
cp -r ~/.grok ~/.zai
Update configuration:
zai config
# Enter Z.ai API key
# Select GLM model
Environment variables:
GROK_API_KEY → ZAI_API_KEYGROK_BASE_URL → ZAI_BASE_URLGROK_MODEL → ZAI_MODELContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Based on grok-cli by Superagent AI.
Enhanced for Z.ai GLM models with:
MIT License - Copyright (c) 2025 Guizmo AI
See LICENSE file for details.
Get started: npm install -g @guizmo-ai/zai-cli && zai
Need help? Open an issue on GitHub
FAQs
An open-source AI agent that brings the power of Z.ai GLM models directly into your terminal.
We found that @guizmo-ai/zai-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.