chenhg5/cc-connect · error
kimi: %q CLI not found in PATH, install with: pip install ki
Error message
kimi: %q CLI not found in PATH, install with: pip install kimi-cli
What it means
Agent construction (New) fails when exec.LookPath cannot find the kimi CLI binary in PATH. The error names the binary and suggests installing it with `pip install kimi-cli`, since the agent shells out to the kimi CLI to run sessions.
Source
Thrown at agent/kimi/kimi.go:85
switch v := opts["timeout_mins"].(type) {
case int64:
timeoutMins = v
case int:
timeoutMins = int64(v)
case float64:
timeoutMins = int64(v)
default:
if v != nil {
slog.Debug("kimi: timeout_mins has unexpected type", "type", fmt.Sprintf("%T", v))
}
}
var timeout time.Duration
if timeoutMins > 0 {
timeout = time.Duration(timeoutMins) * time.Minute
}
if _, err := exec.LookPath(cmd); err != nil {
return nil, fmt.Errorf("kimi: %q CLI not found in PATH, install with: pip install kimi-cli", cmd)
}
// Probe once so Send() can build args that match the installed CLI
// surface (see #1456). The probe has its own timeout; failures fall
// back to assuming the modern CLI (no --print).
flagSupport := probeKimiFlags(context.Background(), cmd, 5*time.Second)
return &Agent{
workDir: workDir,
model: model,
mode: mode,
cmd: cmd,
cliExtraArgs: extraArgs,
configEnv: core.ParseConfigEnv(opts),
timeout: timeout,
activeIdx: -1,
flagSupport: flagSupport,
}, nilView on GitHub (pinned to 4000b2338a)
Solutions
- Install the CLI: `pip install kimi-cli`
- If already installed, verify with `which kimi` and add its directory to PATH for the daemon user
- For systemd, set Environment=PATH=... (or ExecStart via absolute binary path) so the service sees the venv/~/.local/bin
- Check the agent's `command` config option points at the correct binary name/path
Example fix
// config.toml — before [agents.kimi] command = "kimi" # not on daemon PATH // after (systemd unit) Environment=PATH=/home/app/.local/bin:/usr/local/bin:/usr/bin:/bin # or install: pip install kimi-cli
Defensive patterns
Strategy: validation
Validate before calling
if _, err := exec.LookPath("kimi"); err != nil {
return fmt.Errorf("kimi-cli not installed; run: pip install kimi-cli")
} Try / catch
agent, err := kimi.New(opts)
if err != nil {
if strings.Contains(err.Error(), "CLI not found in PATH") {
return fmt.Errorf("install kimi-cli and ensure its bin dir is in the daemon PATH: %w", err)
}
return err
} Prevention
- Run `cc-connect doctor` (or a LookPath check) at startup before accepting messages
- Install kimi-cli inside the same venv/user the daemon runs as
- Set an explicit PATH in systemd/launchd unit files including ~/.local/bin
- Document the pip install step in deployment runbooks
When it happens
Trigger: Creating a kimi agent via New(...) (directly or through core.CreateAgent("kimi", opts)) when the configured/derived kimi command is not on PATH.
Common situations: kimi-cli never installed; installed in a Python venv that isn't activated in the daemon environment; systemd/launchd service has a minimal PATH missing ~/.local/bin or the venv bin dir; typo in config command name.
Related errors
- qoder: %q not found in PATH, install with: curl -fsSL https:
- copilot: %q CLI not found in PATH, please install it first
- opencode: %q CLI not found in PATH, install from: https://gi
- antigravitySession: start: %w
- claudecode: 'claude' CLI not found in PATH
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/782c836748e40605.
Report an issue: GitHub.