Skip to content

Commit df4d50e

Browse files
ralyodioclaude
andauthored
feat(engines): openagents — install the launcher from openagents.org (#386)
`/install openagents` (and `moshcode install openagents`) runs the vendor's own installer, `curl -fsSL https://openagents.org/install.sh | bash`. It is the first entry here that is not a coding agent: OpenAgents launches and supervises the engines around it, so it has no approvals to bypass and no yolo flag. A bare launch opens the dashboard, which is its agent list — `/agents openagents` and `start openagents` land in the same place — and it stays out of the ai() headless map because it answers no prompts itself. The installer unpacks to ~/.openagents/nodejs and only appends that to a shell rc, so binDirs bridges the session that just ran it, the same way kimi and opencode do. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 5891b79 commit df4d50e

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,13 @@ moshcode install codex # npm i -g @openai/codex
7979
moshcode install kimi # curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
8080
moshcode install qwen # npm i -g @qwen-code/qwen-code
8181
moshcode install deepseek # npm i -g @serjm/deepseek-code
82+
moshcode install openagents # curl -fsSL https://openagents.org/install.sh | bash
8283
```
8384

85+
`openagents` is the odd one out: a launcher that supervises the engines above
86+
rather than a coding agent itself. Its installer ends by offering to pair the
87+
machine with a workspace — press Enter to skip that.
88+
8489
### Autonomous agents versus raw starts
8590

8691
`agents` opens the engine's native **agent view** when it has one, so you land on
@@ -98,6 +103,7 @@ moshcode agents kimi # kimi --yolo
98103
moshcode agents qwen # qwen --approval-mode=yolo (autonomous)
99104
moshcode agents deepseek # deepseek-code --turbo (autonomous)
100105
moshcode agents aider # aider --yes-always (autonomous)
106+
moshcode agents openagents # openagents (dashboard)
101107
```
102108

103109
`start` is the explicit raw path. It injects nothing, so the native engine keeps

src/engines.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,38 @@ export const ENGINES = {
166166
agentArgs: ["--turbo"],
167167
install: { cmd: "npm", args: ["install", "-g", "@serjm/deepseek-code"] },
168168
},
169+
openagents: {
170+
desc: "OpenAgents — multi-agent launcher + dashboard (openagents.org)",
171+
// The package installs three identical bins — `agn`, `openagents`, and
172+
// `agent-connector`. Take the descriptive one: `agn` is short enough to
173+
// collide with something else on a machine we don't control.
174+
bin: "openagents",
175+
// Not a coding agent of its own: it launches and supervises the engines
176+
// above, so it has no approvals to bypass and no yolo flag to pass. A bare
177+
// launch opens the interactive dashboard, which IS its agent list, so both
178+
// `/agents openagents` and `moshcode start openagents` land in the same
179+
// place. (No `agentsView` for the same reason — it would spell the same
180+
// empty argv twice.)
181+
agentArgs: [],
182+
install: { cmd: "bash", args: ["-c", "curl -fsSL https://openagents.org/install.sh | bash"] },
183+
// Its own updater ("upgrade launcher to the latest npm release"), which
184+
// knows it was installed as an unpacked tarball under ~/.openagents rather
185+
// than by npm -g. Re-running the installer would work too, but it re-does
186+
// the Node bootstrap and ends on the pairing prompt below.
187+
upgrade: { cmd: "openagents", args: ["update"] },
188+
// The installer unpacks to ~/.openagents/nodejs and writes the bin shims
189+
// there, appending that directory to a shell rc — so PATH will not see
190+
// `openagents` until the next shell, including in the moshcode session that
191+
// just installed it.
192+
binDirs: [path.join(homedir(), ".openagents", "nodejs", "node_modules", ".bin")],
193+
// No `state`: the dashboard is a blessed TUI with no wording of its own we
194+
// have verified, and a guessed pattern is worse than the shared ones.
195+
//
196+
// The installer ends by offering to pair this device with a workspace, and
197+
// waits on a real answer — but only when stderr is a terminal, and Enter
198+
// skips it. `moshcode install` inherits the terminal, so that prompt is
199+
// yours to answer; run it where you can reach a keyboard.
200+
},
169201
aider: {
170202
desc: "Aider — pair-programming in your terminal",
171203
bin: "aider",
@@ -198,6 +230,9 @@ export const ENGINE_ALIASES = {
198230
// `dsc` and `deepseek-code` are the binary names the package installs; accept
199231
// both as engine names so whichever one someone has seen resolves.
200232
ds: "deepseek", dsc: "deepseek", "deepseek-code": "deepseek",
233+
// Same idea for openagents: `agn` and `agent-connector` are the other two
234+
// binary names its package installs, and the domain is how it's advertised.
235+
oa: "openagents", agn: "openagents", "agent-connector": "openagents", "openagents.org": "openagents",
201236
};
202237

203238
/** Resolve a name/alias to `[key, engine]`, or null. */
@@ -281,6 +316,8 @@ const AI_EXEC = {
281316
kimi: (p) => ["-p", p], // kimi prompt mode (prints the response, text by default)
282317
qwen: (p) => ["-p", p], // qwen prompt mode (gemini-derived)
283318
deepseek: (p) => ["--headless", "-p", p], // deepseek: -p runs one prompt and exits; --headless drops the TUI so stdout is pipe-clean
319+
// openagents is absent on purpose: it answers no prompts itself, it starts
320+
// the engines that do. ai() throws a named error rather than picking it.
284321
};
285322

286323
/** argv that runs `prompt` headlessly on `engine` (throws if it has no headless mode). */

test/engines.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const EXPECTED_AGENT_ARGS = {
2727
kimi: ["--yolo"],
2828
qwen: ["--approval-mode=yolo"],
2929
deepseek: ["--turbo"],
30+
openagents: [], // a launcher, not an agent: nothing of its own to auto-approve
3031
aider: ["--yes-always"],
3132
};
3233

@@ -43,6 +44,7 @@ const EXPECTED_LAUNCH_ARGS = {
4344
kimi: ["--yolo"], // no agents view — kimi has no agent list to land on
4445
qwen: ["--approval-mode=yolo"],
4546
deepseek: ["--turbo"],
47+
openagents: [], // bare launch opens the dashboard, which is its agent list
4648
aider: ["--yes-always"],
4749
};
4850

0 commit comments

Comments
 (0)