Any easy way to create a trubo.json file?

Like npm has an npm init which I can run in an existing project. Maybe turbo init?

cat > turbo.json <<‘JSON’
{
“$schema”: “https://turbo.build/schema.json”,
“pipeline”: {
“build”: {
“dependsOn”: [“^build”],
“outputs”: [“.next/", "dist/”]
},
“lint”: {},
“test”: {
“dependsOn”: [“^build”],
“outputs”:
},
“dev”: {
“cache”: false
}
}
}
JSON

echo “:white_check_mark: turbo.json created — ready for Turborepo!”

I could easily write a bash script for it, but that solution wouldn’t scale

Team Template or Repo Generator

If you want something reusable inside your org or team, set up your own starter repository that already contains:
• a turbo.json
• basic apps/ and packages/ folders
• shared config

Then new users just clone or degit it:

npx degit your-org/turbo-template my-new-project

:white_check_mark: Best for: multiple projects or teams that need the same setup.


Or

Custom CLI (tiny Node script)

You can build a one-liner Node CLI tool that:
• checks if turbo.json exists
• if not, writes a default one
• logs a success message

Example (scripts/init-turbo.js):

import fs from “fs”;

const defaultTurbo = {
$schema: “https://turbo.build/schema.json”,
pipeline: {
build: { dependsOn: [“^build”], outputs: [“.next/”, “dist/”] },
lint: {},
test: { dependsOn: [“^build”], outputs: },
dev: { cache: false }
}
};

fs.writeFileSync(“turbo.json”, JSON.stringify(defaultTurbo, null, 2));
console.log(“:white_check_mark: turbo.json created”);

Then you can run:

node scripts/init-turbo.js

or even make it global via npm.

:white_check_mark: Best for: internal dev tools or cross-OS consistency.