@nebulr-group/bridge-cli 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -118,45 +118,43 @@ The framework guide tells you precisely what must exist (bootstrap call, provide
118
118
 
119
119
  When you find missing pieces, list each one explicitly to the user — they need to know what's broken and why (e.g., "the signup verification email route is missing — every new signup is currently hitting a 404 after clicking the verification link").
120
120
 
121
- ## Step 2 — Present findings and confirm
121
+ ## Step 2 — Tell the developer the plan, ask only what you cannot detect
122
122
 
123
- Show the user what you found. Example:
123
+ **Talk to the developer in plain words, once, briefly.** Say what you are about to do. Ask only questions whose answer you could not find in the project. Do not recite what you detected (framework versions, package manager, the Bridge app's settings, enabled sign-in methods), show commands, or name configuration fields. That detail is for you; the developer did not ask for it.
124
124
 
125
- ```
126
- I detected the following projects:
125
+ - **One project:** integrate it. Do not ask which.
126
+ - **Several projects:** ask once which to integrate ("I found a SvelteKit app in `./web` and a NestJS API in `./api` — set up both?").
127
+ - **Existing auth** (nblocks or a third-party library): say so in one line and what will happen to it. This is the one thing about the current state worth mentioning.
127
128
 
128
- 1. ./my-app-ui — SvelteKit 5 (frontend, bun)
129
- Existing auth: @nebulr/nblocks-svelte (will migrate to Bridge)
129
+ **Sign-in (frontend projects only).** Sign-in happens inside the app (SDK mode): the plugin serves the login, signup and password pages on the app's own routes, inside its own layout, styled to match the app's existing design (Step 4). There is nothing to choose. (If the developer explicitly asks for Bridge's hosted sign-in page, or the app already uses it, respect that.)
130
130
 
131
- 2. ./my-app-api — NestJS 11 (backend, bun)
132
- No existing auth detected
131
+ Example — the whole message:
133
132
 
134
- Which projects should I integrate? (all / select by number)
135
133
  ```
134
+ I'll add sign-in to QR Studio: sign-in and sign-up pages inside the app, styled to
135
+ match it. Every page will need sign-in except those. I'll connect your Bridge app to
136
+ http://localhost:5180.
136
137
 
137
- Wait for confirmation before proceeding. If the user selects specific projects, only integrate those.
138
-
139
- **Sign-in (frontend projects only).** Sign-in happens inside the app (SDK mode): the plugin serves the login, signup and password pages on the app's own routes, inside its own layout, styled to match the app's existing design (Step 4). There is nothing to choose; tell the developer in one line, e.g. "Sign-in will be in your app, styled to match it." (If the developer explicitly asks for Bridge's hosted sign-in page, or the app already uses it, respect that.)
138
+ One question: should sign-in also work when you open the app over Tailscale? If so,
139
+ paste the full https://….ts.net:8445 address.
140
+ ```
140
141
 
141
- ## Step 3 — Get Bridge app context
142
+ With no question left to ask, say what you are doing and carry on; do not wait for a "yes".
142
143
 
143
- Run these commands to get the app configuration:
144
+ ## Step 3 — Read the Bridge app (for you, not the developer)
144
145
 
145
146
  ```bash
146
147
  bridge app get
147
148
  bridge info auth-config
148
149
  ```
149
150
 
150
- Extract and note:
151
- - `appId` — needed by both frontend and backend
152
- - Enabled auth methods (password, magic link, SSO providers, passkeys, MFA)
153
- - App URLs (apiUrl, uiUrl, callbackUrl)
151
+ Note the `appId` (frontend and backend both need it), the enabled sign-in methods and the app's URLs. Use them to decide what to change; do not report them. If the CLI is not available or not configured, ask the developer for the `appId`; it is in the Bridge dashboard.
154
152
 
155
- If `bridge` CLI is not available or not configured, ask the user for the `appId` directly. They can find it in the Bridge dashboard.
153
+ ## Step 3b — Point the Bridge app at the frontend
156
154
 
157
- ## Step 3b — Configure the Bridge app for the frontend
155
+ Take the frontend URL from the project: a port fixed in `vite.config.*`, `--port` in a dev script, the framework default otherwise. Ask only when it is genuinely unclear, or when the project also serves the app on another address (a tunnel, a LAN or Tailscale host, a second dev script) — then ask whether sign-in should work there too, and add each address they confirm.
158
156
 
159
- Detect the frontend URL from dev scripts in `package.json` (e.g., `--port 3000`, `--port 5173`). **Show the detected URL to the user and ask for confirmation before proceeding.** Then configure the Bridge app so it accepts OAuth callbacks and CORS requests from the frontend:
157
+ Then update the app. Change only what is missing; read the current values first, and pass the full list back for `--allowed-origins`, which replaces it:
160
158
 
161
159
  ```bash
162
160
  bridge app update \
@@ -166,9 +164,9 @@ bridge app update \
166
164
  --allowed-origins <frontend-url>
167
165
  ```
168
166
 
169
- `--ui-url` is also where links in Bridge's emails point. When your **backend** calls the Bridge API — inviting a user, triggering a password reset — the request carries no browser origin, so Bridge falls back to this URL to build the link. Leave it unset and those users land on a Bridge page instead of your app. The URL must also appear in `--allowed-origins`, or Bridge ignores it.
167
+ Why each matters (for you): without the callback in the redirect URIs Bridge rejects the sign-in redirect; without the origin it blocks the browser's requests. `--ui-url` is where links in Bridge's emails point when your backend sends them; unset, people land on a Bridge page instead of your app, and it must also be one of the allowed origins.
170
168
 
171
- Without this, the Bridge API will reject the OAuth redirect (invalid redirect_uri) and block CORS requests from the frontend (origin not allowed).
169
+ Tell the developer at most one line about this ("Connected your Bridge app to http://localhost:5180"), never the field names.
172
170
 
173
171
  ## Step 4 — Fetch and apply per-framework guides
174
172
 
@@ -101,13 +101,15 @@ From their answer, map everything to confirmation tables before creating anythin
101
101
 
102
102
  | plan | amount | currency | interval |
103
103
  |------|--------|----------|----------|
104
+ | `free` | 0 | USD | month |
104
105
  | `pro` | 29 | USD | month |
105
106
  | `pro` | 290 | USD | year |
106
107
 
107
108
  > **A single plan can carry both a monthly and a yearly price.** When the
108
109
  > developer gives two intervals for one tier (e.g. "$29/month or $290/year"),
109
110
  > that is **ONE plan with two prices** — never separate `pro-monthly` /
110
- > `pro-yearly` plans. A free plan simply has no price rows.
111
+ > `pro-yearly` plans. A free plan gets one price of 0: a plan with no price cannot
112
+ > be assigned to a workspace, and Bridge refuses to create one.
111
113
 
112
114
  **Quotas** (per-resource limits that differ between plans):
113
115
 
@@ -233,12 +235,14 @@ opts out** — it's the expected first-run experience.
233
235
  - The per-framework guide (Step 4) mounts the plugin's subscription pages, which include a
234
236
  default paywall page (on SvelteKit: `/subscription/plan`, served by the subscription
235
237
  catch-all). Confirm that part ran. Do **not** create a separate welcome page on your own.
236
- - The paywall applies once the app has plans; `paymentsAutoRedirect` (below) switches it.
238
+ - The paywall applies once the app has plans, and only while `paymentsAutoRedirect` is on.
237
239
  - A dedicated onboarding page such as `/welcome` is a product choice: **ask the developer**
238
240
  whether they want one. Only if they say yes, add it as the per-framework guide shows and
239
241
  point `billing.paywallRoute` at it.
240
- - The app-level flag `paymentsAutoRedirect` drives the redirect and is **`true` by
241
- default** — there is nothing to switch on.
242
+ - Read `paymentsAutoRedirect` (`bridge app get`). **On:** nothing to do. **Off:** tell the
243
+ developer in one line that new customers are not asked to pick a plan while it is off,
244
+ and turn it on only if they say so. Do not investigate why it is off: the developer may
245
+ have switched it off on purpose.
242
246
 
243
247
  If the developer does **not** want a forced paywall, disable it with one command:
244
248
 
@@ -41,7 +41,8 @@ Product questions. Ask, wait, never guess. Then show the answer back as tables (
41
41
  - **Reuse metric names the app already has** (`list_plan_quotas`) before inventing new ones. Reason: two names for one thing split the count.
42
42
  - **Connect Stripe with test keys first; live keys only when going live.** Reason: nobody is charged while you build. Use `setup_payments` / `bridge setup payments`: it stores the keys and switches payments on in one step.
43
43
  - **Connect Stripe before adding paid prices.** Reason: each price is created in Stripe as it is saved.
44
- - **Leave "customers must pick a plan" on** (it is on by default) unless the developer says otherwise. Reason: a new workspace then always has a plan, so every limit and feature check has something to read.
44
+ - **Leave "customers must pick a plan" on** (it is on by default) unless the developer says otherwise. Reason: a new workspace is then asked to choose a plan before it uses the app.
45
+ - **A workspace with no plan is normal.** It has none of the plan's features, and the plan-choice page or the app's own upgrade prompt shows it the plans. Never report it as a fault.
45
46
  - **One plan, one call:** `apply_plan` / `bridge plan apply` sets name, trial, prices and limits together. Reason: a plan is never left half set up.
46
47
 
47
48
  ## How a hard limit is enforced, end to end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebulr-group/bridge-cli",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "The Bridge CLI: set up and manage sign-in, roles, plans, feature flags and API tokens from your terminal or AI coding agent.",
5
5
  "author": "Nebulr Group",
6
6
  "license": "MIT",