# cmdcode-mini **Repository Path**: xusuai/cmdcode-mini ## Basic Information - **Project Name**: cmdcode-mini - **Description**: CmdCode从零开始的mini版本,体积只有完整CmdCode的二百分之一,就能实现完整的编程功能,效率拉满,极度轻量 - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: master - **Homepage**: https://cmdcode.cn/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-26 - **Last Updated**: 2026-05-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CmdCode 🚀 **AI-powered coding assistant with Plan-Act-Verify-Respond (PAVR) loop, multi-model orchestration, and real-time collaboration.** CmdCode is a next-generation AI coding agent that goes beyond simple chat. It features a sophisticated **PAVR (Plan-Act-Verify-Respond)** reasoning loop for reliable code generation, supports multiple LLM providers (DeepSeek, MiniMax, GLM, Kimi, MiMo, Qwen, and more), and runs both as a CLI terminal tool and a full-featured WebUI. [](https://github.com/xusu-ai/cmdcode) [](https://gitee.com/xusuai/cmdcode-mini) [](https://cmdcode.cn) --- ## ✨ Features - **🧠 PAVR Loop** — Plan → Act → Verify → Respond cycle ensures reliable, test-driven code generation - **🔌 Multi-Provider** — DeepSeek, MiniMax, GLM, Kimi, MiMo, Qwen, OpenAI-compatible, and more - **🛠️ Tool-Oriented** — File editing, shell execution, web scraping, memory search, code analysis, and QQ messaging - **🌐 WebUI + CLI** — Full-featured browser interface and terminal REPL with equal capabilities - **🔐 User System** — Multi-user auth with workspace isolation, disk quotas, and encrypted secrets - **🧩 Extensible** — Custom model providers via configurable API endpoints and key pools - **📦 Self-Contained** — Single binary distribution, zero external runtime dependencies - **🔒 Security First** — Sandboxed execution, command allowlist, encrypted storage, fork-bomb protection --- ## 📋 Requirements - **Runtime**: [Bun](https://bun.sh) v1.3+ (runtime + package manager) - **OS**: Linux (Ubuntu 22.04+, Debian 12+, or any modern distro) - **RAM**: 256MB minimum (512MB+ recommended for large codebases) - **Disk**: ~200MB for binary + dependencies --- ## ⚡ Quick Start ```bash # 1. Clone the repository git clone https://github.com/xusu-ai/cmdcode.git cd cmdcode # 2. Install dependencies bun install # 3. Start the CLI bun run src/cli.ts # 4. Start the WebUI (separate terminal) bun run src/web.ts ``` ### Docker / Pre-built Binary Pre-built binaries are available on the [Releases](https://github.com/xusu-ai/cmdcode/releases) page (coming soon). ```bash # Run from binary (no installation required) ./cmdcode ``` --- ## 🌐 WebUI CmdCode includes a full-featured web interface accessible from any browser: | Mode | Endpoint | Description | |------|----------|-------------| | **Direct Chat** | `cmdcode-web.html` | Chat directly with LLM via browser-side tool loop | | **Proxied Chat** | `webui.html` | Chat through backend proxy with full tool support | | **Settings** | Gear icon | Model selection, API keys, provider configuration | ### WebUI Features - 🎨 Dark theme with warm orange/gold accents - 📱 Mobile-responsive design - 🔄 Real-time streaming responses - 🛠️ Full tool call visualization - 👤 Multi-user login/registration - 📁 Online file manager with upload/download --- ## 🧠 PAVR Loop The PAVR (Plan-Act-Verify-Respond) loop is CmdCode's core differentiator: ``` ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ 📋 Plan │───▶│ 🛠️ Act │───▶│ ✅ Verify│───▶│ 💬 Respond│ │ Analyze │ │ Execute │ │ Validate│ │ Summary │ │ Strategy │ │ Tools │ │ Results │ │ Output │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ ``` 1. **Plan** — Analyzes the task, formulates a strategy, identifies required tools 2. **Act** — Executes tools (file edits, shell commands, searches) with progress tracking 3. **Verify** — Validates results against expectations, runs tests, checks for errors 4. **Respond** — Summarizes outcomes, reports any issues, presents final results PAVR can be toggled on/off via `/pavr on` or `/pavr off` in CLI, or through the WebUI settings. --- ## 🔌 Supported Models CmdCode supports any OpenAI-compatible API endpoint. Built-in providers include: | Provider | Models | API Type | |----------|--------|----------| | **DeepSeek** | V4 Flash, V4 Pro | OpenAI Chat | | **MiniMax** | M2.7, M2.5 | Anthropic Messages / OpenAI | | **GLM (Zhipu)** | 5.1, 5 | OpenAI Chat | | **Kimi (Moonshot)** | K2.6, K2.5 | OpenAI Chat | | **MiMo (Xiaomi)** | V2.5 Pro, V2.5 | OpenAI Chat | | **Qwen (Alibaba)** | 3.6 Plus, 3.5 Plus | OpenAI Chat | | **Any OpenAI-compatible** | Custom | Via `/api/models/add` | ### Custom Providers Users can add any OpenAI-compatible API endpoint through the WebUI settings or CLI: ```bash /model add "My Model" --model my-model --url https://api.example.com/v1 --key sk-xxx ``` --- ## 🔧 CLI Commands | Command | Description | |---------|-------------| | `/help` | Show all available commands | | `/model` | List / switch / add models | | `/keypool` | Manage API key pools | | `/pavr on/off` | Toggle PAVR reasoning loop | | `/workspace` | Manage workspace files | | `/memory` | Configure vector memory | | `/auth` | User authentication | | `/clear` | Clear conversation history | | `/export` | Export conversation as JSON | --- ## 🏗 Architecture ``` cmdcode/ ├── src/ │ ├── cli.ts # CLI entry point and REPL │ ├── web.ts # HTTP API server (Bun.serve) │ ├── chat.ts # Chat engine (base) │ ├── chat-enhanced.ts # Enhanced chat with PAVR loop │ ├── tools.ts # Tool definitions (file, shell, search, etc.) │ ├── models.ts # Built-in model provider registry │ ├── user-models.ts # Custom model management │ ├── user.ts # Authentication & user system │ ├── crypto-util.ts # Encryption utilities │ ├── i18n/ # Internationalization (en, zh) │ ├── memory/ # Vector memory and search │ ├── commands/ # CLI command handlers │ └── intent/ # Intent classification ├── web/ │ ├── cmdcode-web.html # WebUI main page │ └── index.html # Landing page ├── tests/ # Test suites ├── data/ # Runtime data directory └── docs/ # Documentation ``` --- ## 🔒 Security - **No hardcoded keys** — All API keys stored encrypted - **Sandboxed execution** — CPU/memory/disk limits via cgroups - **Command allowlist** — Dangerous commands (fork bombs, network floods) blocked - **Encrypted secrets** — AES-256-CBC for configuration storage - **Path restriction** — File operations limited to workspace directories - **User isolation** — Per-user workspaces with disk quotas --- ## 🤝 Contributing Contributions are welcome! Please follow these guidelines: 1. Fork the repository 2. Create a feature branch (`git checkout -b feature/amazing`) 3. Commit your changes (`git commit -m 'feat: add amazing feature'`) 4. Push to the branch (`git push origin feature/amazing`) 5. Open a Pull Request ### Commit Convention We use [Conventional Commits](https://www.conventionalcommits.org/): ``` feat: new feature fix: bug fix refactor: code restructuring docs: documentation only security: security improvements chore: build/config changes ``` --- ## 📄 License This project is provided as open source under the terms specified in the repository. --- ## 🙏 Acknowledgments - [Bun](https://bun.sh) — JavaScript runtime and package manager - All LLM providers for their powerful API services ---
CmdCode — Code smarter, not harder.
cmdcode.cn |
GitHub |
Gitee