akm-cli
Version:
akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cur
30 lines (29 loc) • 1.18 kB
JavaScript
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
/**
* Pi coding-agent CLI (`pi`). `-p` is its print mode, and it reads the message from
* piped stdin: as an argument a prompt that starts with `-`, `--` or `@` is taken as an
* option or a file include. The persona is appended to pi's own system prompt, which
* is the one that explains pi's tools.
*/
import { withoutModelFlag, } from "../harness.js";
export class PiHarness {
id = "pi";
displayName = "Pi";
profile = { bin: "pi", args: [] };
systemPrompt = true;
nativeAgent = false;
confinable = false;
build({ bin, args }, req) {
const argv = [bin, ...(req.model ? withoutModelFlag(args) : args)];
if (req.systemPrompt)
argv.push("--append-system-prompt", req.systemPrompt);
if (req.model)
argv.push("--model", req.model);
if (req.prompt === undefined)
return { argv };
argv.push("-p");
return { argv, stdin: req.prompt, failureStream: "stderr" };
}
}