Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix(windows): `crbn` support

Sidwebworks689e3fd52aa3
diff --git a/README.md b/README.md
index 8763f299a9..92438875f1 100644
--- a/README.md
+++ b/README.md
@@ -181,6 +181,8 @@ The dev stack (Postgres, GoTrue, Kong, Storage, Inngest, Inbucket, Studio, Realt
- **Git worktrees** — every feature branch can live in its own checkout dir, so you can switch branches without stashing.
- **Per-worktree docker compose stack** — each worktree gets its own Postgres / Supabase services on dynamic ports, isolated under `carbon-<slug>` compose project. Routing is handled by [portless](https://github.com/portless-dev/portless) (a local HTTPS reverse proxy that serves `*.dev` hostnames on `:443` with locally-trusted certs — installed automatically on first `crbn up`).
+> **Windows users:** the dev CLI (`crbn`, `setup.sh`) is POSIX-only and expects **WSL or Git Bash**. Native cmd.exe / PowerShell shells are not supported. From a WSL/Git Bash prompt, the standard flow (`./setup.sh`, `pnpm dev`, `crbn checkout …`) works the same as on macOS/Linux.
+
Run `setup.sh` once to put `crbn` on your `$PATH` and install the `crbn` shell function (so `crbn checkout` can change cwd):
```bash
diff --git a/package.json b/package.json
index 98a323b2f2..180f004607 100755
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"db:seed:dev": "pnpm --filter @carbon/database db:seed:dev --",
"db:types": "tsx scripts/generate-db-types.ts",
"deploy": "turbo run deploy",
- "dev": "./packages/dev/bin/crbn up",
+ "dev": "crbn up",
"dev:academy": "turbo run dev --filter=./apps/academy --filter=./packages/",
"dev:packages": "turbo run dev --filter=./packages/*",
"dev:starter": "turbo run dev --filter=./apps/starter --filter=./packages/",
diff --git a/packages/dev/bin/crbn b/packages/dev/bin/crbn
index 8d06ba1cb2..0e12bf0c13 100755
--- a/packages/dev/bin/crbn
+++ b/packages/dev/bin/crbn
@@ -7,6 +7,18 @@
set -euo pipefail
+# crbn is POSIX-only. On Windows, supported environments are WSL (reports
+# `Linux` from uname) and Git Bash (reports `MINGW*`/`MSYS*`). Bail early
+# with an actionable message anywhere else so users don't hit cryptic
+# downstream failures.
+case "$(uname -s)" in
+ MINGW*|MSYS*|CYGWIN*|Linux*|Darwin*) ;;
+ *)
+ printf '\033[1;31m✗\033[0m crbn requires WSL or Git Bash on Windows (current: %s)\n' "$(uname -s)" >&2
+ exit 1
+ ;;
+esac
+
# ---------------------------------------------------------------------------
# Output helpers (colors when stderr is a TTY).
# All listings/errors go to stderr so they never get eval'd by the `crbn()`
diff --git a/setup.sh b/setup.sh
index 7f78bccb2b..b8c7863ac7 100755
--- a/setup.sh
+++ b/setup.sh
@@ -325,6 +325,14 @@ uninstall_proxy_daemon() {
}
install() {
+ case "$(uname -s)" in
+ MINGW*|MSYS*|CYGWIN*|Linux*|Darwin*) ;;
+ *)
+ fail "Unsupported environment: $(uname -s). crbn requires WSL or Git Bash on Windows; macOS/Linux otherwise."
+ exit 1
+ ;;
+ esac
+
local repo rc
repo="$(repo_root)"
rc="$(detect_rc)"