[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-78621":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},78621,"Kode-CLI","shareAI-lab\u002FKode-CLI","shareAI-lab","Kode CLI — Design for post-human workflows. One unit agent for every human & computer task.","",null,"TypeScript",5110,765,79,33,0,6,22,43,18,39.65,"Apache License 2.0",false,"main",true,[],"2026-06-12 02:03:48","# Kode - AI Coding\n\u003Cimg width=\"991\" height=\"479\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fc1751e92-94dc-4e4a-9558-8cd2d058c1a1\" \u002F>  \u003Cbr> \n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F22005\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F22005\" alt=\"shareAI-lab%2FKode-Agent | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n[![npm version](https:\u002F\u002Fbadge.fury.io\u002Fjs\u002F@shareai-lab%2Fkode.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@shareai-lab\u002Fkode)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FApache-2.0)\n[![AGENTS.md](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAGENTS.md-Compatible-brightgreen)](https:\u002F\u002Fagents.md)\n\n[中文文档](README.zh-CN.md) | [Contributing](CONTRIBUTING.md) | [Documentation](docs\u002FREADME.md)\n\n\u003Cimg width=\"90%\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ffdce7017-8095-429d-b74e-07f43a6919e1\" \u002F>\n\n\u003Cimg width=\"90%\" alt=\"2c0ad8540f2872d197c7b17ae23d74f5\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff220cc27-084d-468e-a3f4-d5bc44d84fac\" \u002F>\n\n\u003Cimg width=\"90%\" alt=\"f266d316d90ddd0db5a3d640c1126930\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F90ec7399-1349-4607-b689-96613b3dc3e2\" \u002F>\n\n\n\u003Cimg width=\"90%\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fb30696ce-5ab1-40a0-b741-c7ef3945dba0\" \u002F>\n\n\n## 📢 Update Log\n\n**2025-12-22**: Native-first distribution (Windows OOTB). Kode prefers a cached native binary and falls back to the Node.js runtime when needed. See `docs\u002Fbinary-distribution.md`.\n\n\n## 🤝 AGENTS.md Standard Support\n\nKode supports the [AGENTS.md standard](https:\u002F\u002Fagents.md): a simple, open format for guiding coding agents, used by 60k+ open-source projects.\n\n### Full Compatibility with Multiple Standards\n\n- ✅ **AGENTS.md** - Native support for the OpenAI-initiated standard format\n- ✅ **Legacy `.claude` compatibility** - Reads `.claude` directories and `CLAUDE.md` when present (see `docs\u002Fcompatibility.md`)\n- ✅ **Subagent System** - Advanced agent delegation and task orchestration\n- ✅ **Cross-platform** - Works with 20+ AI models and providers\n\nUse `# Your documentation request` to generate and maintain your AGENTS.md file automatically, while preserving compatibility with existing `.claude` workflows.\n\n### Instruction Discovery (Codex-compatible)\n\n- Kode reads project instructions by walking from the Git repo root → current working directory.\n- In each directory, it prefers `AGENTS.override.md` over `AGENTS.md` (at most one file per directory).\n- Discovered files are concatenated root → leaf (combined size capped at 32 KiB by default; override with `KODE_PROJECT_DOC_MAX_BYTES`).\n- If `CLAUDE.md` exists in the current directory, Kode also reads it as a legacy instruction file.\n\n## Overview\n\nKode is a powerful AI assistant that lives in your terminal. It can understand your codebase, edit files, run commands, and handle entire workflows for you.\n\n> **⚠️ Security Notice**: Kode runs in YOLO mode by default (equivalent to the `--dangerously-skip-permissions` flag), bypassing all permission checks for maximum productivity. YOLO mode is recommended only for trusted, secure environments when working on non-critical projects. If you're working with important files or using models of questionable capability, we strongly recommend using `kode --safe` to enable permission checks and manual approval for all operations.\n> \n> **📊 Model Performance**: For optimal performance, we recommend using newer, more capable models designed for autonomous task completion. Avoid older Q&A-focused models like GPT-4o or Gemini 2.5 Pro, which are optimized for answering questions rather than sustained independent task execution. Choose models specifically trained for agentic workflows and extended reasoning capabilities.\n\n## Network & Privacy\n\n- Kode does not send product telemetry\u002Fanalytics by default.\n- Network requests happen only when you explicitly use networked features:\n  - Model provider requests (Anthropic\u002FOpenAI-compatible endpoints you configure)\n  - Web tools (`WebFetch`, `WebSearch`)\n  - Plugin marketplace downloads (GitHub\u002FURL sources) and OAuth flows (when used)\n  - Optional update checks (opt-in via `autoUpdaterStatus: enabled`)\n\n\u003Cimg width=\"600\" height=\"577\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F8b46a39d-1ab6-4669-9391-14ccc6c5234c\" \u002F>\n\n## Features\n\n### Core Capabilities\n- 🤖 **AI-Powered Assistance** - Uses advanced AI models to understand and respond to your requests\n- 🔄 **Multi-Model Collaboration** - Flexibly switch and combine multiple AI models to leverage their unique strengths\n- 🦜 **Expert Model Consultation** - Use `@ask-model-name` to consult specific AI models for specialized analysis\n- 👤 **Intelligent Agent System** - Use `@run-agent-name` to delegate tasks to specialized subagents\n- 📝 **Code Editing** - Directly edit files with intelligent suggestions and improvements\n- 🔍 **Codebase Understanding** - Analyzes your project structure and code relationships\n- 🚀 **Command Execution** - Run shell commands and see results in real-time\n- 🛠️ **Workflow Automation** - Handle complex development tasks with simple prompts\n\n### Authoring Comfort\n- `Option+G` (Alt+G) opens your message in your preferred editor (respects `$EDITOR`\u002F`$VISUAL`; falls back to code\u002Fnano\u002Fvim\u002Fnotepad) and returns the text to the prompt when you close it.\n- `Option+Enter` inserts a newline inside the prompt without sending; plain Enter submits. `Option+M` cycles the active model.\n\n### 🎯 Advanced Intelligent Completion System\nOur state-of-the-art completion system provides unparalleled coding assistance:\n\n#### Smart Fuzzy Matching\n- **Hyphen-Aware Matching** - Type `dao` to match `run-agent-dao-qi-harmony-designer`\n- **Abbreviation Support** - `dq` matches `dao-qi`, `nde` matches `node`\n- **Numeric Suffix Handling** - `py3` intelligently matches `python3`\n- **Multi-Algorithm Fusion** - Combines 7+ matching algorithms for best results\n\n#### Intelligent Context Detection\n- **No @ Required** - Type `gp5` directly to match `@ask-gpt-5`\n- **Auto-Prefix Addition** - Tab\u002FEnter automatically adds `@` for agents and models\n- **Mixed Completion** - Seamlessly switch between commands, files, agents, and models\n- **Smart Prioritization** - Results ranked by relevance and usage frequency\n\n#### Unix Command Optimization\n- **500+ Common Commands** - Curated database of frequently used Unix\u002FLinux commands\n- **System Intersection** - Only shows commands that actually exist on your system\n- **Priority Scoring** - Common commands appear first (git, npm, docker, etc.)\n- **Real-time Loading** - Dynamic command discovery from system PATH\n\n### User Experience\n- 🎨 **Interactive UI** - Beautiful terminal interface with syntax highlighting\n- 🔌 **Tool System** - Extensible architecture with specialized tools for different tasks\n- 💾 **Context Management** - Smart context handling to maintain conversation continuity\n- 📋 **AGENTS.md Integration** - Use `# documentation requests` to auto-generate and maintain project documentation\n\n## Installation\n\n```bash\nnpm install -g @shareai-lab\u002Fkode\n```\n\n> **🇨🇳 For users in China**: If you encounter network issues, use a mirror registry:\n> ```bash\n> npm install -g @shareai-lab\u002Fkode --registry=https:\u002F\u002Fregistry.npmmirror.com\n> ```\n\nDev channel (latest features):\n\n```bash\nnpm install -g @shareai-lab\u002Fkode@dev\n```\n\nAfter installation, you can use any of these commands:\n- `kode` - Primary command\n- `kwa` - Kode With Agent (alternative)\n- `kd` - Ultra-short alias\n\n### Native binaries (Windows OOTB)\n\n- No WSL\u002FGit Bash required.\n- On `postinstall`, Kode will best-effort download a native binary from GitHub Releases into `${KODE_BIN_DIR:-~\u002F.kode\u002Fbin}\u002F\u003Cversion>\u002F\u003Cplatform>-\u003Carch>\u002Fkode(.exe)`.\n- The wrapper (`cli.js`) prefers the native binary and falls back to the Node.js runtime (`node dist\u002Findex.js`) when needed.\n\nOverrides:\n- Mirror downloads: `KODE_BINARY_BASE_URL`\n- Disable download: `KODE_SKIP_BINARY_DOWNLOAD=1`\n- Cache directory: `KODE_BIN_DIR`\n\nSee `docs\u002Fbinary-distribution.md`.\n\n### Configuration \u002F API keys\n\n- Global config (models, pointers, theme, etc): `~\u002F.kode.json` (or `\u003CKODE_CONFIG_DIR>\u002Fconfig.json` when `KODE_CONFIG_DIR`\u002F`CLAUDE_CONFIG_DIR` is set).\n- Project\u002Flocal settings (output style, etc): `.\u002F.kode\u002Fsettings.json` and `.\u002F.kode\u002Fsettings.local.json` (legacy `.claude` is supported for some features).\n- Configure models via `\u002Fmodel` (UI) or `kode models import\u002Fexport` (YAML). Details: `docs\u002Fdevelop\u002Fconfiguration.md`.\n\n## Usage\n\n### Interactive Mode\nStart an interactive session:\n```bash\nkode\n# or\nkwa\n# or\nkd\n```\n\n### Non-Interactive Mode\nGet a quick response:\n```bash\nkode -p \"explain this function\" path\u002Fto\u002Ffile.js\n# or\nkwa -p \"explain this function\" path\u002Fto\u002Ffile.js\n```\n\n### ACP (Agent Client Protocol)\n\nRun Kode as an ACP agent server (stdio JSON-RPC), for clients like Toad\u002FZed:\n\n```bash\nkode-acp\n# or\nkode --acp\n```\n\nToad example:\n\n```bash\ntoad acp \"kode-acp\"\n```\n\nMore: `docs\u002Facp.md`.\n\n### Using the @ Mention System\n\nKode supports a powerful @ mention system for intelligent completions:\n\n#### 🦜 Expert Model Consultation\n```bash\n# Consult specific AI models for expert opinions\n@ask-claude-sonnet-4 How should I optimize this React component for performance?\n@ask-gpt-5 What are the security implications of this authentication method?\n@ask-o1-preview Analyze the complexity of this algorithm\n```\n\n#### 👤 Specialized Agent Delegation  \n```bash\n# Delegate tasks to specialized subagents\n@run-agent-simplicity-auditor Review this code for over-engineering\n@run-agent-architect Design a microservices architecture for this system\n@run-agent-test-writer Create comprehensive tests for these modules\n```\n\n#### 📁 Smart File References\n```bash\n# Reference files and directories with auto-completion\n@packages\u002Fcore\u002Fsrc\u002Fquery\u002Findex.ts\n@docs\u002FREADME.md\n@.env.example\n```\n\nThe @ mention system provides intelligent completions as you type, showing available models, agents, and files.\n\n### MCP Servers (Extensions)\n\nKode can connect to MCP servers to extend tools and context.\n\n- Config files: `.mcp.json` (recommended) or `.mcprc` in your project root. See `docs\u002Fmcp.md`.\n- CLI:\n\n```bash\nkode mcp add\nkode mcp list\nkode mcp get \u003Cname>\nkode mcp remove \u003Cname>\n```\n\nExample `.mcprc`:\n\n```json\n{\n  \"my-sse-server\": { \"type\": \"sse\", \"url\": \"http:\u002F\u002F127.0.0.1:3333\u002Fsse\" }\n}\n```\n\n### Permissions & Approvals\n\n- Default mode skips most prompts for speed.\n- Safe mode: `kode --safe` requires approval for Bash commands and file writes\u002Fedits.\n- Plan mode: the assistant may ask to enter plan mode to draft a plan file; while in plan mode, only read-only\u002Fplanning tools (and the plan file) are allowed until you approve exiting plan mode.\n\n### Paste & Images\n\n- Multi-line\u002Flarge paste is inserted as a placeholder and expanded on submit.\n- Pasting multiple existing file paths inserts `@path` mentions automatically (quoted when needed).\n- Image paste (macOS): press `Ctrl+V` to attach clipboard images; you can paste multiple images before sending.\n\n### System Sandbox (Linux)\n\n- In safe mode (or with `KODE_SYSTEM_SANDBOX=1`), agent-triggered Bash tool calls try to run inside a `bwrap` sandbox when available.\n- Network is disabled by default; set `KODE_SYSTEM_SANDBOX_NETWORK=inherit` to allow network.\n- Set `KODE_SYSTEM_SANDBOX=required` to fail closed if sandbox cannot be started.\n- See `docs\u002Fsystem-sandbox.md` for details and platform notes.\n\n### Troubleshooting\n\n- Models: use `\u002Fmodel`, or `kode models import kode-models.yaml`, and ensure required API key env vars exist.\n- Windows: if the native binary download is blocked\u002Foffline, set `KODE_BINARY_BASE_URL` (mirror) or `KODE_SKIP_BINARY_DOWNLOAD=1` (skip download); the wrapper will fall back to the Node.js runtime (`dist\u002Findex.js`).\n- MCP: use `kode mcp list` to check server status; tune `MCP_CONNECTION_TIMEOUT_MS`, `MCP_SERVER_CONNECTION_BATCH_SIZE`, and `MCP_TOOL_TIMEOUT` if servers are slow.\n- Sandbox: install `bwrap` (bubblewrap) on Linux, or set `KODE_SYSTEM_SANDBOX=0` to disable.\n\n### AGENTS.md Documentation Mode\n\nUse the `#` prefix to generate and maintain your AGENTS.md documentation:\n\n```bash\n# Generate setup instructions\n# How do I set up the development environment?\n\n# Create testing documentation  \n# What are the testing procedures for this project?\n\n# Document deployment process\n# Explain the deployment pipeline and requirements\n```\n\nThis mode automatically formats responses as structured documentation and appends them to your AGENTS.md file.\n\n### Docker Usage\n\n#### Alternative: Build from local source\n\n```bash\n# Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002FshareAI-lab\u002FKode.git\ncd Kode\n\n# Build the image locally\ndocker build --no-cache -t kode .\n\n# Run in your project directory\ncd your-project\ndocker run -it --rm \\\n  -v $(pwd):\u002Fworkspace \\\n  -v ~\u002F.kode:\u002Froot\u002F.kode \\\n  -v ~\u002F.kode.json:\u002Froot\u002F.kode.json \\\n  -w \u002Fworkspace \\\n  kode\n```\n\n#### Docker Configuration Details\n\nThe Docker setup includes:\n\n- **Volume Mounts**:\n  - `$(pwd):\u002Fworkspace` - Mounts your current project directory\n  - `~\u002F.kode:\u002Froot\u002F.kode` - Preserves your kode configuration directory between runs\n  - `~\u002F.kode.json:\u002Froot\u002F.kode.json` - Preserves your kode global configuration file between runs\n\n- **Working Directory**: Set to `\u002Fworkspace` inside the container\n\n- **Interactive Mode**: Uses `-it` flags for interactive terminal access\n\n- **Cleanup**: `--rm` flag removes the container after exit\n\n**Note**: Kode uses both `~\u002F.kode` directory for additional data (like memory files) and `~\u002F.kode.json` file for global configuration.\n\nThe first time you run the Docker command, it will build the image. Subsequent runs will use the cached image for faster startup.\n\nYou can use the onboarding to set up the model, or `\u002Fmodel`.\nIf you don't see the models you want on the list, you can manually set them in `\u002Fconfig`\nAs long as you have an openai-like endpoint, it should work.\n\n### Commands\n\n- `\u002Fhelp` - Show available commands\n- `\u002Fmodel` - Change AI model settings\n- `\u002Fconfig` - Open configuration panel\n- `\u002Fagents` - Manage subagents\n- `\u002Foutput-style` - Set the output style\n- `\u002Fstatusline` - Configure a custom status line command\n- `\u002Fcost` - Show token usage and costs\n- `\u002Fclear` - Clear conversation history\n- `\u002Finit` - Initialize project context\n- `\u002Fplugin` - Manage plugins\u002Fmarketplaces (skills, commands)\n\n## Agents \u002F Subagents\n\nKode supports subagents (agent templates) for delegation and task orchestration.\n\n- Agents are loaded from `.kode\u002Fagents` and `.claude\u002Fagents` (user + project), plus plugins\u002Fpolicy and `--agents`.\n- Manage in the UI: `\u002Fagents` (creates new agents under `.\u002F.claude\u002Fagents` \u002F `~\u002F.claude\u002Fagents` by default).\n- Run via mentions: `@run-agent-\u003CagentType> ...`\n- Run via tooling: `Task(subagent_type: \"\u003CagentType>\", ...)`\n- CLI flags: `--agents \u003Cjson>` (inject agents for this run), `--setting-sources user,project,local` (control which sources are loaded)\n\nMinimal agent file example (`.\u002F.kode\u002Fagents\u002Freviewer.md`):\n\n```md\n---\nname: reviewer\ndescription: \"Review diffs for correctness, security, and simplicity\"\ntools: [\"Read\", \"Grep\"]\nmodel: inherit\n---\n\nBe strict. Point out bugs and risky changes. Prefer small, targeted fixes.\n```\n\nModel field notes:\n- Compatibility aliases: `inherit`, `opus`, `sonnet`, `haiku` (mapped to model pointers)\n- Kode selectors (via `\u002Fmodel`): pointers (`main|task|compact|quick`), profile name, modelName, or `provider:modelName` (e.g. `openai:o3`)\n\nValidate agent templates:\n\n```bash\nkode agents validate\n```\n\nSee `docs\u002Fagents-system.md`.\n\n## Skills & Plugins\n\nKode supports the [Agent Skills](https:\u002F\u002Fagentskills.io) open format for extending agent capabilities:\n- **Agent Skills** format (`SKILL.md`) - see [specification](https:\u002F\u002Fagentskills.io\u002Fspecification)\n- **Marketplace compatibility** (`.kode-plugin\u002Fmarketplace.json`, legacy `.claude-plugin\u002Fmarketplace.json`)\n- **Install from any repository** using [`add-skill` CLI](https:\u002F\u002Fgithub.com\u002Fvercel-labs\u002Fadd-skill)\n\n### Quick install with add-skill\n\nInstall skills from any git repository:\n\n```bash\n# Install from GitHub\nnpx add-skill vercel-labs\u002Fagent-skills -a kode\n\n# Install to global directory\nnpx add-skill vercel-labs\u002Fagent-skills -a kode -g\n\n# Install specific skills\nnpx add-skill vercel-labs\u002Fagent-skills -a kode -s pdf -s xlsx\n```\n\n### Install skills from a marketplace\n\n```bash\n# Add a marketplace (local path, GitHub owner\u002Frepo, or URL)\nkode plugin marketplace add .\u002Fpath\u002Fto\u002Fmarketplace-repo\nkode plugin marketplace add owner\u002Frepo\nkode plugin marketplace list\n\n# Install a plugin pack (installs skills\u002Fcommands)\nkode plugin install document-skills@anthropic-agent-skills --scope user\n\n# Project-scoped install (writes to .\u002F.kode\u002F...)\nkode plugin install document-skills@anthropic-agent-skills --scope project\n\n# Disable\u002Fenable an installed plugin\nkode plugin disable document-skills@anthropic-agent-skills --scope user\nkode plugin enable document-skills@anthropic-agent-skills --scope user\n```\n\nInteractive equivalents:\n\n```text\n\u002Fplugin marketplace add owner\u002Frepo\n\u002Fplugin install document-skills@anthropic-agent-skills --scope user\n```\n\n### Use skills\n\n- In interactive mode, run a skill as a slash command: `\u002Fpdf`, `\u002Fxlsx`, etc.\n- Kode can also invoke skills automatically via the `Skill` tool when relevant.\n\n### Create a skill (Agent Skills)\n\nCreate `.\u002F.kode\u002Fskills\u002F\u003Cskill-name>\u002FSKILL.md` (project) or `~\u002F.kode\u002Fskills\u002F\u003Cskill-name>\u002FSKILL.md` (user):\n\n```md\n---\nname: my-skill\ndescription: Describe what this skill does and when to use it.\nallowed-tools: Read Bash(git:*) Bash(jq:*)\n---\n\n# Skill instructions\n```\n\nNaming rules:\n- `name` must match the folder name\n- Lowercase letters\u002Fnumbers\u002Fhyphens only, 1–64 chars\n\nCompatibility:\n- Kode also discovers `.claude\u002Fskills` and `.claude\u002Fcommands` for legacy compatibility.\n\n### Distribute skills\n\n- Marketplace repo: publish a repo containing `.kode-plugin\u002Fmarketplace.json` listing plugin packs and their `skills` directories (legacy `.claude-plugin\u002Fmarketplace.json` is also supported).\n- Plugin repo: for full plugins (beyond skills), include `.kode-plugin\u002Fplugin.json` at the plugin root and keep all paths relative (`.\u002F...`).\n\nSee `docs\u002Fskills.md` for a compact reference and examples.\n\n### Output styles\n\nUse output styles to switch system-prompt behavior.\n\n- Select: `\u002Foutput-style` (menu) or `\u002Foutput-style \u003Cstyle>`\n- Built-ins: `default`, `Explanatory`, `Learning`\n- Stored per-project in `.\u002F.kode\u002Fsettings.local.json` as `outputStyle` (legacy `.claude\u002Fsettings.local.json` is supported)\n- Custom styles: Markdown files under `output-styles\u002F` in `.claude`\u002F`.kode` user + project locations\n- Plugins can provide styles under `output-styles\u002F` (or manifest `outputStyles`); plugin styles are namespaced as `\u003Cplugin>:\u003Cstyle>`\n\nSee `docs\u002Foutput-styles.md`.\n\n## Multi-Model Intelligent Collaboration\n\nUnlike single-model CLIs, Kode implements **true multi-model collaboration**, allowing you to fully leverage the unique strengths of different AI models.\n\n### 🏗️ Core Technical Architecture\n\n#### 1. **ModelManager Multi-Model Manager**\nWe designed a unified `ModelManager` system that supports:\n- **Model Profiles**: Each model has an independent configuration file containing API endpoints, authentication, context window size, cost parameters, etc.\n- **Model Pointers**: Users can configure default models for different purposes in the `\u002Fmodel` command:\n  - `main`: Default model for main Agent\n  - `task`: Default model for SubAgent\n  - `compact`: Model used for automatic context compression when nearing the context window\n  - `quick`: Fast model for simple operations and utilities\n- **Dynamic Model Switching**: Support runtime model switching without restarting sessions, maintaining context continuity\n\n#### 📦 Shareable Model Config (YAML)\n\nYou can export\u002Fimport model profiles + pointers as a team-shareable YAML file. By default, exports do **not** include plaintext API keys (use env vars instead).\n\n```bash\n# Export to a file (or omit --output to print to stdout)\nkode models export --output kode-models.yaml\n\n# Import (merge by default)\nkode models import kode-models.yaml\n\n# Replace existing profiles instead of merging\nkode models import --replace kode-models.yaml\n\n# List configured profiles + pointers\nkode models list\n```\n\nExample `kode-models.yaml`:\n\n```yaml\nversion: 1\nprofiles:\n  - name: OpenAI Main\n    provider: openai\n    modelName: gpt-4o\n    maxTokens: 8192\n    contextLength: 128000\n    apiKey:\n      fromEnv: OPENAI_API_KEY\npointers:\n  main: gpt-4o\n  task: gpt-4o\n  compact: gpt-4o\n  quick: gpt-4o\n```\n\n#### 2. **TaskTool Intelligent Task Distribution**\nOur specially designed `TaskTool` (Architect tool) implements:\n- **Subagent Mechanism**: Can launch multiple sub-agents to process tasks in parallel\n- **Model Parameter Passing**: Users can specify which model SubAgents should use in their requests\n- **Default Model Configuration**: SubAgents use the model configured by the `task` pointer by default\n\n#### 3. **AskExpertModel Expert Consultation Tool**\nWe specially designed the `AskExpertModel` tool:\n- **Expert Model Invocation**: Allows temporarily calling specific expert models to solve difficult problems during conversations\n- **Model Isolation Execution**: Expert model responses are processed independently without affecting the main conversation flow\n- **Knowledge Integration**: Integrates expert model insights into the current task\n\n#### 🎯 Flexible Model Switching\n- **Option+M Quick Switch**: Press Option+M in the input box to cycle the main conversation model\n- **`\u002Fmodel` Command**: Use `\u002Fmodel` command to configure and manage multiple model profiles, set default models for different purposes\n- **User Control**: Users can specify specific models for task processing at any time\n\n#### 🔄 Intelligent Work Allocation Strategy\n\n**Architecture Design Phase**\n- Use **o3 model** or **GPT-5 model** to explore system architecture and formulate sharp and clear technical solutions\n- These models excel in abstract thinking and system design\n\n**Solution Refinement Phase**\n- Use **gemini model** to deeply explore production environment design details\n- Leverage its deep accumulation in practical engineering and balanced reasoning capabilities\n\n**Code Implementation Phase**\n- Use **Qwen Coder model**, **Kimi k2 model**, **GLM-4.5 model**, or **Claude Sonnet 4 model** for specific code writing\n- These models have strong performance in code generation, file editing, and engineering implementation\n- Support parallel processing of multiple coding tasks through subagents\n\n**Problem Solving**\n- When encountering complex problems, consult expert models like **o3 model**, **Claude Opus 4.1 model**, or **Grok 4 model**\n- Obtain deep technical insights and innovative solutions\n\n#### 💡 Practical Application Scenarios\n\n```bash\n# Example 1: Architecture Design\n\"Use o3 model to help me design a high-concurrency message queue system architecture\"\n\n# Example 2: Multi-Model Collaboration\n\"First use GPT-5 model to analyze the root cause of this performance issue, then use Claude Sonnet 4 model to write optimization code\"\n\n# Example 3: Parallel Task Processing\n\"Use Qwen Coder model as subagent to refactor these three modules simultaneously\"\n\n# Example 4: Expert Consultation\n\"This memory leak issue is tricky, ask Claude Opus 4.1 model separately for solutions\"\n\n# Example 5: Code Review\n\"Have Kimi k2 model review the code quality of this PR\"\n\n# Example 6: Complex Reasoning\n\"Use Grok 4 model to help me derive the time complexity of this algorithm\"\n\n# Example 7: Solution Design\n\"Have GLM-4.5 model design a microservice decomposition plan\"\n```\n\n### 🛠️ Key Implementation Mechanisms\n\n#### **Configuration System**\n```typescript\n\u002F\u002F Example of multi-model configuration support\n{\n  \"modelProfiles\": [\n    { \"name\": \"o3\", \"provider\": \"openai\", \"modelName\": \"o3\", \"apiKey\": \"...\", \"maxTokens\": 1024, \"contextLength\": 128000, \"isActive\": true, \"createdAt\": 1710000000000 },\n    { \"name\": \"qwen\", \"provider\": \"alibaba\", \"modelName\": \"qwen-coder\", \"apiKey\": \"...\", \"maxTokens\": 1024, \"contextLength\": 128000, \"isActive\": true, \"createdAt\": 1710000000001 }\n  ],\n  \"modelPointers\": {\n    \"main\": \"o3\",           \u002F\u002F Main conversation model\n    \"task\": \"qwen-coder\",   \u002F\u002F Sub-agent model\n    \"compact\": \"o3\",        \u002F\u002F Context compression model\n    \"quick\": \"o3\"           \u002F\u002F Quick operations model\n  }\n}\n```\n\n#### **Cost Tracking System**\n- **Usage Statistics**: Use `\u002Fcost` command to view token usage and costs for each model\n- **Multi-Model Cost Comparison**: Track usage costs of different models in real-time\n- **History Records**: Save cost data for each session\n\n#### **Context Manager**\n- **Context Inheritance**: Maintain conversation continuity when switching models\n- **Context Window Adaptation**: Automatically adjust based on different models' context window sizes\n- **Session State Preservation**: Ensure information consistency during multi-model collaboration\n\n### 🚀 Advantages of Multi-Model Collaboration\n\n1. **Maximized Efficiency**: Each task is handled by the most suitable model\n2. **Cost Optimization**: Use lightweight models for simple tasks, powerful models for complex tasks\n3. **Parallel Processing**: Multiple models can work on different subtasks simultaneously\n4. **Flexible Switching**: Switch models based on task requirements without restarting sessions\n5. **Leveraging Strengths**: Combine advantages of different models for optimal overall results\n\n### 📊 Comparison (Single-model CLI)\n\n| Feature | Kode | Single-model CLI |\n|---------|------|-----------------|\n| Number of Supported Models | Unlimited, configurable for any model | Only supports one model |\n| Model Switching | ✅ Option+M quick switch | ❌ Requires session restart |\n| Parallel Processing | ✅ Multiple SubAgents work in parallel | ❌ Single-threaded processing |\n| Cost Tracking | ✅ Separate statistics for multiple models | ❌ Single model cost |\n| Task Model Configuration | ✅ Different default models for different purposes | ❌ Same model for all tasks |\n| Expert Consultation | ✅ AskExpertModel tool | ❌ Not supported |\n\nThis multi-model collaboration capability makes Kode a true **AI Development Workbench**, not just a single AI assistant.\n\n## Development\n\nKode is built with modern tools and requires [Bun](https:\u002F\u002Fbun.sh) for development.\n\n### Install Bun\n\n```bash\n# macOS\u002FLinux\ncurl -fsSL https:\u002F\u002Fbun.sh\u002Finstall | bash\n\n# Windows\npowershell -c \"irm bun.sh\u002Finstall.ps1 | iex\"\n```\n\n### Setup Development Environment\n\n```bash\n# Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002FshareAI-lab\u002Fkode.git\ncd kode\n\n# Install dependencies\nbun install\n\n# Run in development mode\nbun run dev\n```\n\n### Build\n\n```bash\nbun run build\n```\n\n### Testing\n\n```bash\n# Run tests\nbun test\n\n# Test the CLI\n.\u002Fcli.js --help\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nApache 2.0 License - see [LICENSE](LICENSE) for details.\n\n## Thanks\n\n- Some code from @dnakov's anonkode\n- Some UI learned from gemini-cli  \n- Some system design learned from upstream agent CLIs\n\n## Support\n\n- 📚 [Documentation](docs\u002F)\n- 🐛 [Report Issues](https:\u002F\u002Fgithub.com\u002FshareAI-lab\u002Fkode\u002Fissues)\n- 💬 [Discussions](https:\u002F\u002Fgithub.com\u002FshareAI-lab\u002Fkode\u002Fdiscussions)\n","Kode CLI 是一个专为后人类工作流程设计的命令行工具，旨在通过单一代理单元处理所有人类与计算机任务。它使用 TypeScript 开发，支持 AGENTS.md 标准，能够与超过 20 种 AI 模型和提供商兼容，并且具备跨平台能力。Kode 能够自动发现并读取项目中的指令文件，理解代码库、编辑文件、执行命令以及管理整个工作流程。适用于需要高效自动化开发流程的场景，如软件开发、持续集成\u002F持续部署等。",2,"2026-06-11 03:57:01","high_star"]