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
29 lines (28 loc) • 1.15 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/.
/**
* Gemini CLI (`gemini`). `-p` runs one prompt headless. Autonomy flags
* (`--yolo`, `--approval-mode`) belong in the config's `args`, where the user opts in.
*/
import { withoutModelFlag, } from "../harness.js";
export class GeminiHarness {
id = "gemini";
displayName = "Gemini CLI";
profile = { bin: "gemini", args: [] };
// GEMINI_CLI=1 is stamped only on processes Gemini CLI spawns, so it means "running under
// gemini"; its value is a bare flag, not a session id.
presenceEnv = ["GEMINI_CLI"];
systemPrompt = false;
nativeAgent = false;
confinable = false;
build({ bin, args }, req) {
const argv = [bin, ...(req.model ? withoutModelFlag(args) : args)];
if (req.model)
argv.push("--model", req.model);
if (req.prompt === undefined)
return { argv };
argv.push("-p", req.prompt);
return { argv, failureStream: "stderr" };
}
}