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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ Officially supported coding agents:
| [GitHub Copilot CLI](https://github.com/github/copilot-cli) | `copilot` | ✅ |
| [Kilo Code](https://kilocode.ai/) | `kilocode` | ✅ |
| [Kiro](https://kiro.dev/) | `kiro` | ✅ |
| [Muse Code][muse-code] | `muse` | 🚫 |
| [OpenCode](https://opencode.ai/) | `opencode` | 🚫 |
| [Pi](https://github.com/badlogic/pi-mono) | `pi` | 🚫 |
| [Replit](https://replit.com/) | `replit` | ✅ |
| [Rork](https://rork.com/) | `rork` | 🚫 |

[muse-code]: https://developer.meta.com/ai/products/muse-code/

Detection is data-driven: the exact environment variables and process
patterns for each agent live in [`src/agents.ts`](src/agents.ts).

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agent-cli-detector",
"version": "0.1.5",
"version": "0.1.6",
"description": "Detect whether a JavaScript CLI is running inside a coding agent.",
"type": "module",
"sideEffects": false,
Expand Down
5 changes: 5 additions & 0 deletions src/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ export const defaultAgents = [
process: [{ pattern: /kiro/i }],
sessionEnv: ["KIRO_SESSION_ID"]
},
{
id: "muse",
name: "Muse Code",
env: [{ name: "MUSE_RELEASE_INFO" }]
},
{
id: "cline",
name: "Cline",
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type AgentId =
| "kiro"
| "kilocode"
| "claude-code"
| "muse"
| "opencode"
| "pi"
| "replit"
Expand Down
17 changes: 17 additions & 0 deletions test/detector.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ test("detects rork from RORK_API_URL", () => {
});
});

test("detects Muse Code from MUSE_RELEASE_INFO", () => {
const result = detectAgent({
env: {
MUSE_RELEASE_INFO: JSON.stringify({
channel: "muse-stable",
version: "0.1.0-R708.1"
})
}
});

assert.equal(result.detected, true);
assert.deepEqual(result.agent, {
id: "muse",
name: "Muse Code"
});
});

test("detects bolt from any known environment variable", () => {
for (const envName of ["BOLT_ENV", "BOLT_ORIGIN", "BOLT_SERVER_URL"]) {
const result = detectAgent({
Expand Down
Loading