caelum0x 15c88e452b feat(ship): deploy from a Scribase project with its URL and anon key, link-scribase, and the deploy slot on the bridge (PY1.2)
Railyard side of PY1.2 (SC-E2, SP-F2). Acceptance:
1. packages/cli/src/scribase/env.mjs: in a Scribase project folder,
   `railyard deploy` reads the public URL and anon key `scribase init` wrote
   (.env, .env.local; NEXT_PUBLIC_/VITE_/EXPO_PUBLIC_/PUBLIC_ variants) into
   the build env and onto the Worker (--var), prints their names only, and
   leaves secrets out by name (service role key, SECRET/PASSWORD names, a
   service-role JWT under any name). `railyard link-scribase` reads a one-time
   claim from stdin (no flag takes it), exchanges it once and saves the token
   0600; nothing is printed.
2. A git branch with Scribase branch settings (.scribase/branches/<branch>.env,
   written by the PS2.0 hook) deploys its <app>-<branch> preview against that
   branch (fixture test).
3. Bridge: deploy slot landed; proof is the latest successful deploy; new
   route POST /api/v1/bridge/scribase/deploys lists the bound org's deploys for
   the Scribase Deploy tab (org isolation test). Contract cases added.
4. Real Cloudflare end-to-end stays owner-run (tests use the fake wrangler).

Tests: packages/cli 13/13, console bridge + deploys 15/15, tests/contract 3/3,
tsc clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:42:19 +03:00
..

railyard

Deploy a Next.js, Vite, Astro or static site to your own Cloudflare account with one command. Every git branch gets its own preview, every deploy is listed in your Railyard console, and a bad deploy is one command away from the version before it.

npx railyard login     # opens a code page; approve it in the browser
npx railyard deploy    # builds and deploys the folder you are in

What it does

  • Finds your framework: Next.js (built for Cloudflare Workers), Vite, Astro (static output) or a plain index.html. Anything else stops with one line that says what to change.
  • Uses Cloudflare's own login on your machine. The first deploy opens Cloudflare in your browser; Railyard never sees that login and never asks for a key.
  • Names the Worker after your app on main, and <app>-<branch> on any other branch, so each branch has its own URL.
  • Records each deploy in the console: URL, commit, branch, framework, how long it took and whether it worked.
  • railyard rollback puts the previous version of the same branch back live.

Commands

Command What it does
railyard login Signs this machine in to your Railyard org
railyard deploy [--app NAME] [--branch B] [--dir PATH] Builds and deploys
railyard rollback [--app NAME] [--branch B] Goes back one version
railyard deploys [--app NAME] Lists recent deploys

Your Railyard sign-in is saved in ~/.config/railyard/credentials.json, readable only by you. There is no option that takes a key or a token.

In a Scribase project

Run railyard deploy in a folder where Scribase wrote the app's env file. The project's URL and anon key (both public, they ship in the app) are set for the build and on the Worker, so nothing is pasted and neither is printed; only their names are shown. Anything secret in the same file, such as the service role key, is left out and named. A git branch with its own Scribase branch settings (.scribase/branches/<branch>.env) deploys its preview against that branch.

Where it runs

Deploys go to your own Cloudflare account. Railyard hosts nothing; it keeps the deploy history and the console.