@staticpayload/zai-code
v2.0.0
Published
Z.ai-native AI code editor - CLI-first, interactive editor shell with keyboard-driven settings, plan-diff-apply workflow, and safety-first design
Downloads
4,197
Maintainers
Readme
Z.ai Code
███████╗ █████╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗ /\_/\
╚══███╔╝██╔══██╗██║ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ( o.o )
███╔╝ ███████║██║ ██║ ██║ ██║██║ ██║█████╗ > ^ <
███╔╝ ██╔══██║██║ ██║ ██║ ██║██║ ██║██╔══╝
███████╗██║ ██║██║ ╚██████╗╚██████╔╝██████╔╝███████╗
╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝A Z.ai-native AI code editor -- CLI-first, interactive TUI with cosmic orange theme.
DISCLAIMER: This project is NOT affiliated with, endorsed by, or sponsored by Z.ai or Anthropic.
What's New in v2.0.0
- Cosmic Orange Theme - Fresh new color scheme
- Animated Mascot - Cute cat companion in the header
- Smart Task Routing - Auto-detects task complexity
- Improved Output - Markdown rendering, structured formatting
- Better Settings - Keyboard-driven settings panel
Features
- Interactive TUI with command palette and keyboard shortcuts
- Multiple modes: edit, ask, auto, explain, review, debug
- Safe workflow: Plan > Generate > Diff > Apply
- Smart task analysis - auto-detects complexity and routes accordingly
- Z.ai GLM models (GLM-4.7 default)
- Git-aware with branch info and dirty state warnings
- Undo/rollback support for all file operations
- Cross-platform: macOS, Linux, Windows
Installation
npm install -g @staticpayload/zai-codeAuthentication
zcode authOr set via environment variable:
export Z_KEY="your-api-key"Quick Start
zcodeType a task naturally:
add error handling to auth.tsOr use quick commands:
/do add input validation # plan + generate
/run fix the typo in README # plan + generate + apply (auto)
/ask what does this function do?Commands
Quick Actions
| Command | Description | Shortcut |
|---------|-------------|----------|
| /do <task> | Plan + generate in one step | ^D |
| /run <task> | Full auto: plan > generate > apply | ^R |
| /ask <question> | Quick question | ^A |
| /fix <issue> | Debug and fix | ^F |
Workflow
| Command | Description | Shortcut |
|---------|-------------|----------|
| /plan | Generate execution plan | ^P |
| /generate | Create file changes | ^G |
| /diff | Review pending changes | |
| /apply | Apply changes | |
| /undo | Rollback | ^Z |
Files
| Command | Description |
|---------|-------------|
| /open <path> | Add file to context |
| /close <path> | Remove from context |
| /files | List open files |
| /search <q> | Search workspace |
| /read <path> | View file |
| /tree | Directory tree |
System
| Command | Description |
|---------|-------------|
| /settings | Settings panel (F2) |
| /mode <name> | Switch mode |
| /model <name> | Select model |
| /git | Git operations |
| /commit | AI commit message |
| /help | Show commands |
Modes
| Mode | Description |
|------|-------------|
| auto | YOLO - execute directly |
| edit | Plan/generate/apply workflow |
| ask | Read-only Q&A |
| debug | Fix issues |
| review | Code review |
| explain | Explain code |
Switch: /mode auto or Shift+Tab
Workflow
Type task > /plan > /generate > /diff > /applyOr quick:
/do <task> # plan + generate
/run <task> # full autoConfiguration
~/.zai/
├── auth.json # API key
├── settings.json # Preferences
└── config.json # API config
.zai/ # Project-level
├── workspace.json # Session
└── context.md # AI rulesRequirements
- Node.js 18+
- Z.ai API key
License
GPL-3.0
Links
- npm: https://www.npmjs.com/package/@staticpayload/zai-code
- GitHub: https://github.com/staticpayload/zai-code
Independent open-source project. Not affiliated with Z.ai or Anthropic.
