@vibecloudtr/cli 0.0.0-stage → 0.0.1

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.
package/ENVIRONMENT.md ADDED
@@ -0,0 +1,529 @@
1
+ # Environment variables — `cli/`
2
+
3
+ Configuration is injected by the environment; there are no dotenv files
4
+ (CLAUDE.md §4.2). Split out of `base/` on 2026-08-11 with the code it configures.
5
+
6
+ `cmd/mcp` left this repo on 2026-08-14 (commit `f86568e`); its variables — none,
7
+ the server is stateless — are documented in `../mcp`.
8
+
9
+ `vibe migrate vercel` (#74) reads no variables of its own. It takes the
10
+ project directory, the app name and the project id as flags: `--project` becomes
11
+ `App.spec.projectRef.name`, which is immutable, so it is deliberately NOT
12
+ defaulted from `VIBECLOUD_ORG`.
13
+
14
+ ## VIBECLOUD_API
15
+
16
+ - Type: string (URL, **full path included**)
17
+ - Required: no
18
+ - Default: `https://api.vibecloud.tr/query`
19
+ - Consuming module: `src/cli/config.ts`, `src/cli/client/`
20
+
21
+ Control-plane GraphQL endpoint the `vibe` CLI talks to. Override to point the CLI
22
+ at a local slice (`https://127.0.0.1:8443/query`) or at the local cell.
23
+
24
+ ⚠ **NOT "or staging" — there is no staging and there will not be one** (dec. 186,
25
+ 2026-09-08: the environments are local and production, and the 5-VM dev cell on
26
+ the build box is the real-cell testbed per `gitops-and-environments.md` §4). This
27
+ line said staging, which is the kind of aside that sends a release operator
28
+ looking for an environment to point at.
29
+
30
+ 🔴 **Validated at boot, and `http://` is REFUSED** (added 2026-08-15). Every
31
+ command sends `Authorization: Bearer <token>` to this address, so a cleartext
32
+ value put the credential on the wire on the first call — and, because the OAuth
33
+ discovery document is fetched from this origin, let a network attacker choose the
34
+ `token_endpoint` the authorization code and the refresh token were posted to.
35
+ The one exception is **literal loopback** — `http://127.0.0.1` and `http://[::1]`,
36
+ which do not reach a network — so a plain-http dev API still works.
37
+ `http://localhost` is **not** in the exception: it goes through name resolution,
38
+ which is the thing an attacker on the path controls. Same line
39
+ `oauth.Server.ValidateRedirectURI` draws, for the same reason.
40
+
41
+ 🔴 **CORRECTED 2026-08-14: the default said `/graphql`, which the API does not
42
+ serve.** `api/internal/server/server.go` mounts the gqlgen handler on
43
+ `mux.Handle("/query", h)` and mounts nothing on `/graphql`; the web console posts
44
+ to `${API_URL}/query` as well. This entry's own override example already said
45
+ `/query`, so the default and the example contradicted each other.
46
+
47
+ ⚠ The failure mode was worse than a 404, which is why it survived: in dev the
48
+ playground is registered on `"/"` and net/http's mux makes that the catch-all, so
49
+ `POST /graphql` returns **HTTP 200 with a page of HTML**. The CLI's error path
50
+ only inspects statuses ≥ 400, so it reported that it could not parse the response
51
+ rather than that the URL was wrong. Verified against the live API on 2026-08-14.
52
+
53
+ The value is the WHOLE URL, path included — the CLI appends nothing to it.
54
+
55
+ ## VIBECLOUD_MCP
56
+
57
+ - Type: string (URL)
58
+ - Required: no
59
+ - Default: `https://mcp.vibecloud.tr/mcp`
60
+ - Consuming module: `src/cli/config.ts`, `src/cli/commands/mcp.ts`
61
+
62
+ The MCP server's Streamable HTTP endpoint. `vibe mcp install` writes this value
63
+ into an editor's MCP configuration file. Override it to register a local slice
64
+ instead of production.
65
+
66
+ ⚠ **There is no staging deployment to register** (dec. 186).
67
+
68
+ 🔴 **THE CLI NEVER CONNECTS TO THIS ADDRESS**, and that is the whole reason the
69
+ variable needs its own note rather than a row in a table. Every other endpoint
70
+ here fails loudly in the command that used it; this one is written to a file and
71
+ sits there, and the failure surfaces later, in a different program, as tools that
72
+ silently never appear. `vibe mcp install` therefore prints the URL it wrote on
73
+ every run — including when it changed nothing — because that string is the only
74
+ evidence this command can honestly offer.
75
+
76
+ 🔴 **Validated at boot, and `http://` is REFUSED**, on the same grounds as
77
+ `VIBECLOUD_API` and one step more sharply. The CLI is not the party that will
78
+ send credentials here: the EDITOR is, bearing an OAuth token, on a machine this
79
+ command may never touch again. A cleartext value written into a config file is a
80
+ decision with a long tail, so it is refused at the point of writing rather than
81
+ at a request that this process never makes. Loopback is exempt exactly as it is
82
+ for `VIBECLOUD_API`.
83
+
84
+ ⚠ **No credential is ever written into an editor's config file.** Every editor
85
+ `vibe mcp` supports accepts a `headers` map, and putting `Authorization: Bearer`
86
+ in it is the shortest route to a working connection — so its absence is a
87
+ decision worth recording. Those files are world-readable by default and several
88
+ live in directories people sync or commit, while `src/cli/auth/credential.ts`
89
+ goes to real lengths to keep that same token at 0600 in a 0700 directory.
90
+ Registration writes a URL; the editor authenticates against the authorization
91
+ server it discovers from it.
92
+
93
+
94
+ ## VIBECLOUD_ORG
95
+
96
+ - Type: string (organisation **slug**, e.g. `acme` — not an opaque ID)
97
+ - Required: no, unless the account belongs to more than one organisation
98
+ - Default: (none)
99
+ - Consuming module: `src/cli/config.ts`, `src/cli/run.ts`
100
+ - Flag equivalent: `--org` (on each subcommand that takes one)
101
+
102
+ Default organisation for CLI commands, so `--org` can be omitted.
103
+
104
+ ⚠ **A slug, not an ID.** The CLI resolves it against `Query.orgs` to get the
105
+ opaque `ID` the API needs, because a GraphQL `ID` must not be composed or parsed
106
+ by a client (`api-contract.md` §3).
107
+
108
+ 🔴 **It cannot select a tenancy, and since 2026-08-15 commands say so.** A token
109
+ is minted for ONE organisation — the authorization server reads it from the
110
+ signed-in human's session and takes none from the caller — so the CLI acts in the
111
+ credential's organisation and **refuses, naming both**, when this or `--org` names
112
+ another. Every org-taking command resolves through `commands.resolveOrg`, and a
113
+ guard test fails the build if a new one does not.
114
+
115
+ ⚠ With an OAuth credential this is therefore only ever a **check**. With an
116
+ opaque `vibe_pat_` credential — whose binding lives server-side and cannot be read
117
+ here — it still selects: with several organisations and neither this nor `--org`
118
+ set, commands REFUSE and list the options, and with exactly one organisation it is
119
+ used automatically, which is not a default so much as the absence of a choice.
120
+
121
+ ⚠ Deliberately NOT read by `vibe token …`. `CreateTokenInput` has no `orgId` and
122
+ `Query.tokens` takes only pagination — a token is scoped to the org of whoever
123
+ created it — so an `--org` there would have looked meaningful and done nothing.
124
+
125
+ ## VIBECLOUD_TOKEN
126
+
127
+ - Type: string (a `vibe_pat_…` token)
128
+ - Required: no
129
+ - Default: (none) — the stored credential from `vibe login` is used
130
+ - Consuming module: `src/cli/config.ts` (validated at load), `src/cli/commands/api.ts` (`accessToken`)
131
+
132
+ A bearer token supplied by the environment (VIBEC-336). When set it is **the**
133
+ credential: `~/.vibecloud/token` is not read and nothing is refreshed, so an
134
+ agent with only this variable runs every command — `vibe init` included —
135
+ with no login round-trip. The source is a token from `vibe token create`. A
136
+ value that is not a `vibe_pat_` token is refused at
137
+ startup rather than sent as a bearer. An expired or revoked one is answered
138
+ by the API as `UNAUTHENTICATED` with the registry fix (`vibe login`).
139
+
140
+ ⚠ While it is set it outranks everything: `vibe login` stores a credential
141
+ that is then ignored until the variable is unset, and `vibe logout` revokes
142
+ and deletes the stored credential but leaves the variable's token valid (it says so). An agent that logs in must
143
+ `unset VIBECLOUD_TOKEN` afterwards, or it keeps running as that token.
144
+
145
+ ## VIBECLOUD_OAUTH_CLIENT_ID · VIBECLOUD_OAUTH_RESOURCE · VIBECLOUD_OAUTH_SCOPES
146
+
147
+ - Type: string, string, string (space-separated list)
148
+ - Required: **`VIBECLOUD_OAUTH_RESOURCE` is required for `vibe login` when
149
+ `VIBECLOUD_API` is set** (a deployment this binary does not know); it refuses
150
+ before opening a browser when both are unset. The other two are optional.
151
+ - Default: `VIBECLOUD_OAUTH_CLIENT_ID` → **`vibe-cli`** (2026-08-15).
152
+ `VIBECLOUD_OAUTH_RESOURCE` → **`https://api.vibecloud.tr` when `VIBECLOUD_API` is
153
+ unset, otherwise none** (VIBEC-322, below).
154
+ `VIBECLOUD_OAUTH_SCOPES` → the `scopes_supported` list in the server's own
155
+ RFC 8414 discovery document, which is fetched rather than assumed.
156
+ - Consuming module: `src/cli/config.ts`, `src/cli/commands/session.ts`,
157
+ `src/cli/auth/`
158
+ - Flag equivalents: `--client-id`, `--resource`, `--scope`
159
+ - Read by `vibe login` only. Every other command uses the stored credential.
160
+
161
+ `vibe login` performs the OAuth 2.1 authorization-code flow with PKCE (S256) over
162
+ an RFC 8252 loopback redirect.
163
+
164
+ - **`VIBECLOUD_OAUTH_CLIENT_ID`** — the registered public client. **Defaults to
165
+ `vibe-cli`, in every environment including `prod`.** A `client_id` is this
166
+ program's public name rather than a deployment secret, so one value belongs in
167
+ the binary and every deployment registers the same entry. ⚠ **That means
168
+ `vibe-cli` must be in the deployment's `OAUTH_CLIENTS`**, registered
169
+ `Native: true` with a loopback redirect URI whose **path** is `/callback` (the
170
+ port in the registration is ignored, the path is not). Only `local/scripts/api.sh`
171
+ has it today. A deployment without it answers `invalid_client`, which the login
172
+ preflight catches before a browser opens and reports by name — louder than the
173
+ "not set" error a missing default produces, and it names the fix.
174
+ 🔴 The earlier entry said no CLI client existed anywhere so a default "would
175
+ name a client that exists nowhere". That was about the registry being empty, not
176
+ about the value being unknowable, and the registry is no longer empty.
177
+ - **`VIBECLOUD_OAUTH_RESOURCE`** — the RFC 8707 audience. The issued token carries
178
+ exactly this value as its `aud`, and the API's `authenticate` compares it
179
+ against its explicit `OAUTH_API_RESOURCE` (since the 2026-08-15 API/MCP
180
+ audience split — previously the positional `OAUTH_RESOURCES[0]`); a token
181
+ audienced anywhere else is treated as **no credential at all**. ⚙ **Defaulted
182
+ for the public deployment only (VIBEC-322):** with `VIBECLOUD_API` unset the
183
+ binary is talking to vibecloud.tr, whose audience is its own API origin, so
184
+ `vibe login` is zero-config there. 🔴 **For any other deployment it cannot be
185
+ defaulted or discovered.** `oauth.Server.Metadata` advertises
186
+ `resource_indicators_supported: true` and no identifiers, and the API serves no
187
+ RFC 9728 protected-resource metadata for itself, so the one audience a
188
+ deployment accepts is knowable only out of band. 🔴 **Deriving it is actively
189
+ unsafe now that a deployment has two audiences**: `<issuer>/mcp` is the MCP
190
+ server's resource — exporting that here mints a token the API refuses
191
+ outright, not one it merely fails to recognise as special. **The fix is
192
+ upstream in `api/`** — serve `/.well-known/oauth-protected-resource` — and
193
+ until then this stays exported by hand. For the local slice the value is
194
+ `https://local.vibecloud.tr:8443` (no `/mcp`).
195
+ - **`VIBECLOUD_OAUTH_SCOPES`** — narrows the request. The discovery document lists
196
+ the **deployment's** vocabulary while `oauth.Server.ValidateScopes` bounds the
197
+ request by the **client's** registration, and the two need not agree: a client
198
+ registered for `mcp:tools` alone is refused with `scope "mcp:db" is not
199
+ permitted for this client` (measured 2026-08-15). Set this to the subset the
200
+ client is registered for. Leave it unset otherwise.
201
+
202
+ ## BROWSER
203
+
204
+ - Type: string (a command; `%s` is replaced by the URL, otherwise the URL is
205
+ appended as the last argument)
206
+ - Required: no
207
+ - Default: (unset — the platform opener is used: `xdg-open`, `open` on macOS,
208
+ `rundll32 url.dll,FileProtocolHandler` on Windows)
209
+ - Consuming module: `src/cli/auth/browser.ts`, used by `vibe login`
210
+
211
+ ⚠ **The conventional Unix variable, not one of ours.** It is honoured because
212
+ `xdg-open` itself honours it, and it is the only way through on a host whose
213
+ default handler is wrong.
214
+
215
+ ⚠ **Nothing here can block a login.** The authorization URL is printed FIRST and
216
+ always; opening a browser is best effort. When this is unset and no platform
217
+ opener exists — a container, an SSH session, a CI runner, which is the normal
218
+ case for a CLI doing a loopback OAuth flow — the CLI says the browser could not
219
+ be opened and keeps waiting, and the person pastes the printed URL into a browser
220
+ that has a console session. That is the documented RFC 8252 path, not a degraded
221
+ one. The same holds when this points at a command that does not exist: the
222
+ failure is reported, and the URL is still on screen.
223
+
224
+ ⚠ The opener is started, never waited on, and its output is discarded so it
225
+ cannot be mistaken for part of the login. Its exit status is not consulted.
226
+
227
+ ## VIBECLOUD_OUTPUT
228
+
229
+ - Type: string (`json` selects JSON; any other value or unset selects human-readable)
230
+ - Required: no
231
+ - Default: (unset — human-readable output)
232
+ - Consuming module: `src/cli/run.ts`, `src/cli/output/`
233
+
234
+ Output format for CLI commands. Note the comparison is `!= "json"`, so only the
235
+ exact string `json` switches the format.
236
+
237
+ 🔴 **This line used to be false, and it was false for the whole surface.** Two
238
+ commands out of twenty honoured it, and the paths that did branch on it emitted
239
+ JSON that does not parse. Measured against the built binary on 2026-08-15:
240
+
241
+ $ VIBECLOUD_OUTPUT=json vibe project list
242
+ PROJE PAKET DURUM HUCRE
243
+ ───── ───── ───── ─────
244
+ musteri-crm LUNA READY cell-01
245
+
246
+ $ VIBECLOUD_OUTPUT=json vibe logs | jq .
247
+ jq: parse error: Invalid string: control characters from U+0000 through
248
+ U+001F must be escaped at line 10, column 138 (exit 5)
249
+
250
+ $ VIBECLOUD_OUTPUT=json vibe token create | jq .
251
+ jq: parse error: Invalid numeric literal at line 3, column 6 (exit 5)
252
+
253
+ `Output.Print` rendered `%+v` of a preformatted string in machine mode — which is
254
+ byte-identical to `%v` — so the mode was threaded through every command and
255
+ changed nothing, and the error object was built with an unescaped `fmt.Printf`.
256
+
257
+ ### The contract, as of 2026-08-15
258
+
259
+ With `VIBECLOUD_OUTPUT=json`, **stdout is exactly one JSON document per
260
+ invocation** — success, refusal or usage error alike — and nothing else. Human
261
+ prose, tables and box-drawing are suppressed. The Go error still goes to
262
+ **stderr**, and the exit code is unchanged.
263
+
264
+ {"ok": true, "command": "project list", "data": { … }}
265
+ {"ok": false, "command": "logs", "error": {
266
+ "code": "", "message": "…", "action": "…",
267
+ "fix": "…", "details": { … },
268
+ "missing": ["…"], "alternative": "…"}}
269
+
270
+ - `ok` is always present — a consumer never has to infer success from which keys
271
+ happen to exist.
272
+ - `command` names the invocation that produced the document.
273
+ - `error.fix` (VIBEC-324) is the next step as the API stated it —
274
+ `extensions.fix` verbatim, or the vendored registry's for the code — and
275
+ `error.details` is the object that fix refers to (`{"retryAfter": 60}`,
276
+ `{"traceId": "…"}`), verbatim from the API. Both absent when there is none.
277
+ - `error.missing` carries a refusal's prerequisites as an **array**, not as a
278
+ paragraph: `vibe logs` and `vibe migrate supabase --apply` refuse because
279
+ something does not exist yet, and what is missing is the useful part.
280
+ - **No bearer token, refresh token or config secret value is ever in a
281
+ document.** `vibe login` reports the account, the bound org and the expiry;
282
+ `vibe config set` reports variable NAMES only. Machine output is what lands in
283
+ a CI log.
284
+
285
+ ⚙ **Enforced, not asked for.** `src/cli/coverage.test.ts` drives every
286
+ dispatchable command through the real dispatch layer in machine mode and requires
287
+ stdout to parse as one document; `TestEveryDispatchableCommandIsCovered` reads
288
+ the dispatch switch's own `case` labels and fails on a command the table does not
289
+ exercise. A new command that forgets `out.Emit` fails the suite.
290
+
291
+ ## VIBECLOUD_SOURCE_STORAGE_KEY · VIBECLOUD_SOURCE_STORAGE_URL
292
+
293
+ Read by `vibe migrate supabase --apply` (VIBEC-76), which executes the import: it
294
+ `pg_dump`s the source and `pg_restore`s into the target, then moves the storage
295
+ blobs. Type: string. Consulted for `--apply` only; unused by `--scan` and every
296
+ other command. **Both OPTIONAL** — an import that moves no storage needs neither.
297
+
298
+ 🔴 **THE TARGET IS NO LONGER SUPPLIED BY THE CUSTOMER.** The earlier design
299
+ required four env vars, two of them TARGET secrets the customer revealed in the
300
+ console (`VIBECLOUD_TARGET_DB_PASSWORD`, `VIBECLOUD_TARGET_STORAGE_KEY`). Those are
301
+ **gone**: the platform now mints a time-boxed, owner-equivalent migration role
302
+ (`mintMigrationCredential`, 24 h) and mints a matching time-boxed `service_role`
303
+ key for storage (`revealedMigrationStorageKey` — NOT the project's standing key),
304
+ so the customer never holds a standing target
305
+ secret. Only the SOURCE side — their existing Supabase, which we cannot mint for
306
+ — can still need a value, and only for storage.
307
+
308
+ 🔴 **By env, never a flag.** The source key is a secret, and a secret in argv is
309
+ readable through `ps` and lands in shell history — the same rule `config set
310
+ --value` follows by taking its value on stdin.
311
+
312
+ - **`VIBECLOUD_SOURCE_STORAGE_KEY`** — the SOURCE Supabase project's `service_role`
313
+ key, for the storage `GET`. Optional: absent, storage is not moved, and the
314
+ import **refuses** (rather than silently dropping files) if the source actually
315
+ has objects. A source with no storage needs it not at all.
316
+ - **`VIBECLOUD_SOURCE_STORAGE_URL`** — the SOURCE storage-api base, e.g.
317
+ `https://<ref>.supabase.co/storage/v1`. **Derived from `--dsn`** (a Supabase DSN
318
+ names the project ref), so normally unset; provide it only to override the
319
+ derivation for a DSN shape it cannot recognise (self-hosted, custom domains).
320
+
321
+ The target's own connection parts come from the mint (`mintMigrationCredential`
322
+ returns host/port/db/the migrate username/sslmode/CA) and its `/storage/v1` base
323
+ from the API (`Project.endpoints`), not from env.
324
+
325
+ ## VIBECLOUD_PG_CLIENT_MIRROR
326
+
327
+ - Type: string (URL, the base of the pg-client mirror)
328
+ - Required: no
329
+ - Default: `https://dl.vibecloud.tr/pg-client`
330
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/supabase/pgclient.ts`
331
+
332
+ Where `vibe migrate supabase --apply` fetches pinned `pg_dump`/`pg_restore` bundles
333
+ from when they are missing on the machine (VIBEC-343). The mirror is **our own**
334
+ object store (KVKK-resident), never a foreign CDN; the CLI downloads
335
+ `manifest.json`, then the bundle for its platform, and **verifies the sha256
336
+ before writing or executing anything** — a mismatch refuses. Bundles are cached
337
+ under `~/.vibecloud/bin` (0700), keyed by checksum, so a repeat run downloads
338
+ nothing.
339
+
340
+ 🔴 **The download is opt-in.** It happens only with `--fetch-pg-client`, or when a
341
+ human on a TTY answers yes to the prompt; in machine mode (`VIBECLOUD_OUTPUT=json`)
342
+ or a piped session it is never performed — the refusal names the flag instead.
343
+ Override this URL only for a self-hosted mirror or a local test of the download
344
+ path; the default points at the platform's mirror.
345
+
346
+ ## Not variables, but worth stating here
347
+
348
+ - **`~/.vibecloud/token`** holds the credential `vibe login` obtains. The path and
349
+ its `0600` mode are fixed: changing either signs every existing user out
350
+ silently, so it needs its own change with a migration. ⚠ The mode is enforced on
351
+ **read** as well as on write (2026-08-15), and so is the DIRECTORY's: a
352
+ hand-pasted PAT is created 0644 under the usual umask, and a 0600 file inside a
353
+ group-writable `~/.vibecloud` can be replaced rather than merely read. `Load`
354
+ narrows the file to 0600 and the directory to 0700, and names what it narrowed
355
+ on the next command rather than repairing it silently. ⚠ The CONTENT is a
356
+ cross-repo contract — a JSON document carrying the access token, the rotated
357
+ refresh token, the expiry, and where to renew — because other tools read it
358
+ rather than obtaining their own credential. A bare token in that file is still
359
+ accepted (a `vibe_pat_` PAT from the console). The exact shape, and what a
360
+ reader that renews must write back, is in `README.md` under "What is stored,
361
+ and where".
362
+ - 🔴 **A reader that renews must persist the rotated refresh token.** The refresh
363
+ grant consumes the one it is presented, so renewing without writing back leaves
364
+ the next process holding a spent credential.
365
+ - 🔴 **No credential the CLI can hold performs a `@dangerous` action**, and no
366
+ variable changes that. The API's gate is an allowlist requiring an interactive
367
+ console session with a satisfied step-up (`api/internal/server/directives.go`),
368
+ and a session lives in a `__Host-vc_session` cookie that is never accepted as a
369
+ bearer token. `vibe project delete`, `vibe restore`, `vibe token create`,
370
+ `vibe team invite` and `vibe team remove` therefore refuse, by name, rather than
371
+ failing at the server one round trip later.
372
+
373
+ ## HEROKU_API_KEY
374
+
375
+ - Type: string (a Heroku Platform API key / authorization token)
376
+ - Required: only for `vibe migrate heroku`
377
+ - Default: none — the command refuses without it
378
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/heroku/api.ts`
379
+
380
+ The customer's own Heroku credential (`heroku authorizations:create`), used to read
381
+ the app being migrated (VIBEC-350): the app record, config vars, formation,
382
+ add-ons, domains and buildpacks — reads only. By environment and never a flag, so
383
+ it stays out of argv and shell history. It is sent as `Authorization: Bearer` to
384
+ the Heroku API and nowhere else; the CLI never stores it.
385
+
386
+ ## VIBECLOUD_HEROKU_API
387
+
388
+ - Type: string (URL)
389
+ - Required: no
390
+ - Default: `https://api.heroku.com`
391
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/heroku/api.ts`
392
+
393
+ Where `vibe migrate heroku` speaks the Platform API. Exists for the live test
394
+ harness, which points it at a fake Heroku; a customer never sets it.
395
+
396
+ ## RAILWAY_TOKEN
397
+
398
+ - Type: string (a Railway account or team API token)
399
+ - Required: only for `vibe migrate railway`
400
+ - Default: none — the command refuses without it
401
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/railway/api.ts`
402
+
403
+ The customer's own Railway credential (Account → Tokens, or a team token), used to
404
+ read the project environment being migrated (VIBEC-349): the project, its
405
+ environments and services, each service's instance (source, builder, commands,
406
+ domains), variables per scope, TCP proxies and volumes — reads only. By
407
+ environment and never a flag, so it stays out of argv and shell history. It is sent
408
+ as `Authorization: Bearer` to the Railway GraphQL API and nowhere else; the CLI
409
+ never stores it. Variable VALUES are read (they are what moves) and are never
410
+ printed or written to the machine-output document.
411
+
412
+ ## VIBECLOUD_RAILWAY_API
413
+
414
+ - Type: string (URL)
415
+ - Required: no
416
+ - Default: `https://backboard.railway.com/graphql/v2`
417
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/railway/api.ts`
418
+
419
+ Where `vibe migrate railway` speaks the GraphQL API. Exists for the live test
420
+ harness, which points it at a fake Railway; a customer never sets it.
421
+
422
+ ## VERCEL_TOKEN
423
+
424
+ - Type: string (a Vercel personal or team access token)
425
+ - Required: only for `vibe migrate vercel --vercel-project`
426
+ - Default: none — the hosted half refuses without it
427
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/vercel/api.ts`
428
+
429
+ The customer's own Vercel credential (Settings → Tokens), used to read the hosted
430
+ project being migrated (VIBEC-346): the project record (linked repository,
431
+ production branch, root directory, framework, commands, Node), its environment
432
+ variables with `?decrypt=true` — values are what moves; Vercel never discloses the
433
+ `sensitive` type and those are reported by name — and its domains. Reads only. By
434
+ environment and never a flag, so it stays out of argv and shell history. Sent as
435
+ `Authorization: Bearer` to the Vercel API and nowhere else; the CLI never stores it.
436
+ Values are never printed or written to the machine-output document.
437
+
438
+ ## VIBECLOUD_VERCEL_API
439
+
440
+ - Type: string (URL)
441
+ - Required: no
442
+ - Default: `https://api.vercel.com`
443
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/vercel/api.ts`
444
+
445
+ Where the hosted half speaks the REST API. Exists for the live test harness, which
446
+ points it at a fake Vercel; a customer never sets it.
447
+
448
+ ## NETLIFY_AUTH_TOKEN
449
+
450
+ - Type: string (a Netlify personal access token)
451
+ - Required: only for `vibe migrate netlify`
452
+ - Default: none — the command refuses without it
453
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/netlify/api.ts`
454
+
455
+ The customer's own Netlify credential (User settings → Applications → Personal
456
+ access tokens), used to read the site being migrated (VIBEC-348): the site record
457
+ (linked repository, branch, base, build command, publish directory, plugins,
458
+ domains) and its environment variables across contexts — values are what moves;
459
+ a variable Netlify marks secret is never disclosed and is reported by name. Reads
460
+ only. By environment and never a flag. Sent as `Authorization: Bearer` to the
461
+ Netlify API and nowhere else; the CLI never stores it. Values are never printed or
462
+ written to the machine-output document.
463
+
464
+ ## VIBECLOUD_NETLIFY_API
465
+
466
+ - Type: string (URL)
467
+ - Required: no
468
+ - Default: `https://api.netlify.com/api/v1`
469
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/netlify/api.ts`
470
+
471
+ Where `vibe migrate netlify` speaks the REST API. Exists for the live test harness,
472
+ which points it at a fake Netlify; a customer never sets it.
473
+
474
+ ## CLOUDFLARE_API_TOKEN
475
+
476
+ - Type: string (a Cloudflare API token)
477
+ - Required: only for `vibe migrate cloudflare`
478
+ - Default: none — the command refuses without it
479
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/cloudflare/api.ts`
480
+
481
+ The customer's own Cloudflare credential (My Profile → API Tokens, with the
482
+ `Pages: Read` permission), used to read the Pages project being migrated
483
+ (VIBEC-351): the project record (connected repository, production branch, build
484
+ command, root and output directories, framework, custom domains), its production
485
+ deployment config (environment variables, Workers compatibility date and flags)
486
+ and every binding on it (KV, D1, R2, Durable Objects, services, queues, Workers
487
+ AI, Analytics Engine, Hyperdrive, Vectorize, mTLS, Browser Rendering). Reads
488
+ only. By environment and never a flag. Sent as `Authorization: Bearer` to the
489
+ Cloudflare API and nowhere else; the CLI never stores it. A variable Cloudflare
490
+ marks `secret_text` is never disclosed by the API and is reported by name. Values
491
+ are never printed or written to the machine-output document.
492
+
493
+ ## CLOUDFLARE_ACCOUNT_ID
494
+
495
+ - Type: string (32 hexadecimal characters)
496
+ - Required: for `vibe migrate cloudflare`, unless `--account` is given
497
+ - Default: none — the command refuses without either
498
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/cloudflare/api.ts`
499
+
500
+ The Cloudflare account the Pages project belongs to; it is a path segment of
501
+ every Pages API call. An identifier rather than a credential, which is why
502
+ `--account` is allowed as well — a token can reach several accounts, so neither
503
+ the token nor the project name determines it. Shown in the Cloudflare dashboard
504
+ as "Account ID" on any domain's overview page.
505
+
506
+ ## VIBECLOUD_CLOUDFLARE_API
507
+
508
+ - Type: string (URL)
509
+ - Required: no
510
+ - Default: `https://api.cloudflare.com/client/v4`
511
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/cloudflare/api.ts`
512
+
513
+ Where `vibe migrate cloudflare` speaks the REST API. Exists for the live test
514
+ harness, which points it at a fake Cloudflare; a customer never sets it.
515
+
516
+ ## VIBECLOUD_FIREBASE_API
517
+
518
+ - Type: string (URL)
519
+ - Required: no
520
+ - Default: unset — Google's own endpoints (`identitytoolkit.googleapis.com`, `firestore.googleapis.com`, `storage.googleapis.com`, `oauth2.googleapis.com/token`)
521
+ - Consuming module: `src/cli/commands/migrate.ts` → `src/cli/migrate/firebase/serviceaccount.ts`
522
+
523
+ One override that points every Google API `vibe migrate firebase` reads — and the
524
+ OAuth token endpoint — at a single base. Exists for the live test harness, which
525
+ drives a fake Google; a customer never sets it. The Firebase Admin service-account
526
+ key itself is NOT an environment variable: it is a file whose path is the
527
+ `--service-account` flag (VIBEC-347), read once, held in memory, never printed
528
+ and never written to the machine-output document; its private key is used only to
529
+ sign the token assertion.
package/LICENSE ADDED
@@ -0,0 +1,95 @@
1
+ Copyright (c) 2026 Çağrı Ekin
2
+
3
+ Elastic License 2.0
4
+
5
+ URL: https://www.elastic.co/licensing/elastic-license
6
+
7
+ ## Acceptance
8
+
9
+ By using the software, you agree to all of the terms and conditions below.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
14
+ non-sublicensable, non-transferable license to use, copy, distribute, make
15
+ available, and prepare derivative works of the software, in each case subject to
16
+ the limitations and conditions below.
17
+
18
+ ## Limitations
19
+
20
+ You may not provide the software to third parties as a hosted or managed
21
+ service, where the service provides users with access to any substantial set of
22
+ the features or functionality of the software.
23
+
24
+ You may not move, change, disable, or circumvent the license key functionality
25
+ in the software, and you may not remove or obscure any functionality in the
26
+ software that is protected by the license key.
27
+
28
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
29
+ of the licensor in the software. Any use of the licensor’s trademarks is subject
30
+ to applicable law.
31
+
32
+ ## Patents
33
+
34
+ The licensor grants you a license, under any patent claims the licensor can
35
+ license, or becomes able to license, to make, have made, use, sell, offer for
36
+ sale, import and have imported the software, in each case subject to the
37
+ limitations and conditions in this license. This license does not cover any
38
+ patent claims that you cause to be infringed by modifications or additions to
39
+ the software. If you or your company make any written claim that the software
40
+ infringes or contributes to infringement of any patent, your patent license for
41
+ the software granted under these terms ends immediately. If your company makes
42
+ such a claim, your patent license ends immediately for work on behalf of your
43
+ company.
44
+
45
+ ## Notices
46
+
47
+ You must ensure that anyone who gets a copy of any part of the software from you
48
+ also gets a copy of these terms.
49
+
50
+ If you modify the software, you must include in any modified copies of the
51
+ software prominent notices stating that you have modified the software.
52
+
53
+ ## No Other Rights
54
+
55
+ These terms do not imply any licenses other than those expressly granted in
56
+ these terms.
57
+
58
+ ## Termination
59
+
60
+ If you use the software in violation of these terms, such use is not licensed,
61
+ and your licenses will automatically terminate. If the licensor provides you
62
+ with a notice of your violation, and you cease all violation of this license no
63
+ later than 30 days after you receive that notice, your licenses will be
64
+ reinstated retroactively. However, if you violate these terms after such
65
+ reinstatement, any additional violation of these terms will cause your licenses
66
+ to terminate automatically and permanently.
67
+
68
+ ## No Liability
69
+
70
+ *As far as the law allows, the software comes as is, without any warranty or
71
+ condition, and the licensor will not be liable to you for any damages arising
72
+ out of these terms or the use or nature of the software, under any kind of
73
+ legal claim.*
74
+
75
+ ## Definitions
76
+
77
+ The **licensor** is the entity offering these terms, and the **software** is the
78
+ software the licensor makes available under these terms, including any portion
79
+ of it.
80
+
81
+ **you** refers to the individual or entity agreeing to these terms.
82
+
83
+ **your company** is any legal entity, sole proprietorship, or other kind of
84
+ organization that you work for, plus all organizations that have control over,
85
+ are under the control of, or are under common control with that
86
+ organization. **control** means ownership of substantially all the assets of an
87
+ entity, or the power to direct its management and policies by vote, contract, or
88
+ otherwise. Control can be direct or indirect.
89
+
90
+ **your licenses** are all the licenses granted to you for the software under
91
+ these terms.
92
+
93
+ **use** means anything you do with the software requiring one of your licenses.
94
+
95
+ **trademark** means trademarks, service marks, and similar rights.