LemonCliRunners.KimiRunner (lemon_cli_runners v0.1.0)

View Source

Kimi CLI subprocess runner.

This module wraps the kimi CLI tool, spawning it as a subprocess and streaming its JSONL events. It enables using Kimi as a subagent with tool action tracking.

Usage

{:ok, pid} = KimiRunner.start_link(
  prompt: "Create a new Elixir module that...",
  cwd: "/path/to/project"
)

stream = KimiRunner.stream(pid)
for event <- LemonAgent.EventStream.events(stream) do
  ...
end

Configuration

The runner uses the following command:

kimi --print --output-format stream-json [-p PROMPT] [--session SESSION_ID]

Summary

Functions

Cancel a running runner

Run synchronously and return the final result

Start the runner

Get the event stream from a running runner

Functions

cancel(pid, reason \\ :user_requested)

Cancel a running runner

run(opts)

Run synchronously and return the final result

start_link(opts)

Start the runner

stream(pid)

Get the event stream from a running runner