# KoaAgent
**Repository Path**: llcTony/koa-agent
## Basic Information
- **Project Name**: KoaAgent
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-03-17
- **Last Updated**: 2026-04-10
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Kode - AI Coding
[](https://www.npmjs.com/package/@shareai-lab/kode)
[](https://opensource.org/licenses/Apache-2.0)
[](https://agents.md)
[δΈζζζ‘£](README.zh-CN.md) | [Contributing](CONTRIBUTING.md) | [Documentation](docs/README.md)
## π’ Update Log
**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/binary-distribution.md`.
## π€ AGENTS.md Standard Support
Kode supports the [AGENTS.md standard](https://agents.md): a simple, open format for guiding coding agents, used by 60k+ open-source projects.
### Full Compatibility with Multiple Standards
- β
**AGENTS.md** - Native support for the OpenAI-initiated standard format
- β
**Legacy `.claude` compatibility** - Reads `.claude` directories and `CLAUDE.md` when present (see `docs/compatibility.md`)
- β
**Subagent System** - Advanced agent delegation and task orchestration
- β
**Cross-platform** - Works with 20+ AI models and providers
Use `# Your documentation request` to generate and maintain your AGENTS.md file automatically, while preserving compatibility with existing `.claude` workflows.
### Instruction Discovery (Codex-compatible)
- Kode reads project instructions by walking from the Git repo root β current working directory.
- In each directory, it prefers `AGENTS.override.md` over `AGENTS.md` (at most one file per directory).
- Discovered files are concatenated root β leaf (combined size capped at 32 KiB by default; override with `KODE_PROJECT_DOC_MAX_BYTES`).
- If `CLAUDE.md` exists in the current directory, Kode also reads it as a legacy instruction file.
## Overview
Kode 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.
> **β οΈ 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.
>
> **π 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.
## Network & Privacy
- Kode does not send product telemetry/analytics by default.
- Network requests happen only when you explicitly use networked features:
- Model provider requests (Anthropic/OpenAI-compatible endpoints you configure)
- Web tools (`WebFetch`, `WebSearch`)
- Plugin marketplace downloads (GitHub/URL sources) and OAuth flows (when used)
- Optional update checks (opt-in via `autoUpdaterStatus: enabled`)
## Features
### Core Capabilities
- π€ **AI-Powered Assistance** - Uses advanced AI models to understand and respond to your requests
- π **Multi-Model Collaboration** - Flexibly switch and combine multiple AI models to leverage their unique strengths
- π¦ **Expert Model Consultation** - Use `@ask-model-name` to consult specific AI models for specialized analysis
- π€ **Intelligent Agent System** - Use `@run-agent-name` to delegate tasks to specialized subagents
- π **Code Editing** - Directly edit files with intelligent suggestions and improvements
- π **Codebase Understanding** - Analyzes your project structure and code relationships
- π **Command Execution** - Run shell commands and see results in real-time
- π οΈ **Workflow Automation** - Handle complex development tasks with simple prompts
### Authoring Comfort
- `Option+G` (Alt+G) opens your message in your preferred editor (respects `$EDITOR`/`$VISUAL`; falls back to code/nano/vim/notepad) and returns the text to the prompt when you close it.
- `Option+Enter` inserts a newline inside the prompt without sending; plain Enter submits. `Option+M` cycles the active model.
### π― Advanced Intelligent Completion System
Our state-of-the-art completion system provides unparalleled coding assistance:
#### Smart Fuzzy Matching
- **Hyphen-Aware Matching** - Type `dao` to match `run-agent-dao-qi-harmony-designer`
- **Abbreviation Support** - `dq` matches `dao-qi`, `nde` matches `node`
- **Numeric Suffix Handling** - `py3` intelligently matches `python3`
- **Multi-Algorithm Fusion** - Combines 7+ matching algorithms for best results
#### Intelligent Context Detection
- **No @ Required** - Type `gp5` directly to match `@ask-gpt-5`
- **Auto-Prefix Addition** - Tab/Enter automatically adds `@` for agents and models
- **Mixed Completion** - Seamlessly switch between commands, files, agents, and models
- **Smart Prioritization** - Results ranked by relevance and usage frequency
#### Unix Command Optimization
- **500+ Common Commands** - Curated database of frequently used Unix/Linux commands
- **System Intersection** - Only shows commands that actually exist on your system
- **Priority Scoring** - Common commands appear first (git, npm, docker, etc.)
- **Real-time Loading** - Dynamic command discovery from system PATH
### User Experience
- π¨ **Interactive UI** - Beautiful terminal interface with syntax highlighting
- π **Tool System** - Extensible architecture with specialized tools for different tasks
- πΎ **Context Management** - Smart context handling to maintain conversation continuity
- π **AGENTS.md Integration** - Use `# documentation requests` to auto-generate and maintain project documentation
## Installation
```bash
npm install -g @shareai-lab/kode
```
> **π¨π³ For users in China**: If you encounter network issues, use a mirror registry:
> ```bash
> npm install -g @shareai-lab/kode --registry=https://registry.npmmirror.com
> ```
Dev channel (latest features):
```bash
npm install -g @shareai-lab/kode@dev
```
After installation, you can use any of these commands:
- `kode` - Primary command
- `kwa` - Kode With Agent (alternative)
- `kd` - Ultra-short alias
### Native binaries (Windows OOTB)
- No WSL/Git Bash required.
- On `postinstall`, Kode will best-effort download a native binary from GitHub Releases into `${KODE_BIN_DIR:-~/.kode/bin}//-/kode(.exe)`.
- The wrapper (`cli.js`) prefers the native binary and falls back to the Node.js runtime (`node dist/index.js`) when needed.
Overrides:
- Mirror downloads: `KODE_BINARY_BASE_URL`
- Disable download: `KODE_SKIP_BINARY_DOWNLOAD=1`
- Cache directory: `KODE_BIN_DIR`
See `docs/binary-distribution.md`.
### Configuration / API keys
- Global config (models, pointers, theme, etc): `~/.kode.json` (or `/config.json` when `KODE_CONFIG_DIR`/`CLAUDE_CONFIG_DIR` is set).
- Project/local settings (output style, etc): `./.kode/settings.json` and `./.kode/settings.local.json` (legacy `.claude` is supported for some features).
- Configure models via `/model` (UI) or `kode models import/export` (YAML). Details: `docs/develop/configuration.md`.
## Usage
### Interactive Mode
Start an interactive session:
```bash
kode
# or
kwa
# or
kd
```
### Non-Interactive Mode
Get a quick response:
```bash
kode -p "explain this function" path/to/file.js
# or
kwa -p "explain this function" path/to/file.js
```
### ACP (Agent Client Protocol)
Run Kode as an ACP agent server (stdio JSON-RPC), for clients like Toad/Zed:
```bash
kode-acp
# or
kode --acp
```
Toad example:
```bash
toad acp "kode-acp"
```
More: `docs/acp.md`.
### Using the @ Mention System
Kode supports a powerful @ mention system for intelligent completions:
#### π¦ Expert Model Consultation
```bash
# Consult specific AI models for expert opinions
@ask-claude-sonnet-4 How should I optimize this React component for performance?
@ask-gpt-5 What are the security implications of this authentication method?
@ask-o1-preview Analyze the complexity of this algorithm
```
#### π€ Specialized Agent Delegation
```bash
# Delegate tasks to specialized subagents
@run-agent-simplicity-auditor Review this code for over-engineering
@run-agent-architect Design a microservices architecture for this system
@run-agent-test-writer Create comprehensive tests for these modules
```
#### π Smart File References
```bash
# Reference files and directories with auto-completion
@packages/core/src/query/index.ts
@docs/README.md
@.env.example
```
The @ mention system provides intelligent completions as you type, showing available models, agents, and files.
### MCP Servers (Extensions)
Kode can connect to MCP servers to extend tools and context.
- Config files: `.mcp.json` (recommended) or `.mcprc` in your project root. See `docs/mcp.md`.
- CLI:
```bash
kode mcp add
kode mcp list
kode mcp get
kode mcp remove
```
Example `.mcprc`:
```json
{
"my-sse-server": { "type": "sse", "url": "http://127.0.0.1:3333/sse" }
}
```
### Permissions & Approvals
- Default mode skips most prompts for speed.
- Safe mode: `kode --safe` requires approval for Bash commands and file writes/edits.
- Plan mode: the assistant may ask to enter plan mode to draft a plan file; while in plan mode, only read-only/planning tools (and the plan file) are allowed until you approve exiting plan mode.
### Paste & Images
- Multi-line/large paste is inserted as a placeholder and expanded on submit.
- Pasting multiple existing file paths inserts `@path` mentions automatically (quoted when needed).
- Image paste (macOS): press `Ctrl+V` to attach clipboard images; you can paste multiple images before sending.
### System Sandbox (Linux)
- In safe mode (or with `KODE_SYSTEM_SANDBOX=1`), agent-triggered Bash tool calls try to run inside a `bwrap` sandbox when available.
- Network is disabled by default; set `KODE_SYSTEM_SANDBOX_NETWORK=inherit` to allow network.
- Set `KODE_SYSTEM_SANDBOX=required` to fail closed if sandbox cannot be started.
- See `docs/system-sandbox.md` for details and platform notes.
### Troubleshooting
- Models: use `/model`, or `kode models import kode-models.yaml`, and ensure required API key env vars exist.
- Windows: if the native binary download is blocked/offline, 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/index.js`).
- 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.
- Sandbox: install `bwrap` (bubblewrap) on Linux, or set `KODE_SYSTEM_SANDBOX=0` to disable.
### AGENTS.md Documentation Mode
Use the `#` prefix to generate and maintain your AGENTS.md documentation:
```bash
# Generate setup instructions
# How do I set up the development environment?
# Create testing documentation
# What are the testing procedures for this project?
# Document deployment process
# Explain the deployment pipeline and requirements
```
This mode automatically formats responses as structured documentation and appends them to your AGENTS.md file.
### Docker Usage
#### Alternative: Build from local source
```bash
# Clone the repository
git clone https://github.com/shareAI-lab/Kode.git
cd Kode
# Build the image locally
docker build --no-cache -t kode .
# Run in your project directory
cd your-project
docker run -it --rm \
-v $(pwd):/workspace \
-v ~/.kode:/root/.kode \
-v ~/.kode.json:/root/.kode.json \
-w /workspace \
kode
```
#### Docker Configuration Details
The Docker setup includes:
- **Volume Mounts**:
- `$(pwd):/workspace` - Mounts your current project directory
- `~/.kode:/root/.kode` - Preserves your kode configuration directory between runs
- `~/.kode.json:/root/.kode.json` - Preserves your kode global configuration file between runs
- **Working Directory**: Set to `/workspace` inside the container
- **Interactive Mode**: Uses `-it` flags for interactive terminal access
- **Cleanup**: `--rm` flag removes the container after exit
**Note**: Kode uses both `~/.kode` directory for additional data (like memory files) and `~/.kode.json` file for global configuration.
The first time you run the Docker command, it will build the image. Subsequent runs will use the cached image for faster startup.
You can use the onboarding to set up the model, or `/model`.
If you don't see the models you want on the list, you can manually set them in `/config`
As long as you have an openai-like endpoint, it should work.
### Commands
- `/help` - Show available commands
- `/model` - Change AI model settings
- `/config` - Open configuration panel
- `/agents` - Manage subagents
- `/output-style` - Set the output style
- `/statusline` - Configure a custom status line command
- `/cost` - Show token usage and costs
- `/clear` - Clear conversation history
- `/init` - Initialize project context
- `/plugin` - Manage plugins/marketplaces (skills, commands)
## Agents / Subagents
Kode supports subagents (agent templates) for delegation and task orchestration.
- Agents are loaded from `.kode/agents` and `.claude/agents` (user + project), plus plugins/policy and `--agents`.
- Manage in the UI: `/agents` (creates new agents under `./.claude/agents` / `~/.claude/agents` by default).
- Run via mentions: `@run-agent- ...`
- Run via tooling: `Task(subagent_type: "", ...)`
- CLI flags: `--agents ` (inject agents for this run), `--setting-sources user,project,local` (control which sources are loaded)
Minimal agent file example (`./.kode/agents/reviewer.md`):
```md
---
name: reviewer
description: "Review diffs for correctness, security, and simplicity"
tools: ["Read", "Grep"]
model: inherit
---
Be strict. Point out bugs and risky changes. Prefer small, targeted fixes.
```
Model field notes:
- Compatibility aliases: `inherit`, `opus`, `sonnet`, `haiku` (mapped to model pointers)
- Kode selectors (via `/model`): pointers (`main|task|compact|quick`), profile name, modelName, or `provider:modelName` (e.g. `openai:o3`)
Validate agent templates:
```bash
kode agents validate
```
See `docs/agents-system.md`.
## Skills & Plugins
Kode supports the [Agent Skills](https://agentskills.io) open format for extending agent capabilities:
- **Agent Skills** format (`SKILL.md`) - see [specification](https://agentskills.io/specification)
- **Marketplace compatibility** (`.kode-plugin/marketplace.json`, legacy `.claude-plugin/marketplace.json`)
- **Install from any repository** using [`add-skill` CLI](https://github.com/vercel-labs/add-skill)
### Quick install with add-skill
Install skills from any git repository:
```bash
# Install from GitHub
npx add-skill vercel-labs/agent-skills -a kode
# Install to global directory
npx add-skill vercel-labs/agent-skills -a kode -g
# Install specific skills
npx add-skill vercel-labs/agent-skills -a kode -s pdf -s xlsx
```
### Install skills from a marketplace
```bash
# Add a marketplace (local path, GitHub owner/repo, or URL)
kode plugin marketplace add ./path/to/marketplace-repo
kode plugin marketplace add owner/repo
kode plugin marketplace list
# Install a plugin pack (installs skills/commands)
kode plugin install document-skills@anthropic-agent-skills --scope user
# Project-scoped install (writes to ./.kode/...)
kode plugin install document-skills@anthropic-agent-skills --scope project
# Disable/enable an installed plugin
kode plugin disable document-skills@anthropic-agent-skills --scope user
kode plugin enable document-skills@anthropic-agent-skills --scope user
```
Interactive equivalents:
```text
/plugin marketplace add owner/repo
/plugin install document-skills@anthropic-agent-skills --scope user
```
### Use skills
- In interactive mode, run a skill as a slash command: `/pdf`, `/xlsx`, etc.
- Kode can also invoke skills automatically via the `Skill` tool when relevant.
### Create a skill (Agent Skills)
Create `./.kode/skills//SKILL.md` (project) or `~/.kode/skills//SKILL.md` (user):
```md
---
name: my-skill
description: Describe what this skill does and when to use it.
allowed-tools: Read Bash(git:*) Bash(jq:*)
---
# Skill instructions
```
Naming rules:
- `name` must match the folder name
- Lowercase letters/numbers/hyphens only, 1β64 chars
Compatibility:
- Kode also discovers `.claude/skills` and `.claude/commands` for legacy compatibility.
### Distribute skills
- Marketplace repo: publish a repo containing `.kode-plugin/marketplace.json` listing plugin packs and their `skills` directories (legacy `.claude-plugin/marketplace.json` is also supported).
- Plugin repo: for full plugins (beyond skills), include `.kode-plugin/plugin.json` at the plugin root and keep all paths relative (`./...`).
See `docs/skills.md` for a compact reference and examples.
### Output styles
Use output styles to switch system-prompt behavior.
- Select: `/output-style` (menu) or `/output-style