Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions bin/failproofai.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
* --install-policies Install hooks + enable policies in Claude Code settings
* --remove-policies Remove hooks or disable policies from Claude Code settings
* --list-policies List available policies and their status
* (default) Launch Next.js in dev mode
* --start Launch Next.js in production mode
* (default) Launch production dashboard
*/
import { version } from "../package.json";

Expand Down Expand Up @@ -90,7 +89,6 @@ if (args.includes("--list-policies")) {
process.exit(0);
}

// Dashboard launch — dev mode by default, --start for production
// Dashboard launch — always production mode
const { launch } = await import("../scripts/launch");
const mode = args.includes("--start") ? "start" : "dev";
launch(mode);
launch("start");
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
"bun": ">=1.3.0"
},
"scripts": {
"predev": "bun link",
"dev": "FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020",
"build": "bun --bun next build",
"prestart": "bun link",
"start": "FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",
"test": "vitest",
"test:run": "vitest run",
Expand Down
16 changes: 15 additions & 1 deletion scripts/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@ export function launch(mode: "dev" | "start"): void {

process.env.CLAUDE_PROJECTS_PATH = claudeProjectsPath;

const nextProcess = spawn("bunx", ["--bun", "next", mode, ...remainingArgs], {
let cmd: string;
let cmdArgs: string[];
if (mode === "start") {
const portIdx = remainingArgs.indexOf("--port");
const port = portIdx >= 0 ? remainingArgs[portIdx + 1] : "8020";
process.env.PORT = port;
process.env.HOSTNAME = "0.0.0.0";
cmd = "node";
cmdArgs = [".next/standalone/server.js"];
} else {
cmd = "bunx";
cmdArgs = ["--bun", "next", "dev", ...remainingArgs];
}

const nextProcess = spawn(cmd, cmdArgs, {
stdio: "inherit",
env: {
...process.env,
Expand Down