Skip to content

Commit 8bb9f31

Browse files
committed
Add the install rules wizard to the mcp install command
1 parent 08cd20a commit 8bb9f31

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

packages/cli-v3/src/commands/install-rules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export async function initiateRulesInstallWizard(options: InstallRulesWizardOpti
171171
writeConfigLastRulesInstallPromptVersion(manifest.currentVersion);
172172

173173
const installChoice = await confirm({
174-
message: "Would you like to install the Trigger.dev Agent rules?",
174+
message: "Would you like to install the Trigger.dev code agent rules?",
175175
initialValue: true,
176176
});
177177

packages/cli-v3/src/commands/mcp.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
33
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
44
import { VERSION } from "@trigger.dev/core";
55
import { tryCatch } from "@trigger.dev/core/utils";
6-
import { Command } from "commander";
6+
import { Command, Option as CommandOption } from "commander";
77
import { z } from "zod";
88
import { CommonCommandOptions, commonOptions, wrapCommandAction } from "../cli/common.js";
99
import { CLOUD_API_URL } from "../consts.js";
@@ -14,11 +14,14 @@ import { printStandloneInitialBanner } from "../utilities/initialBanner.js";
1414
import { logger } from "../utilities/logger.js";
1515
import { installMcpServer } from "./install-mcp.js";
1616
import { serverMetadata } from "../mcp/config.js";
17+
import { initiateRulesInstallWizard } from "./install-rules.js";
1718

1819
const McpCommandOptions = CommonCommandOptions.extend({
1920
projectRef: z.string().optional(),
2021
logFile: z.string().optional(),
2122
devOnly: z.boolean().default(false),
23+
rulesInstallManifestPath: z.string().optional(),
24+
rulesInstallBranch: z.string().optional(),
2225
});
2326

2427
export type McpCommandOptions = z.infer<typeof McpCommandOptions>;
@@ -34,6 +37,18 @@ export function configureMcpCommand(program: Command) {
3437
"Only run the MCP server for the dev environment. Attempts to access other environments will fail."
3538
)
3639
.option("--log-file <log file>", "The file to log to")
40+
.addOption(
41+
new CommandOption(
42+
"--rules-install-manifest-path <path>",
43+
"The path to the rules install manifest"
44+
).hideHelp()
45+
)
46+
.addOption(
47+
new CommandOption(
48+
"--rules-install-branch <branch>",
49+
"The branch to install the rules from"
50+
).hideHelp()
51+
)
3752
).action(async (options) => {
3853
wrapCommandAction("mcp", McpCommandOptions, options, async (opts) => {
3954
await mcpCommand(opts);
@@ -60,6 +75,11 @@ export async function mcpCommand(options: McpCommandOptions) {
6075
return;
6176
}
6277

78+
await initiateRulesInstallWizard({
79+
manifestPath: options.rulesInstallManifestPath,
80+
branch: options.rulesInstallBranch,
81+
});
82+
6383
return;
6484
}
6585

0 commit comments

Comments
 (0)