Skip to content

Commit 463190d

Browse files
committed
Add --runtime option to the init CLI command
1 parent a5f2d3b commit 463190d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.changeset/ninety-countries-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Add --runtime option to the init CLI command

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const InitCommandOptions = CommonCommandOptions.extend({
3939
overrideConfig: z.boolean().default(false),
4040
tag: z.string().default("beta"),
4141
skipPackageInstall: z.boolean().default(false),
42+
runtime: z.string().default("node"),
4243
pkgArgs: z.string().optional(),
4344
gitRef: z.string().default("main"),
4445
javascript: z.boolean().default(false),
@@ -62,6 +63,11 @@ export function configureInitCommand(program: Command) {
6263
"The version of the @trigger.dev/sdk package to install",
6364
"beta"
6465
)
66+
.option(
67+
"-r, --runtime <runtime>",
68+
"Which runtime to use for the project. Currently only supports node and bun",
69+
"node"
70+
)
6571
.option("--skip-package-install", "Skip installing the @trigger.dev/sdk package")
6672
.option("--override-config", "Override the existing config file if it exists")
6773
.option(
@@ -490,12 +496,14 @@ async function writeConfigFile(
490496
"cli.projectDir": projectDir,
491497
"cli.templatePath": templateUrl,
492498
"cli.outputPath": outputPath,
499+
"cli.runtime": options.runtime,
493500
});
494501

495502
const result = await createFileFromTemplate({
496503
templateUrl,
497504
replacements: {
498505
projectRef: project.externalRef,
506+
runtime: options.runtime,
499507
triggerDirectoriesOption: triggerDir.isCustomValue
500508
? `\n dirs: ["${triggerDir.location}"],`
501509
: `\n dirs: ["/src/trigger"],`,

0 commit comments

Comments
 (0)