@scopevibe/cli
v0.1.2
Published
Scope CLI — expose a local dev server to Scope's multiplayer canvas via a Cloudflare Tunnel (plus a few monorepo-only helpers for the build pipeline).
Maintainers
Readme
@scopevibe/cli
Share your local dev server with the Scope canvas. Opens a Cloudflare quick tunnel so your teammates can point their canvas at your localhost — no deploy required, no account setup on Cloudflare's side.
npx @scopevibe/cli share▶ Your app is live at https://inventive-llama.trycloudflare.com
▶ Open https://scope-canvas.pages.dev/?addUrl=https%3A%2F%2Finventive-llama.trycloudflare.com
to drop it on a canvas
Press Ctrl-C to stop the tunnel.Your teammate clicks that canvas link; their frame shows your
localhost:3000; every navigation you make flows through the
@scopevibe/bridge
into their canvas in real time.
Install
No install needed — always use npx for the latest:
npx @scopevibe/cli shareOr install globally if you use it often:
npm install -g @scopevibe/cli
scope shareFirst run downloads the cloudflared binary (~30 MB) once, then caches.
Prerequisites
- Your app already has
@scopevibe/bridgeinstalled. The CLI will warn on launch if it can't find it in yourpackage.json. - Your dev server (or a prebuilt static folder) is reachable locally.
scope share
scope share [--port <n>] [--host <h>] [--path <p>] [--static <dir>] [--json]Options
| Flag | Default | What it does |
|---|---|---|
| --port <n> | 3000 | Local port to tunnel. Ignored with --static. |
| --host <h> | localhost | Local host to tunnel. |
| --path <p> | / | URL path to hand off to the canvas as the starting route — use /foo if your dev server serves from a subpath. |
| --static <dir> | — | Serve a prebuilt directory (e.g. Next.js out/, Vite dist/) on an ephemeral local port and tunnel to that. SPA routing works — unknown paths fall back to index.html. |
| --json | false | Emit { tunnelUrl, canvasUrl, port } as a single line on stdout for scripting; suppress the banner. |
Examples
Next.js dev server on 3000:
npm run dev # in one terminal
npx @scopevibe/cli shareVite dev server on 5173:
npm run dev
npx @scopevibe/cli share --port 5173Prebuilt Next.js static export:
npm run build
npx @scopevibe/cli share --static ./outScripting (capture the URL into another tool):
URL=$(npx @scopevibe/cli share --json | jq -r .tunnelUrl)
echo "Running against $URL"How it works
The CLI spawns cloudflared tunnel --url http://<host>:<port>, parses
the https://<slug>.trycloudflare.com URL out of cloudflared's
startup banner, and prints it. With --static, a tiny local HTTP
server (Node's built-in http.createServer, bound to 127.0.0.1) is
started on an ephemeral port first and the tunnel is pointed at it.
Ctrl-C tears down the tunnel and the static server (if any) cleanly.
Monorepo-only commands
The detect, prepare, deploy, and import subcommands are
historical and only work from inside the Scope monorepo checkout
(they rely on a sibling packages/bridge/dist/ folder). Don't rely
on them via npx.
License
MIT — see LICENSE.
