
Who
I run a lot of Next.js apps side by side. Shared http://localhost:3000 fights Clerk cookies, callback URLs, and allowedDevOrigins the second a second app boots.
For operators who need stable HTTPS origins per repo on a laptop without hand-writing a Caddyfile every time.
What
I built bundx-init, public https://github.com/michaelmonetized/bundx-init. Shell CLI. HEAD c8b59ad. 3 commits. 0 stars. No tagged release.
bin/bundx-init is 379 lines. install.sh curls it into ~/.local/bin (BUNDX_INIT_RAW_URL override). Target must be a Next project (package.json with next).
What it does (README + script):
- installs Caddy when possible (brew / apt Cloudsmith / dnf COPR / pacman)
- configures
~/.local/etc/Caddyfileto import~/.local/etc/caddy/dev-sites/*.caddy - writes a repo-scoped Caddy snippet
- adds
scripts/dev-localhost.mjs+dev-localhost-info.mjs - rewires
package.jsonsodevruns the HTTPS flow (dev:rawkeeps the old script;dev:infodumps JSON) - patches
next.config.*withallowedDevOrigins: ["<host>", "*.localhost"]when it can
Slug = basename lowercased. Host = <slug>.localhost. Port = 3300 + (hash(slug) % 5000). Fixture basic-next maps to port 6422; README my-next-app maps to 6996.

Next still binds an internal high port. Caddy owns :443 and reverse-proxies. Env: DEV_HOST, DEV_URL, PORT.

Fixture after init shows the patch contract: Next 16.2.1 / React 19.2.0, dev runs the localhost script, allowedDevOrigins for basic-next.localhost + *.localhost.

Where
Code: github.com/michaelmonetized/bundx-init, public. No live web app.
curl -fsSL https://raw.githubusercontent.com/michaelmonetized/bundx-init/main/install.sh | bash
bundx-init ~/Projects/my-next-app
cd ~/Projects/my-next-app && bun install && bun run dev
# https://my-next-app.localhost
When
2026-03-30. 3d4b752 Initialize bundx-init (589 insertions: CLI, install, README, fixture).
2026-06-22. f356360 nightly adds .uncap/config.json.
2026-06-22. c8b59ad nightly empty tip (HEAD).

Why
Parallel Next apps on one port break auth providers. Clerk and friends want real HTTPS origins in local. A hashed port, a Caddy snippet, and allowedDevOrigins is the boring fix; shipping it as a curl-install CLI beats copy-pasting the same five files forever.
Engagement Q: How many Next apps do you run locally before localhost:3000 starts lying to your auth provider?
