Z.ai-native AI code editor - CLI-first, interactive editor shell with keyboard-driven settings, plan-diff-apply workflow, and safety-first design
npm install @staticpayload/zai-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.
---
- 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
---
- 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
---
`bash`
npm install -g @staticpayload/zai-code
`bash`
zcode auth
Or set via environment variable:
`bash`
export Z_KEY="your-api-key"
---
`bash`
zcode
Type a task naturally:
``
add error handling to auth.ts
Or 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?
---
| Plan + generate in one step | ^D |
| /run | Full auto: plan > generate > apply | ^R |
| /ask | Quick question | ^A |
| /fix | Debug and fix | ^F |$3
| Command | Description | Shortcut |
|---------|-------------|----------|
| /plan | Generate execution plan | ^P |
| /generate | Create file changes | ^G |
| /diff | Review pending changes | |
| /apply | Apply changes | |
| /undo | Rollback | ^Z |$3
| Command | Description |
|---------|-------------|
| /open | Add file to context |
| /close | Remove from context |
| /files | List open files |
| /search | Search workspace |/read
|| View file |/tree
|| Directory tree |/settings$3
| Command | Description |
|---------|-------------|
|| Settings panel (F2) |/mode
|| Switch mode |/model
|| Select model |/git
|| Git operations |/commit
|| AI commit message |/help
|| Show commands |auto---
Modes
| Mode | Description |
|------|-------------|
|| YOLO - execute directly |edit
|| Plan/generate/apply workflow |ask
|| Read-only Q&A |debug
|| Fix issues |review
|| Code review |explain
|| Explain code |/mode autoSwitch:
or Shift+Tab`---
Workflow
`
Type task > /plan > /generate > /diff > /apply`Or quick:
`
/do# plan + generate
/run# full auto `---
Configuration
``
~/.zai/
├── auth.json # API key
├── settings.json # Preferences
└── config.json # API config.zai/ # Project-level
├── workspace.json # Session
└── context.md # AI rules---
Requirements
- 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.