@sqncr/openclaw-cli-agent-skill
v0.1.0
Published
OpenClaw skill that delegates coding tasks to Kimi CLI agents in isolated git worktrees
Downloads
25
Readme
openclaw CLI agent skill
OpenClaw skill that delegates coding tasks to for now to Kimi CLI agents in isolated git worktrees. The CLI Agents build the code and return their results back to openclaw.
Prerequisites
You must have a subscription of the CLI Agent you want to use. Install and authenticate the CLI yourself before using this skill. This skill does not store or use any credentials.
- Node.js >= 18
- Kimi CLI installed and authenticated (run
kimithen/loginin the REPL)
CI and credentials: This repo does not use or store any credentials. GitHub Actions runs lint, build, and unit tests only. Integration tests require a local CLI and auth; run npm run test:integration locally.
Install
Install and forget
Install the CLI:
# From npm (recommended) npm install -g @sqncr/openclaw-cli-agent-skill # Or from git npm install -g github:quratus/openclaw_cli_agent_skill # Or clone and link git clone https://github.com/quratus/openclaw_cli_agent_skill.git cd openclaw_cli_agent_skill npm install && npm run build npm linkRegister the skill:
npm run install-skillRestart gateway or start a new session so the agent discovers the skill.
No credentials or extra config required; you must have authenticated the underlying CLI separately (see Prerequisites).
Register skill so the OpenClaw agent can use it
OpenClaw only loads skills from ~/.openclaw/skills/, the workspace skills/ folder, or skills.load.extraDirs in config. After installing the CLI, register the skill so your bot (e.g. Hermes) can see "cli-worker":
cd openclaw_cli_agent_skill # or wherever you cloned it
npm run install-skillThis symlinks skills/cli-worker to ~/.openclaw/skills/cli-worker. Restart the OpenClaw gateway or start a new chat so the agent gets the updated skills list.
Quick start
# Verify Kimi CLI is set up
cli-worker verify
# Run a simple task
cli-worker execute "Reply OK"Commands
| Command | Description |
|--------|-------------|
| cli-worker verify | Check Kimi CLI install and auth |
| cli-worker execute "<prompt>" | Run a task in an isolated worktree |
| cli-worker status <taskId> | Show task status from report |
| cli-worker worktree list | List active worktrees |
| cli-worker worktree remove <taskId> | Remove a worktree |
| cli-worker cleanup [--older-than N] | Remove worktrees older than N hours (default 24) |
Output format
- Default
jsonprints only the last assistant text from the stream. - Use
--output-format textto get full plain-text output (useful when the agent should consume all output).
Merge and cleanup
After a task completes:
- To keep the work: From the main repo (e.g., on
main), run:git merge openclaw/<taskId> cli-worker worktree remove <taskId> - To discard: Run
cli-worker worktree remove <taskId>directly, or rely oncli-worker cleanup --older-than N.
Config
Optional config file: ~/.openclaw/openclaw.json
{
"worktree": { "basePath": "~/.openclaw/worktrees/kimi" }
}Override with env: OPENCLAW_CONFIG=/path/to/config.json
OpenClaw skill registration
Recommended: run npm run install-skill from this repo to symlink the skill into ~/.openclaw/skills/cli-worker. OpenClaw loads skills from that directory automatically; no config change needed.
Alternative (extra dir): add this repo's skills folder to config so OpenClaw loads it without a symlink:
// ~/.openclaw/openclaw.json — merge into existing "skills"
"skills": {
"load": { "extraDirs": ["/path/to/openclaw_cli_agent_skill/skills"] }
}OpenClaw integration
To run cleanup from OpenClaw's cron (e.g. remove worktrees older than 24h when skill is enabled), add to your cleanup script:
# When cli-worker skill is enabled
if command -v cli-worker >/dev/null 2>&1; then
cli-worker cleanup --older-than 24
fiKnown limitations
- Kimi CLI only (v1). This release is built and tested for the Kimi CLI (kimi-code). It may not work with other coding CLIs out of the box. If you want to use this concept with other workers (e.g. Claude Code, OpenCode, Aider), contributions are welcome: the design can be extended with provider adapters so one skill supports multiple CLIs. See the repo for the current structure (auth, spawn, parser) and open an issue or PR to propose another provider.
- Kimi must be installed and authenticated by the user (
kimi, then/loginin the REPL); the skill cannot perform login for you. - Timeout is a hard kill at
--timeoutminutes; there is no soft "wrap up" warning (Kimi print mode may not support stdin for that). - Session resumption (resume an interrupted task in the same Kimi session) is planned for a later version.
License
MIT
