Skip to content

Commit d07913f

Browse files
committed
fix(cli): gate init AI hand-off on actual install, fix profile flag
The "let my AI set it up" hand-off was gated on what the user selected, not what installed, so a failed skills install still offered it and claimed the getting-started skill was ready. Gate it on actual installs and describe only the tooling that landed. Also fix an inverted profile flag in the next-steps message that printed `--profile undefined` when no profile was set.
1 parent 41f81d1 commit d07913f

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

  • packages/cli-v3/src/commands

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

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,21 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
173173

174174
const selectedTooling = isCancel(tooling) ? [] : tooling;
175175

176+
// Track what actually installed (not just what was selected), so the AI hand-off is
177+
// only offered, and only described, in terms of tooling that really landed.
178+
let installedSkills = false;
179+
let installedMcp = false;
180+
176181
// Skills are auth-free and bundled in the CLI. The user opted in here, so install
177182
// straight away (no extra confirm). If they declined, still mark the prompt seen so
178183
// `trigger dev` doesn't ask about skills a second time.
179184
if (selectedTooling.includes("skills")) {
180185
log.step("Installing the Trigger.dev agent skills");
181-
const [skillsError] = await tryCatch(installSkillsFromInit());
186+
const [skillsError, installed] = await tryCatch(installSkillsFromInit());
182187
if (skillsError) {
183188
log.warn(`Skipped agent skills: ${skillsError.message}`);
189+
} else {
190+
installedSkills = installed === true;
184191
}
185192
} else {
186193
await tryCatch(markSkillsPromptSeen());
@@ -202,12 +209,14 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
202209
outro(`Failed to install MCP server: ${installError.message}`);
203210
return;
204211
}
212+
213+
installedMcp = true;
205214
}
206215

207-
// Vibe path: once AI tooling is set up, the user can hand scaffolding to their
208-
// assistant (the getting-started skill + MCP) instead of the CLI. Only offered when
209-
// they installed something that can drive it.
210-
if (selectedTooling.length > 0) {
216+
// Vibe path: once AI tooling is actually installed, the user can hand scaffolding to
217+
// their assistant instead of the CLI. Only offered when something landed, and the
218+
// hand-off message names only the tooling that did.
219+
if (installedSkills || installedMcp) {
211220
const setupChoice = await select({
212221
message: "How do you want to set up your project?",
213222
options: [
@@ -219,14 +228,16 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
219228
{
220229
value: "ai",
221230
label: "Let my AI assistant set it up",
222-
hint: "use the getting-started skill and MCP server to bootstrap",
231+
hint: "hand off and let your assistant bootstrap the project",
223232
},
224233
],
225234
});
226235

227236
if (!isCancel(setupChoice) && setupChoice === "ai") {
228237
outro(
229-
"Your AI tooling is ready. Ask your assistant to set up Trigger.dev and it will use the getting-started skill to add the SDK, config, and your first task."
238+
installedSkills
239+
? "Your AI tooling is ready. Ask your assistant to set up Trigger.dev and it will use the getting-started skill to add the SDK, config, and your first task."
240+
: "The MCP server is installed. Ask your assistant to set up Trigger.dev using the MCP server."
230241
);
231242
return;
232243
}
@@ -334,7 +345,7 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
334345
log.info("Next steps:");
335346
log.info(
336347
` 1. To start developing, run ${chalk.green(
337-
`npx trigger.dev@${cliTag} dev${options.profile ? "" : ` --profile ${options.profile}`}`
348+
`npx trigger.dev@${cliTag} dev${options.profile ? ` --profile ${options.profile}` : ""}`
338349
)} in your project directory`
339350
);
340351
log.info(` 2. Visit your ${projectDashboard} to view your newly created tasks.`);

0 commit comments

Comments
 (0)