Files
agency-agents/integrations/kimi/README.md
Celso de Sá 422fa1bd68 feat(kimi): add Kimi Code CLI integration support
Add complete support for Kimi Code CLI agent format.

- Add convert_kimi() function to generate YAML agent specs
- Add install_kimi() function to install agents to ~/.config/kimi/agents/
- Add Kimi to tool detection and installer UI
- Add integrations/kimi/ directory (generated files gitignored)
- Update integrations/README.md with Kimi documentation
- Add generated agent directories to .gitignore

Users can generate agents with: ./scripts/convert.sh --tool kimi
2026-03-14 15:05:06 -03:00

109 lines
2.0 KiB
Markdown

# Kimi Code CLI Integration
Converts all Agency agents into Kimi Code CLI agent specifications. Each agent
becomes a directory containing `agent.yaml` (agent spec) and `system.md` (system
prompt).
## Installation
### Prerequisites
- [Kimi Code CLI](https://github.com/MoonshotAI/kimi-cli) installed
### Install
```bash
# Generate integration files (required on fresh clone)
./scripts/convert.sh --tool kimi
# Install agents
./scripts/install.sh --tool kimi
```
This copies agents to `~/.config/kimi/agents/`.
## Usage
### Activate an Agent
Use the `--agent-file` flag to load a specific agent:
```bash
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml
```
### In a Project
```bash
cd /your/project
kimi --agent-file ~/.config/kimi/agents/frontend-developer/agent.yaml \
--work-dir /your/project \
"Review this React component for performance issues"
```
### List Installed Agents
```bash
ls ~/.config/kimi/agents/
```
## Agent Structure
Each agent directory contains:
```
~/.config/kimi/agents/frontend-developer/
├── agent.yaml # Agent specification (tools, subagents)
└── system.md # System prompt with personality and instructions
```
### agent.yaml format
```yaml
version: 1
agent:
name: frontend-developer
extend: default # Inherits from Kimi's built-in default agent
system_prompt_path: ./system.md
tools:
- "kimi_cli.tools.shell:Shell"
- "kimi_cli.tools.file:ReadFile"
# ... all default tools
```
## Regenerate
After modifying source agents:
```bash
./scripts/convert.sh --tool kimi
./scripts/install.sh --tool kimi
```
## Troubleshooting
### Agent file not found
Ensure you've run `convert.sh` before `install.sh`:
```bash
./scripts/convert.sh --tool kimi
```
### Kimi CLI not detected
Make sure `kimi` is in your PATH:
```bash
which kimi
kimi --version
```
### Invalid YAML
Validate the generated files:
```bash
python3 -c "import yaml; yaml.safe_load(open('integrations/kimi/frontend-developer/agent.yaml'))"
```