@@ -21,6 +21,7 @@ import { confirm, isCancel, log } from "@clack/prompts";
2121import { installMcpServer } from "./install-mcp.js" ;
2222import { tryCatch } from "@trigger.dev/core/utils" ;
2323import { VERSION } from "@trigger.dev/core" ;
24+ import { initiateRulesInstallWizard } from "./install-rules.js" ;
2425
2526const DevCommandOptions = CommonCommandOptions . extend ( {
2627 debugOtel : z . boolean ( ) . default ( false ) ,
@@ -34,6 +35,10 @@ const DevCommandOptions = CommonCommandOptions.extend({
3435 mcpPort : z . coerce . number ( ) . optional ( ) . default ( 3333 ) ,
3536 analyze : z . boolean ( ) . default ( false ) ,
3637 disableWarnings : z . boolean ( ) . default ( false ) ,
38+ skipMCPInstall : z . boolean ( ) . default ( false ) ,
39+ skipRulesInstall : z . boolean ( ) . default ( false ) ,
40+ rulesInstallManifestPath : z . string ( ) . optional ( ) ,
41+ rulesInstallBranch : z . string ( ) . optional ( ) ,
3742} ) ;
3843
3944export type DevCommandOptions = z . infer < typeof DevCommandOptions > ;
@@ -67,6 +72,30 @@ export function configureDevCommand(program: Command) {
6772 . addOption (
6873 new CommandOption ( "--analyze" , "Analyze the build output and import timings" ) . hideHelp ( )
6974 )
75+ . addOption (
76+ new CommandOption (
77+ "--skip-mcp-install" ,
78+ "Skip the Trigger.dev MCP server install wizard"
79+ ) . hideHelp ( )
80+ )
81+ . addOption (
82+ new CommandOption (
83+ "--skip-rules-install" ,
84+ "Skip the Trigger.dev Agent rules install wizard"
85+ ) . hideHelp ( )
86+ )
87+ . addOption (
88+ new CommandOption (
89+ "--rules-install-manifest-path <path>" ,
90+ "The path to the rules install manifest"
91+ ) . hideHelp ( )
92+ )
93+ . addOption (
94+ new CommandOption (
95+ "--rules-install-branch <branch>" ,
96+ "The branch to install the rules from"
97+ ) . hideHelp ( )
98+ )
7099 . addOption ( new CommandOption ( "--disable-warnings" , "Suppress warnings output" ) . hideHelp ( ) )
71100 ) . action ( async ( options ) => {
72101 wrapCommandAction ( "dev" , DevCommandOptions , options , async ( opts ) => {
@@ -78,35 +107,49 @@ export function configureDevCommand(program: Command) {
78107export async function devCommand ( options : DevCommandOptions ) {
79108 runtimeChecks ( ) ;
80109
81- const hasSeenMCPInstallPrompt = readConfigHasSeenMCPInstallPrompt ( ) ;
110+ const skipMCPInstall = typeof options . skipMCPInstall === "boolean" && options . skipMCPInstall ;
82111
83- if ( ! hasSeenMCPInstallPrompt ) {
84- const installChoice = await confirm ( {
85- message : "Would you like to install the Trigger.dev MCP server?" ,
86- initialValue : true ,
87- } ) ;
112+ if ( ! skipMCPInstall ) {
113+ const hasSeenMCPInstallPrompt = readConfigHasSeenMCPInstallPrompt ( ) ;
88114
89- writeConfigHasSeenMCPInstallPrompt ( true ) ;
115+ if ( ! hasSeenMCPInstallPrompt ) {
116+ const installChoice = await confirm ( {
117+ message : "Would you like to install the Trigger.dev MCP server?" ,
118+ initialValue : true ,
119+ } ) ;
90120
91- const skipInstall = isCancel ( installChoice ) || ! installChoice ;
121+ writeConfigHasSeenMCPInstallPrompt ( true ) ;
92122
93- if ( ! skipInstall ) {
94- log . step ( "Welcome to the Trigger.dev MCP server install wizard 🧙" ) ;
123+ const skipInstall = isCancel ( installChoice ) || ! installChoice ;
95124
96- const [ installError ] = await tryCatch (
97- installMcpServer ( {
98- yolo : false ,
99- tag : VERSION as string ,
100- logLevel : options . logLevel ,
101- } )
102- ) ;
125+ if ( ! skipInstall ) {
126+ log . step ( "Welcome to the Trigger.dev MCP server install wizard 🧙" ) ;
103127
104- if ( installError ) {
105- log . error ( `Failed to install MCP server: ${ installError . message } ` ) ;
128+ const [ installError ] = await tryCatch (
129+ installMcpServer ( {
130+ yolo : false ,
131+ tag : VERSION as string ,
132+ logLevel : options . logLevel ,
133+ } )
134+ ) ;
135+
136+ if ( installError ) {
137+ log . error ( `Failed to install MCP server: ${ installError . message } ` ) ;
138+ }
106139 }
107140 }
108141 }
109142
143+ const skipRulesInstall =
144+ typeof options . skipRulesInstall === "boolean" && options . skipRulesInstall ;
145+
146+ if ( ! skipRulesInstall ) {
147+ await initiateRulesInstallWizard ( {
148+ manifestPath : options . rulesInstallManifestPath ,
149+ branch : options . rulesInstallBranch ,
150+ } ) ;
151+ }
152+
110153 const authorization = await login ( {
111154 embedded : true ,
112155 silent : true ,
0 commit comments