{"id":35271777,"url":"https://github.com/staticpayload/zai-code","last_synced_at":"2026-01-13T21:47:05.544Z","repository":{"id":331062202,"uuid":"1124731327","full_name":"staticpayload/zai-code","owner":"staticpayload","description":"Z.ai-native AI code editor — CLI-first, interactive editor shell with plan-diff-apply workflow. Not affiliated with Z.ai.","archived":false,"fork":false,"pushed_at":"2025-12-30T06:22:44.000Z","size":6109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-02T17:07:37.199Z","etag":null,"topics":["ai","ai-cli-code-editor-zai-typescript-nodejs","cli","code","editor","nodejs","typescript","zai"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@staticpayload/zai-code","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staticpayload.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-29T14:16:06.000Z","updated_at":"2025-12-30T06:22:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/staticpayload/zai-code","commit_stats":null,"previous_names":["staticpayload/zai-code"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/staticpayload/zai-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticpayload%2Fzai-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticpayload%2Fzai-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticpayload%2Fzai-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticpayload%2Fzai-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staticpayload","download_url":"https://codeload.github.com/staticpayload/zai-code/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticpayload%2Fzai-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-cli-code-editor-zai-typescript-nodejs","cli","code","editor","nodejs","typescript","zai"],"created_at":"2025-12-30T12:25:15.059Z","updated_at":"2026-01-13T21:47:05.539Z","avatar_url":"https://github.com/staticpayload.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Z.ai Code\n\n```\n ███████╗ █████╗ ██╗     ██████╗ ██████╗ ██████╗ ███████╗    /\\_/\\\n ╚══███╔╝██╔══██╗██║    ██╔════╝██╔═══██╗██╔══██╗██╔════╝   ( o.o )\n   ███╔╝ ███████║██║    ██║     ██║   ██║██║  ██║█████╗      \u003e ^ \u003c\n  ███╔╝  ██╔══██║██║    ██║     ██║   ██║██║  ██║██╔══╝  \n ███████╗██║  ██║██║    ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚══════╝╚═╝  ╚═╝╚═╝     ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n```\n\nA Z.ai-native AI code editor -- CLI-first, interactive TUI with cosmic orange theme.\n\n\u003e DISCLAIMER: This project is NOT affiliated with, endorsed by, or sponsored by Z.ai or Anthropic.\n\n---\n\n## What's New in v2.0.0\n\n- **Cosmic Orange Theme** - Fresh new color scheme\n- **Animated Mascot** - Cute cat companion in the header\n- **Smart Task Routing** - Auto-detects task complexity\n- **Improved Output** - Markdown rendering, structured formatting\n- **Better Settings** - Keyboard-driven settings panel\n\n---\n\n## Features\n\n- Interactive TUI with command palette and keyboard shortcuts\n- Multiple modes: edit, ask, auto, explain, review, debug\n- Safe workflow: Plan \u003e Generate \u003e Diff \u003e Apply\n- Smart task analysis - auto-detects complexity and routes accordingly\n- Z.ai GLM models (GLM-4.7 default)\n- Git-aware with branch info and dirty state warnings\n- Undo/rollback support for all file operations\n- Cross-platform: macOS, Linux, Windows\n\n---\n\n## Installation\n\n```bash\nnpm install -g @staticpayload/zai-code\n```\n\n## Authentication\n\n```bash\nzcode auth\n```\n\nOr set via environment variable:\n```bash\nexport Z_KEY=\"your-api-key\"\n```\n\n---\n\n## Quick Start\n\n```bash\nzcode\n```\n\nType a task naturally:\n```\nadd error handling to auth.ts\n```\n\nOr use quick commands:\n```\n/do add input validation       # plan + generate\n/run fix the typo in README    # plan + generate + apply (auto)\n/ask what does this function do?\n```\n\n---\n\n## Commands\n\n### Quick Actions\n| Command | Description | Shortcut |\n|---------|-------------|----------|\n| `/do \u003ctask\u003e` | Plan + generate in one step | ^D |\n| `/run \u003ctask\u003e` | Full auto: plan \u003e generate \u003e apply | ^R |\n| `/ask \u003cquestion\u003e` | Quick question | ^A |\n| `/fix \u003cissue\u003e` | Debug and fix | ^F |\n\n### Workflow\n| Command | Description | Shortcut |\n|---------|-------------|----------|\n| `/plan` | Generate execution plan | ^P |\n| `/generate` | Create file changes | ^G |\n| `/diff` | Review pending changes | |\n| `/apply` | Apply changes | |\n| `/undo` | Rollback | ^Z |\n\n### Files\n| Command | Description |\n|---------|-------------|\n| `/open \u003cpath\u003e` | Add file to context |\n| `/close \u003cpath\u003e` | Remove from context |\n| `/files` | List open files |\n| `/search \u003cq\u003e` | Search workspace |\n| `/read \u003cpath\u003e` | View file |\n| `/tree` | Directory tree |\n\n### System\n| Command | Description |\n|---------|-------------|\n| `/settings` | Settings panel (F2) |\n| `/mode \u003cname\u003e` | Switch mode |\n| `/model \u003cname\u003e` | Select model |\n| `/git` | Git operations |\n| `/commit` | AI commit message |\n| `/help` | Show commands |\n\n---\n\n## Modes\n\n| Mode | Description |\n|------|-------------|\n| `auto` | YOLO - execute directly |\n| `edit` | Plan/generate/apply workflow |\n| `ask` | Read-only Q\u0026A |\n| `debug` | Fix issues |\n| `review` | Code review |\n| `explain` | Explain code |\n\nSwitch: `/mode auto` or Shift+Tab\n\n---\n\n## Workflow\n\n```\nType task  \u003e  /plan  \u003e  /generate  \u003e  /diff  \u003e  /apply\n```\n\nOr quick:\n```\n/do \u003ctask\u003e   # plan + generate\n/run \u003ctask\u003e  # full auto\n```\n\n---\n\n## Configuration\n\n```\n~/.zai/\n├── auth.json       # API key\n├── settings.json   # Preferences\n└── config.json     # API config\n\n.zai/               # Project-level\n├── workspace.json  # Session\n└── context.md      # AI rules\n```\n\n---\n\n## Customization\n\n### agents.md\n\nCreate an `agents.md` file in your project root to give the AI project-specific instructions:\n\n```markdown\n# Project Rules\n\n## Tech Stack\n- TypeScript + React\n- PostgreSQL database\n- Jest for testing\n\n## Coding Standards\n- Use functional components\n- Prefer async/await over promises\n- Always add error handling\n\n## File Structure\n- Components in src/components/\n- Utils in src/utils/\n- Types in src/types/\n\n## Don't\n- Don't modify package.json without asking\n- Don't delete test files\n- Don't use any type\n```\n\nThe AI will read this file and follow your project-specific rules.\n\n### .zai/context.md\n\nSimilar to agents.md but stored in the .zai folder (gitignored by default). Good for personal preferences that shouldn't be shared with the team.\n\n### Settings\n\nPress F2 or `/settings` to configure:\n- AI Model (glm-4.7, glm-4.5-air)\n- Default Mode (auto, edit, ask, etc.)\n- ASCII Logo (on/off)\n- Color Theme\n- Confirmation Mode\n- Shell Execution\n- Debug Logging\n\nSettings are stored in `~/.zai/settings.json` (global) or `.zai/settings.json` (project).\n\n### Project-level Settings\n\nCreate `.zai/settings.json` in your project for project-specific settings that override global ones:\n\n```json\n{\n  \"model\": { \"current\": \"glm-4.7\" },\n  \"execution\": { \"defaultMode\": \"edit\" },\n  \"ui\": { \"asciiLogo\": \"on\" }\n}\n```\n\n---\n\n## Requirements\n\n- Node.js 18+\n- Z.ai API key\n\n---\n\n## License\n\nGPL-3.0\n\n---\n\n## Links\n\n- npm: https://www.npmjs.com/package/@staticpayload/zai-code\n- GitHub: https://github.com/staticpayload/zai-code\n\n---\n\n\u003e Independent open-source project. Not affiliated with Z.ai or Anthropic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticpayload%2Fzai-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaticpayload%2Fzai-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticpayload%2Fzai-code/lists"}