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
2 changes: 2 additions & 0 deletions packages/loopover-mcp/bin/loopover-mcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,8 @@ async function runCli(args) {
const suggestion = suggestCommand(command);
throw new Error(`Unknown command: ${command}.${suggestion ? ` Did you mean \`${suggestion}\`?` : ""} Run \`loopover-mcp --help\` to list commands.`);
}
// Match every other subcommand: honor --help before requiring --login / hitting git+network (#6256).
if (options.help === true) return printHelp();
const contributorLogin = options.login ?? process.env.LOOPOVER_LOGIN ?? process.env.GITHUB_LOGIN;
if (!contributorLogin) throw new Error("Pass --login <github-login> or set LOOPOVER_LOGIN.");
const result = await analyzeCurrentBranch({
Expand Down
16 changes: 15 additions & 1 deletion test/unit/mcp-cli-analyze-branch.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import { rmSync } from "node:fs";
import { afterEach, describe, expect, it } from "vitest";
import { closeFixtureServer, createPacketRepo, localBranchAnalysisFixture, runAsync, startFixtureServer } from "./support/mcp-cli-harness";
import { closeFixtureServer, createPacketRepo, localBranchAnalysisFixture, run, runAsync, startFixtureServer } from "./support/mcp-cli-harness";

describe("loopover-mcp CLI — analyze-branch / preflight --help (#6256)", () => {
it("prints usage for analyze-branch --help without requiring --login or hitting git/network", () => {
const help = run(["analyze-branch", "--help"]);
expect(help).toMatch(/loopover-mcp analyze-branch/);
expect(help).toMatch(/--login <github-login>/);
});

it("prints usage for preflight --help without requiring --login or hitting git/network", () => {
const help = run(["preflight", "--help"]);
expect(help).toMatch(/loopover-mcp preflight/);
expect(help).toMatch(/--login <github-login>/);
});
});

describe("loopover-mcp CLI — analyze-branch --format table", () => {
let tempDir: string | null = null;
Expand Down