Skip to content

Commit d059d7d

Browse files
feat(cli): update ruler addon with more mcp
1 parent 2f9eb1f commit d059d7d

File tree

7 files changed

+174
-153
lines changed

7 files changed

+174
-153
lines changed

apps/cli/package.json

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
{
2-
"name": "create-better-t-stack",
3-
"version": "2.41.3",
4-
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5-
"type": "module",
6-
"license": "MIT",
7-
"author": "Aman Varshney",
8-
"bin": {
9-
"create-better-t-stack": "dist/cli.js"
10-
},
11-
"files": [
12-
"templates",
13-
"dist"
14-
],
15-
"keywords": [
16-
"better-t-stack",
17-
"typescript",
18-
"boilerplate",
19-
"starter",
20-
"cli",
21-
"turborepo",
22-
"trpc",
23-
"better-auth",
24-
"monorepo",
25-
"fullstack",
26-
"type-safety",
27-
"react",
28-
"react-native",
29-
"expo",
30-
"hono",
31-
"elysia",
32-
"drizzle",
33-
"prisma",
34-
"tanstack",
35-
"tailwind",
36-
"shadcn",
37-
"pwa",
38-
"tauri",
39-
"biome"
40-
],
41-
"repository": {
42-
"type": "git",
43-
"url": "git+https://github.com/AmanVarshney01/create-better-t-stack.git",
44-
"directory": "apps/cli"
45-
},
46-
"publishConfig": {
47-
"access": "public"
48-
},
49-
"homepage": "https://better-t-stack.dev/",
50-
"scripts": {
51-
"build": "tsdown",
52-
"dev": "tsdown --watch",
53-
"check-types": "tsc --noEmit",
54-
"check": "biome check --write .",
55-
"test": "bun run build && vitest run",
56-
"test:ui": "bun run build && vitest --ui",
57-
"test:with-build": "bun run build && WITH_BUILD=1 vitest --ui",
58-
"prepublishOnly": "npm run build"
59-
},
60-
"exports": {
61-
".": {
62-
"types": "./dist/index.d.ts",
63-
"import": "./dist/index.js"
64-
}
65-
},
66-
"dependencies": {
67-
"@clack/prompts": "^1.0.0-alpha.4",
68-
"consola": "^3.4.2",
69-
"execa": "^9.6.0",
70-
"fs-extra": "^11.3.1",
71-
"gradient-string": "^3.0.0",
72-
"handlebars": "^4.7.8",
73-
"jsonc-parser": "^3.3.1",
74-
"picocolors": "^1.1.1",
75-
"tinyglobby": "^0.2.15",
76-
"trpc-cli": "^0.10.2",
77-
"ts-morph": "^27.0.0",
78-
"zod": "^4.1.5"
79-
},
80-
"devDependencies": {
81-
"@types/fs-extra": "^11.0.4",
82-
"@types/node": "^24.3.1",
83-
"@vitest/ui": "^3.2.4",
84-
"tsdown": "^0.14.2",
85-
"typescript": "^5.9.2",
86-
"vitest": "^3.2.4"
87-
}
2+
"name": "create-better-t-stack",
3+
"version": "2.41.3",
4+
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5+
"type": "module",
6+
"license": "MIT",
7+
"author": "Aman Varshney",
8+
"bin": {
9+
"create-better-t-stack": "dist/cli.js"
10+
},
11+
"files": [
12+
"templates",
13+
"dist"
14+
],
15+
"keywords": [
16+
"better-t-stack",
17+
"typescript",
18+
"boilerplate",
19+
"starter",
20+
"cli",
21+
"turborepo",
22+
"trpc",
23+
"better-auth",
24+
"monorepo",
25+
"fullstack",
26+
"type-safety",
27+
"react",
28+
"react-native",
29+
"expo",
30+
"hono",
31+
"elysia",
32+
"drizzle",
33+
"prisma",
34+
"tanstack",
35+
"tailwind",
36+
"shadcn",
37+
"pwa",
38+
"tauri",
39+
"biome"
40+
],
41+
"repository": {
42+
"type": "git",
43+
"url": "git+https://github.com/AmanVarshney01/create-better-t-stack.git",
44+
"directory": "apps/cli"
45+
},
46+
"publishConfig": {
47+
"access": "public"
48+
},
49+
"homepage": "https://better-t-stack.dev/",
50+
"scripts": {
51+
"build": "tsdown",
52+
"dev": "tsdown --watch",
53+
"check-types": "tsc --noEmit",
54+
"check": "biome check --write .",
55+
"test": "bun run build && vitest run",
56+
"test:ui": "bun run build && vitest --ui",
57+
"test:with-build": "bun run build && WITH_BUILD=1 vitest --ui",
58+
"prepublishOnly": "npm run build"
59+
},
60+
"exports": {
61+
".": {
62+
"types": "./dist/index.d.ts",
63+
"import": "./dist/index.js"
64+
}
65+
},
66+
"dependencies": {
67+
"@clack/prompts": "^1.0.0-alpha.4",
68+
"consola": "^3.4.2",
69+
"execa": "^9.6.0",
70+
"fs-extra": "^11.3.1",
71+
"gradient-string": "^3.0.0",
72+
"handlebars": "^4.7.8",
73+
"jsonc-parser": "^3.3.1",
74+
"picocolors": "^1.1.1",
75+
"tinyglobby": "^0.2.15",
76+
"trpc-cli": "^0.10.2",
77+
"ts-morph": "^27.0.0",
78+
"zod": "^4.1.5"
79+
},
80+
"devDependencies": {
81+
"@types/fs-extra": "^11.0.4",
82+
"@types/node": "^24.3.1",
83+
"@vitest/ui": "^3.2.4",
84+
"tsdown": "^0.14.2",
85+
"typescript": "^5.9.2",
86+
"vitest": "^3.2.4"
87+
}
8888
}

apps/cli/src/helpers/addons/addons-setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { Frontend, PackageManager, ProjectConfig } from "../../types";
77
import { addPackageDependency } from "../../utils/add-package-deps";
88
import { getPackageExecutionCommand } from "../../utils/package-runner";
99
import { setupFumadocs } from "./fumadocs-setup";
10-
import { setupVibeRules } from "./ruler-setup";
10+
import { setupRuler } from "./ruler-setup";
1111
import { setupStarlight } from "./starlight-setup";
1212
import { setupTauri } from "./tauri-setup";
1313
import { setupUltracite } from "./ultracite-setup";
@@ -88,7 +88,7 @@ ${pc.cyan("Docs:")} ${pc.underline("https://turborepo.com/docs")}
8888
}
8989

9090
if (addons.includes("ruler")) {
91-
await setupVibeRules(config);
91+
await setupRuler(config);
9292
}
9393
if (addons.includes("fumadocs")) {
9494
await setupFumadocs(config);

apps/cli/src/helpers/addons/ruler-setup.ts

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,54 @@ import {
88
import { execa } from "execa";
99
import fs from "fs-extra";
1010
import pc from "picocolors";
11-
import { PKG_ROOT } from "../../constants";
1211
import type { ProjectConfig } from "../../types";
1312
import { exitCancelled } from "../../utils/errors";
1413
import { getPackageExecutionCommand } from "../../utils/package-runner";
15-
import { processAndCopyFiles } from "../core/template-manager";
1614

17-
export async function setupVibeRules(config: ProjectConfig) {
15+
export async function setupRuler(config: ProjectConfig) {
1816
const { packageManager, projectDir } = config;
1917

2018
try {
2119
log.info("Setting up Ruler...");
2220

2321
const rulerDir = path.join(projectDir, ".ruler");
24-
const rulerTemplateDir = path.join(
25-
PKG_ROOT,
26-
"templates",
27-
"addons",
28-
"ruler",
29-
".ruler",
30-
);
3122

3223
if (!(await fs.pathExists(rulerDir))) {
33-
if (await fs.pathExists(rulerTemplateDir)) {
34-
await processAndCopyFiles("**/*", rulerTemplateDir, rulerDir, config);
35-
} else {
36-
log.error(pc.red("Ruler template directory not found"));
37-
return;
38-
}
24+
log.error(
25+
pc.red(
26+
"Ruler template directory not found. Please ensure ruler addon is properly installed.",
27+
),
28+
);
29+
return;
3930
}
4031

4132
const EDITORS = {
42-
cursor: {
43-
label: "Cursor",
44-
},
45-
windsurf: {
46-
label: "Windsurf",
47-
},
33+
amp: { label: "AMP" },
34+
copilot: { label: "GitHub Copilot" },
4835
claude: { label: "Claude Code" },
49-
copilot: {
50-
label: "GitHub Copilot",
51-
},
52-
"gemini-cli": { label: "Gemini CLI" },
5336
codex: { label: "OpenAI Codex CLI" },
54-
jules: { label: "Jules" },
37+
cursor: { label: "Cursor" },
38+
windsurf: { label: "Windsurf" },
5539
cline: { label: "Cline" },
5640
aider: { label: "Aider" },
5741
firebase: { label: "Firebase Studio" },
58-
openhands: { label: "Open Hands" },
42+
"gemini-cli": { label: "Gemini CLI" },
5943
junie: { label: "Junie" },
60-
augmentcode: {
61-
label: "AugmentCode",
62-
},
63-
kilocode: {
64-
label: "Kilo Code",
65-
},
44+
kilocode: { label: "Kilo Code" },
6645
opencode: { label: "OpenCode" },
46+
crush: { label: "Crush" },
47+
zed: { label: "Zed" },
48+
qwen: { label: "Qwen" },
6749
} as const;
6850

69-
const selectedEditors = await autocompleteMultiselect<keyof typeof EDITORS>(
70-
{
71-
message: "Select AI assistants for Ruler",
72-
options: Object.entries(EDITORS).map(([key, v]) => ({
73-
value: key as keyof typeof EDITORS,
74-
label: v.label,
75-
})),
76-
required: false,
77-
},
78-
);
51+
const selectedEditors = await autocompleteMultiselect({
52+
message: "Select AI assistants for Ruler",
53+
options: Object.entries(EDITORS).map(([key, v]) => ({
54+
value: key,
55+
label: v.label,
56+
})),
57+
required: false,
58+
});
7959

8060
if (isCancel(selectedEditors)) return exitCancelled("Operation cancelled");
8161

apps/cli/src/helpers/core/template-manager.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,6 @@ export async function setupAddonsTemplate(
620620
for (const addon of context.addons) {
621621
if (addon === "none") continue;
622622

623-
if (addon === "ruler") continue;
624-
625623
let addonSrcDir = path.join(PKG_ROOT, `templates/addons/${addon}`);
626624
let addonDestDir = projectDir;
627625

apps/cli/templates/addons/ruler/.ruler/mcp.json.hbs

Lines changed: 0 additions & 18 deletions
This file was deleted.

apps/cli/templates/addons/ruler/.ruler/ruler.toml.hbs

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,63 @@
22
# See https://okigu.com/ruler for documentation.
33

44
# Default agents to run when --agents is not specified
5-
default_agents = []
5+
default_agents = []
6+
7+
# --- Global MCP Server Configuration ---
8+
[mcp]
9+
# Enable/disable MCP propagation globally (default: true)
10+
enabled = true
11+
# Global merge strategy: 'merge' or 'overwrite' (default: 'merge')
12+
merge_strategy = "merge"
13+
14+
# --- MCP Server Definitions ---
15+
[mcp_servers.context7]
16+
command = "npx"
17+
args = ["-y", "@upstash/context7-mcp"]
18+
19+
{{#if (or (eq runtime "workers") (eq webDeploy "wrangler"))}}
20+
[mcp_servers.cloudflare]
21+
command = "npx"
22+
args = ["mcp-remote", "https://docs.mcp.cloudflare.com/sse"]
23+
{{/if}}
24+
25+
{{#if (eq backend "convex")}}
26+
[mcp_servers.convex]
27+
command = "npx"
28+
args = ["-y", "convex@latest", "mcp", "start"]
29+
{{/if}}
30+
31+
{{#if (or (includes frontend "tanstack-router") (includes frontend "react-router") (includes frontend "tanstack-start") (includes frontend "next"))}}
32+
[mcp_servers.shadcn]
33+
command = "npx"
34+
args = ["shadcn@latest", "mcp"]
35+
{{/if}}
36+
37+
{{#if (eq dbSetup "planetscale")}}
38+
[mcp_servers.planetscale]
39+
command = "pscale"
40+
args = ["mcp", "server"]
41+
{{/if}}
42+
43+
{{#if (eq dbSetup "prisma-postgres")}}
44+
[mcp_servers.prisma]
45+
command = "npx"
46+
args = ["-y", "prisma", "mcp"]
47+
{{/if}}
48+
49+
{{#if (eq dbSetup "neon")}}
50+
[mcp_servers.neon]
51+
command = "npx"
52+
args = ["-y", "mcp-remote@latest", "https://mcp.neon.tech/mcp"]
53+
{{/if}}
54+
55+
{{#if (eq dbSetup "mongodb-atlas")}}
56+
[mcp_servers.mongodb]
57+
command = "npx"
58+
args = ["-y", "mongodb-mcp-server", "--connectionString", "mongodb://localhost:27017/myDatabase", "--readOnly"]
59+
{{/if}}
60+
61+
# --- Global .gitignore Configuration ---
62+
[gitignore]
63+
# Enable/disable automatic .gitignore updates (default: true)
64+
enabled = true

apps/cli/templates/backend/server/server-base/_gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ dist/
1919
.alchemy
2020
/.next/
2121
.vercel
22+
prisma/generated/
23+
2224

2325
# deps
2426
node_modules/

0 commit comments

Comments
 (0)