diff --git a/packages/loopover-mcp/bin/loopover-mcp.js b/packages/loopover-mcp/bin/loopover-mcp.js index b52228ca43..6aff9ac112 100755 --- a/packages/loopover-mcp/bin/loopover-mcp.js +++ b/packages/loopover-mcp/bin/loopover-mcp.js @@ -2160,7 +2160,21 @@ async function issueSlopCli(args) { for (const finding of payload.findings ?? []) process.stdout.write(`- ${finding.title}: ${finding.detail}\n`); } +function printDecisionPackHelp() { + process.stdout.write( + [ + "Usage: loopover-mcp decision-pack --login [--json]", + "", + "Fetch the cached (or freshly built) contributor decision pack for a GitHub login.", + "Mirrors the loopover_get_decision_pack MCP tool and GET /v1/contributors/{login}/decision-pack. No source upload.", + "", + "Pass --json for machine-readable output.", + ].join("\n") + "\n", + ); +} + async function decisionPackCli(options) { + if (options.help === true) return printDecisionPackHelp(); const login = options.login ?? process.env.LOOPOVER_LOGIN ?? process.env.GITHUB_LOGIN; if (!login) throw new Error("Pass --login or set LOOPOVER_LOGIN."); const payload = await getDecisionPackWithCache(login); @@ -2173,7 +2187,21 @@ async function decisionPackCli(options) { if (payload.cache?.rerunGuidance) process.stdout.write(`Rerun when: ${payload.cache.rerunGuidance}\n`); } +function printRepoDecisionHelp() { + process.stdout.write( + [ + "Usage: loopover-mcp repo-decision --login --repo owner/repo [--json]", + "", + "Fetch the cached (or freshly built) repo decision for a GitHub login and repo.", + "Mirrors the loopover_explain_repo_decision MCP tool. No source upload.", + "", + "Pass --json for machine-readable output.", + ].join("\n") + "\n", + ); +} + async function repoDecisionCli(options) { + if (options.help === true) return printRepoDecisionHelp(); const login = options.login ?? process.env.LOOPOVER_LOGIN ?? process.env.GITHUB_LOGIN; if (!login) throw new Error("Pass --login or set LOOPOVER_LOGIN."); const repoFullName = options.repo; diff --git a/test/unit/mcp-cli-packets.test.ts b/test/unit/mcp-cli-packets.test.ts index 1b16a5bd1d..0840585ad5 100644 --- a/test/unit/mcp-cli-packets.test.ts +++ b/test/unit/mcp-cli-packets.test.ts @@ -73,6 +73,20 @@ describe("loopover-mcp CLI — packets", () => { }); }); + it("prints decision-pack help without requiring --login or making a network call", () => { + const help = run(["decision-pack", "--help"]); + expect(help).toMatch(/Usage: loopover-mcp decision-pack/); + expect(help).toMatch(/loopover_get_decision_pack/); + expect(help).toMatch(/contributor decision pack/); + }); + + it("prints repo-decision help without requiring --login/--repo or making a network call", () => { + const help = run(["repo-decision", "--help"]); + expect(help).toMatch(/Usage: loopover-mcp repo-decision/); + expect(help).toMatch(/loopover_explain_repo_decision/); + expect(help).toMatch(/repo decision/); + }); + it("ignores incompatible decision-pack cache entries and clears cache entries on request", async () => { tempDir = mkdtempSync(join(tmpdir(), "loopover-cli-")); const url = await startFixtureServer();