Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ moshcode install kimi # curl -fsSL https://code.kimi.com/kimi-code/install
moshcode install qwen # npm i -g @qwen-code/qwen-code
moshcode install deepseek # npm i -g @serjm/deepseek-code
moshcode install mimocode # curl -fsSL https://mimo.xiaomi.com/install | bash (binary: mimo)
moshcode install omp # curl -fsSL https://omp.sh/install | sh
moshcode install openagents # curl -fsSL https://openagents.org/install.sh | bash
```

Expand All @@ -118,6 +119,7 @@ moshcode agents kimi # kimi --yolo
moshcode agents qwen # qwen --approval-mode=yolo (autonomous)
moshcode agents deepseek # deepseek-code --turbo (autonomous)
moshcode agents mimocode # mimo --dangerously-skip-permissions --trust (autonomous)
moshcode agents omp # omp --auto-approve (autonomous)
moshcode agents aider # aider --yes-always (autonomous)
moshcode agents openagents # openagents (dashboard)
```
Expand Down Expand Up @@ -461,8 +463,8 @@ of the traffic and a tenth of the price; folding them into `in` makes a $3
session look like a $60 one. Attribution is engine + directory + "started before
this run did", so a session that shares a directory with another agent can pick
up its neighbour's work — `--json` carries the run list when you need to check.
gemini, kimi, qwen, deepseek, mimocode and openagents keep no readable usage
log, so they report no cost rather than zero cost.
gemini, kimi, qwen, deepseek, mimocode, omp and openagents keep no readable
usage log, so they report no cost rather than zero cost.

### Driving it from a script or another agent

Expand Down
2 changes: 1 addition & 1 deletion src/cli-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export const CORE_CLI_COMMANDS = [
+ "codex's rollout token counts, opencode's per-message cost, aider's chat history. a figure marked "
+ "`~` was worked out from published rates and is what the tokens WOULD cost on the api; unmarked "
+ "figures are the engine's own arithmetic. models with no rate show tokens and no cost — add yours "
+ "to ~/.moshcode/pricing.json. gemini, kimi, deepseek, mimocode and openagents log nothing readable, "
+ "to ~/.moshcode/pricing.json. gemini, kimi, deepseek, mimocode, omp and openagents log nothing readable, "
+ "so they report no cost rather than zero. under the table, `burn` is the same windows for every "
+ "engine — last 1 min, 15 min, 1 hour, 4 hours, 8 hours and the report window — with what the "
+ "requests inside each cost, that cost per hour, and the runs behind it; --json carries them as `burn`.",
Expand Down
2 changes: 1 addition & 1 deletion src/cost.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ export const COST_READERS = {
};

/** Engines moshcode can launch but cannot cost — named so the report can say so. */
export const UNCOSTED_ENGINES = ["gemini", "kimi", "deepseek", "mimocode", "openagents"];
export const UNCOSTED_ENGINES = ["gemini", "kimi", "deepseek", "mimocode", "omp", "openagents"];

/**
* Finish a run: price it, and record where the price came from.
Expand Down
28 changes: 27 additions & 1 deletion src/engines.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,29 @@ export const ENGINES = {
],
},
},
omp: {
desc: "omp — Stencil Labs' coding agent with LSP, DAP and subagents (omp.sh)",
bin: "omp",
// `--auto-approve` skips every tool approval prompt; the agent can still
// ask a question, the same shape as kimi's --yolo. `--approval-mode=yolo`
// reaches the same place through a settings override, so this stays on the
// flag that says what it does.
agentArgs: ["--auto-approve"],
// No agentsView: `omp agents` manages the bundled task-agent definitions
// (`omp agents unpack`) — it prints and exits, not a live view to land on.
install: { cmd: "sh", args: ["-c", "curl -fsSL https://omp.sh/install | sh"] },
// Its own updater, which handles both install shapes below and the
// stable/canary channel.
upgrade: { cmd: "omp", args: ["update"] },
// The installer runs `bun install -g` when a native-arch bun is present,
// landing in ~/.bun/bin, and otherwise downloads a prebuilt binary to
// ~/.local/bin (PI_INSTALL_DIR). It edits no shell rc and neither directory
// is guaranteed to be on PATH, so search both.
binDirs: [path.join(homedir(), ".bun", "bin"), path.join(homedir(), ".local", "bin")],
resume: ["--continue"],
// No `state`: the TUI's approval and question wording is not verified
// here, and a guessed pattern is worse than the shared ones.
},
openagents: {
desc: "OpenAgents — multi-agent launcher + dashboard (openagents.org)",
// The package installs three identical bins — `agn`, `openagents`, and
Expand Down Expand Up @@ -416,6 +439,8 @@ export const ENGINE_ALIASES = {
// Same idea for openagents: `agn` and `agent-connector` are the other two
// binary names its package installs, and the domain is how it's advertised.
oa: "openagents", agn: "openagents", "agent-connector": "openagents", "openagents.org": "openagents",
// omp is oh-my-pi upstream (can1357/oh-my-pi); the domain is how it's advertised.
"oh-my-pi": "omp", ohmypi: "omp", "omp.sh": "omp",
};

/** Resolve a name/alias to `[key, engine]`, or null. */
Expand Down Expand Up @@ -533,6 +558,7 @@ const AI_EXEC = {
qwen: (p) => ["-p", p], // qwen prompt mode (gemini-derived)
deepseek: (p) => ["--headless", "-p", p], // deepseek: -p runs one prompt and exits; --headless drops the TUI so stdout is pipe-clean
mimocode: (p) => ["run", p], // mimocode one-shot (opencode-derived: `mimo run <message>`)
omp: (p) => ["-p", p], // omp print mode: process the prompt and exit
// openagents is absent on purpose: it answers no prompts itself, it starts
// the engines that do. ai() throws a named error rather than picking it.
};
Expand All @@ -556,7 +582,7 @@ export function aiExecArgs(engine, prompt) {
*/
export function pickAiEngine(preferred) {
const wanted = preferred ? resolveEngine(preferred)?.[0] : null;
const order = preferred ? (wanted ? [wanted] : []) : ["claude", "codex", "opencode", "privacycode", "gemini", "kimi", "qwen", "deepseek", "mimocode", "aider"];
const order = preferred ? (wanted ? [wanted] : []) : ["claude", "codex", "opencode", "privacycode", "gemini", "kimi", "qwen", "deepseek", "mimocode", "omp", "aider"];
for (const key of order) {
if (Object.hasOwn(ENGINES, key) && Object.hasOwn(AI_EXEC, key) && isInstalled(ENGINES[key].bin, ENGINES[key].binDirs)) return key;
}
Expand Down
2 changes: 2 additions & 0 deletions test/engines.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const EXPECTED_AGENT_ARGS = {
qwen: ["--approval-mode=yolo"],
deepseek: ["--turbo"],
mimocode: ["--dangerously-skip-permissions", "--trust"],
omp: ["--auto-approve"],
openagents: [], // a launcher, not an agent: nothing of its own to auto-approve
aider: ["--yes-always"],
};
Expand All @@ -53,6 +54,7 @@ const EXPECTED_LAUNCH_ARGS = {
qwen: ["--approval-mode=yolo"],
deepseek: ["--turbo"],
mimocode: ["--dangerously-skip-permissions", "--trust"], // no agents view — `mimo agent` prints and exits
omp: ["--auto-approve"], // no agents view — `omp agents` manages bundled agent files and exits
openagents: [], // bare launch opens the dashboard, which is its agent list
aider: ["--yes-always"],
};
Expand Down
Loading