-
Notifications
You must be signed in to change notification settings - Fork 3
Plugins
🌐 Language: English | 中文
Since SDK v3, any external CLI agent can be registered as a KinetAios engine — zero JS code, one declarative engine field in plugin.json. The plugin's CLI gets its own entry in the engine dropdown as plugin:<name>, streaming tokens, tool events, session resume and cost tracking — everything the built-in CLI engines (Claude Code / Codex) get.
This page is for users of plugin engines. For writing plugins in general (tools / slash commands / panels), see the dev SOP at KinetAiosPlugin.md in the repo root.
- Drop a plugin folder into
<userData>/plugins/<name>/(Settings → Plugins shows the exact path). - The plugin's
plugin.jsondeclares anengineblock (see below). - Enable "CLI engines" in Settings → Behavior (plugin engines share the same toggle).
- Pick the engine from the session header dropdown — it appears as
plugin:<name>with its label.
The engine list hot-rebuilds after install / uninstall / enable / disable — no app restart. Conversations already running on an engine keep their old reference until they finish.
| protocol | wire format | for |
|---|---|---|
ndjson |
one JSON object per line: {"type":"token","text":..}, {"type":"tool",...}, {"type":"cost",...}, {"type":"done"}, {"type":"error","message":..}
|
CLIs you write yourself |
jsonl-claude |
claude -p --output-format stream-json compatible |
claude-protocol agents |
jsonl-codex |
codex exec --json compatible |
codex-protocol agents |
plain |
entire stdout is the answer text | ordinary CLIs (git, ripgrep wrappers, …) |
-
resume.idFieldnames the event field carrying the session id (sessionStartedevents). When the engine emits it, KinetAios stores the id inconv.engineSessionIdand appends the resume args on the next turn. -
mode: "flag"(default) →--resume <id>;mode: "subcommand"→resumeFlagis split on spaces and prepended, e.g."session resume"→my-agent session resume <id> <prompt>(codex-style).
-
inject: "prompt"(default, codex-style): persona + project rules + memory are joined with---separators and prepended to the prompt. -
inject: "system": the block goes throughsystemFlag(default--append-system-prompt) as a separate argv pair — claude-style.
-
Windows
.cmdshims are routed throughshell: true(same as claude/codex); real.exe/unix bins spawn directly. Abort kills the whole process tree (taskkill /T /F). - plain protocol: stderr is split off the answer stream; if the CLI exits non-zero, the last 8 stderr lines are appended to the error message. Exit code 0 with no terminal event = done.
-
Invalid specs (bad
protocolvalue, missingbin, brokenresume) — the engine is not registered; the plugin card in Settings shows a red badge with the exact reason (hover for details). - Name collisions: two plugins contributing the same engine name — the later one wins (same semantics as tool flattening).
- A plugin that contributes an engine ignores the manifest
enginesfield (the engine is the entry point).
plugins/examples/git-agent/ in the repo wraps plain git as an engine (plain protocol, -C {cwd} working dir). It's the reference for the whole chain: manifest → engine registry → dropdown → plain-protocol token stream.
- Engines — the built-in engines and the shared CliEngineAdapter skeleton
-
KinetAiosPlugin.md— full plugin dev SOP (categories, tools, slash commands, panels)
{ "name": "my-agent", "version": "1.0.0", "engine": { "bin": "my-agent", // CLI name, resolved from PATH + common install dirs "protocol": "plain", // ndjson | jsonl-claude | jsonl-codex | plain (default) "args": ["--no-color"], // argv prefix, before the prompt "cwdFlags": ["-C", "{cwd}"], // {cwd} placeholder = session working dir "inject": "prompt", // prompt (default) | system "resume": { "idField": "session_id", "resumeFlag": "--resume", "mode": "flag" }, "label": "My Agent" // display name in dropdown / NEXUS } }