@zitadel/cli 0.1.0-alpha.0 → 0.1.0-alpha.10

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.
Files changed (43) hide show
  1. package/README.md +227 -18
  2. package/SKILLS.md +104 -11
  3. package/dist/commands/apply.mjs +4 -4
  4. package/dist/commands/apply.mjs.map +1 -1
  5. package/dist/commands/doctor.mjs +291 -17
  6. package/dist/commands/doctor.mjs.map +1 -1
  7. package/dist/commands/eject.mjs +14 -6
  8. package/dist/commands/eject.mjs.map +1 -1
  9. package/dist/commands/logs.mjs +58 -0
  10. package/dist/commands/logs.mjs.map +1 -0
  11. package/dist/commands/plan.mjs +4 -4
  12. package/dist/commands/plan.mjs.map +1 -1
  13. package/dist/commands/reset.mjs +79 -0
  14. package/dist/commands/reset.mjs.map +1 -0
  15. package/dist/commands/setup.mjs +267 -105
  16. package/dist/commands/setup.mjs.map +1 -1
  17. package/dist/commands/start.mjs +288 -0
  18. package/dist/commands/start.mjs.map +1 -0
  19. package/dist/commands/status.mjs +92 -27
  20. package/dist/commands/status.mjs.map +1 -1
  21. package/dist/commands/stop.mjs +105 -0
  22. package/dist/commands/stop.mjs.map +1 -0
  23. package/dist/docker-CnGQK3ZK.mjs +432 -0
  24. package/dist/docker-CnGQK3ZK.mjs.map +1 -0
  25. package/dist/docker-guidance-ypN3IM3o.mjs +21 -0
  26. package/dist/docker-guidance-ypN3IM3o.mjs.map +1 -0
  27. package/dist/{project-C3pSfbao.mjs → oclif-B7lBzh3R.mjs} +339 -119
  28. package/dist/oclif-B7lBzh3R.mjs.map +1 -0
  29. package/dist/orca-BoTFU8SI.mjs +2581 -0
  30. package/dist/orca-BoTFU8SI.mjs.map +1 -0
  31. package/dist/ports-B09RjuHx.mjs +111 -0
  32. package/dist/ports-B09RjuHx.mjs.map +1 -0
  33. package/dist/processes-Cw8TO1SY.mjs +120 -0
  34. package/dist/processes-Cw8TO1SY.mjs.map +1 -0
  35. package/dist/project-Cd0L3PtM.mjs +87 -0
  36. package/dist/project-Cd0L3PtM.mjs.map +1 -0
  37. package/dist/{sync-Cuyh-X1J.mjs → sync-BojoQm2P.mjs} +4 -4
  38. package/dist/{sync-Cuyh-X1J.mjs.map → sync-BojoQm2P.mjs.map} +1 -1
  39. package/oclif.manifest.json +399 -7
  40. package/package.json +8 -41
  41. package/dist/orca-COsUnVoz.mjs +0 -1006
  42. package/dist/orca-COsUnVoz.mjs.map +0 -1
  43. package/dist/project-C3pSfbao.mjs.map +0 -1
package/README.md CHANGED
@@ -1,42 +1,77 @@
1
1
  # @zitadel/cli
2
2
 
3
- Scaffolds Zitadel auth (login, register, profile, middleware) into a Next.js app.
3
+ Scaffolds Zitadel auth (login, register, profile, middleware) into a Next.js, React, Vue, Angular, or Nuxt app.
4
4
 
5
5
  ```sh
6
- npx @zitadel/cli@latest setup --framework next --server <your-zitadel-server>
6
+ npx @zitadel/cli@alpha start
7
+ npx @zitadel/cli@alpha setup --server local
7
8
  ```
8
9
 
10
+ During the public alpha, bare `npx @zitadel/cli` resolves to the same tested
11
+ alpha CLI. Use `@alpha` or an exact `0.1.0-alpha.N` selector in bug reports and
12
+ automation when reproducibility matters.
13
+
9
14
  > **Beta.** This is the **next-generation Zitadel**, a ground-up rewrite of the platform. It is distinct from the established Zitadel at [github.com/zitadel/zitadel](https://github.com/zitadel/zitadel). APIs and CLI flags will change.
10
15
 
11
16
  ## Requirements
12
17
 
13
- - Node 20+
14
- - A Next.js project created with `create-next-app`
15
- - A running next-generation Zitadel server to point at:
16
- - **Zitadel Cloud** — coming soon
17
- - **Self-hosted** — grab a binary from [github.com/zitadel/nextgen/releases](https://github.com/zitadel/nextgen/releases) and run it locally
18
+ - Node 24+
19
+ - Docker only when using the optional Docker runtime backend
20
+ - A Next.js project, or an empty directory where setup can scaffold one
18
21
 
19
22
  ## Quickstart
20
23
 
21
24
  ```sh
22
- npx create-next-app@latest my-app
25
+ mkdir my-app
23
26
  cd my-app
24
- npx @zitadel/cli@latest setup --framework next --server http://localhost:8080
27
+ npx @zitadel/cli@alpha doctor
28
+ npx @zitadel/cli@alpha start
29
+ npx @zitadel/cli@alpha setup --server local
25
30
  npm run dev
26
31
  ```
27
32
 
28
- `setup` creates a project on the Zitadel server, scaffolds `app/login`, `app/register`, `app/profile`, and `middleware.ts`, and writes `.env.local` and `.zitadel/`. The project's default user schema and login flow are provisioned server-side at creation time, so the CLI does not scaffold or upload them. Open `http://localhost:3000/login` to see the login page.
33
+ `start` runs the `@zitadel/server` npm binary by default and stores runtime data
34
+ under `.zitadel/local/`. Remote-server setup can use `--server <url>` without
35
+ starting a local runtime. Use `--runtime docker`, `--image`, or
36
+ `ZITADEL_LOCAL_IMAGE` for advanced Docker backend debugging.
37
+ `setup --server local` creates a project on that local server, asks which
38
+ framework to scaffold when the directory is fresh, writes the Next.js app into
39
+ the current directory, scaffolds `app/login`, `app/register`, `app/profile`, and
40
+ `proxy.ts` for Next 16+ or `middleware.ts` for older Next versions. Fresh
41
+ scaffolds also replace the starter `app/page.tsx` with links to sign in, create
42
+ an account, and profile. Setup writes `.env.local` and `.zitadel/`, and installs
43
+ dependencies with the detected package manager. Pass `--skip-install` to install
44
+ them yourself. The project's default user schema and login flow are provisioned
45
+ server-side at creation time, so the CLI does not scaffold or upload them. Open
46
+ the dev server URL printed by your framework, register a user, log out, log back
47
+ in, and end on the signed-in profile page.
48
+
49
+ For a reproducible tester report, use the exact alpha train from the GitHub
50
+ Release:
51
+
52
+ ```sh
53
+ npx @zitadel/cli@0.1.0-alpha.N doctor
54
+ npx @zitadel/cli@0.1.0-alpha.N start
55
+ npx @zitadel/cli@0.1.0-alpha.N setup --server local
56
+ ```
29
57
 
30
58
  The default project flow supports password registration/login, passkey
31
59
  registration/login, and optional passkey setup after password registration.
32
60
  Users who skip passkey setup can still sign in with password; users who add a
33
61
  passkey can sign in with either credential.
34
62
 
63
+ For agent scripts, pass `--non-interactive --json` and capture stdout and stderr
64
+ separately. The CLI contract is one parseable JSON object on stdout; terminals
65
+ and agent UIs may display stderr package-manager progress together with stdout.
66
+
35
67
  ## Other commands
36
68
 
37
- - `zitadel doctor` — verify the generated files and local state
38
- - `zitadel status` — summarise the local project
69
+ - `zitadel doctor` — verify the local runtime and generated project files
70
+ - `zitadel status` — summarise the local runtime and project
71
+ - `zitadel plan` — validate config and preview sync changes without mutation
72
+ - `zitadel apply` — validate and upload repo config to Zitadel
39
73
  - `zitadel eject` — remove what setup wrote (alias: `zitadel uninstall`)
74
+ - `zitadel start|stop|logs|reset` — manage the local runtime
40
75
 
41
76
  ## Reference
42
77
 
@@ -44,18 +79,51 @@ passkey can sign in with either credential.
44
79
  <summary>Full command reference</summary>
45
80
 
46
81
  <!-- commands -->
82
+ * [`zitadel apply`](#zitadel-apply)
47
83
  * [`zitadel autocomplete [SHELL]`](#zitadel-autocomplete-shell)
48
84
  * [`zitadel commands`](#zitadel-commands)
49
85
  * [`zitadel doctor`](#zitadel-doctor)
50
86
  * [`zitadel eject`](#zitadel-eject)
51
87
  * [`zitadel help [COMMAND]`](#zitadel-help-command)
88
+ * [`zitadel logs`](#zitadel-logs)
89
+ * [`zitadel plan`](#zitadel-plan)
90
+ * [`zitadel reset`](#zitadel-reset)
52
91
  * [`zitadel search`](#zitadel-search)
53
92
  * [`zitadel setup`](#zitadel-setup)
93
+ * [`zitadel start`](#zitadel-start)
54
94
  * [`zitadel status`](#zitadel-status)
95
+ * [`zitadel stop`](#zitadel-stop)
55
96
  * [`zitadel uninstall`](#zitadel-uninstall)
56
97
  * [`zitadel version`](#zitadel-version)
57
98
  * [`zitadel which`](#zitadel-which)
58
99
 
100
+ ## `zitadel apply`
101
+
102
+ Validate and upload repo config to the platform.
103
+
104
+ ```
105
+ USAGE
106
+ $ zitadel apply [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug] [-e
107
+ development|preview|production]
108
+
109
+ FLAGS
110
+ -c, --cwd=<value> Project directory to operate on.
111
+ -e, --environment=<option> Target environment (default: development).
112
+ <options: development|preview|production>
113
+ -f, --force Overwrite protected files on conflict.
114
+ -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
115
+ -s, --server=<value> Override the resolved server URL.
116
+ --debug Debug logging.
117
+ --dry-run Preview without mutating files or the platform.
118
+ --verbose Verbose logging.
119
+
120
+ GLOBAL FLAGS
121
+ --json Format output as json.
122
+
123
+ DESCRIPTION
124
+ Validate and upload repo config to the platform.
125
+ ```
126
+
59
127
  ## `zitadel autocomplete [SHELL]`
60
128
 
61
129
  Display autocomplete installation instructions.
@@ -118,11 +186,12 @@ _See code: [@oclif/plugin-commands](https://github.com/oclif/plugin-commands/blo
118
186
 
119
187
  ## `zitadel doctor`
120
188
 
121
- Verify generated files and local state.
189
+ Verify local runtime and project state.
122
190
 
123
191
  ```
124
192
  USAGE
125
193
  $ zitadel doctor [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug] [--fix]
194
+ [--image <value>] [--port <value>] [--runtime binary|docker]
126
195
 
127
196
  FLAGS
128
197
  -c, --cwd=<value> Project directory to operate on.
@@ -132,13 +201,17 @@ FLAGS
132
201
  --debug Debug logging.
133
202
  --dry-run Preview without mutating files or the platform.
134
203
  --fix Re-apply missing managed files.
204
+ --image=<value> Container image to check.
205
+ --port=<value> [default: 8080] Local HTTP port.
206
+ --runtime=<option> Local runtime backend.
207
+ <options: binary|docker>
135
208
  --verbose Verbose logging.
136
209
 
137
210
  GLOBAL FLAGS
138
211
  --json Format output as json.
139
212
 
140
213
  DESCRIPTION
141
- Verify generated files and local state.
214
+ Verify local runtime and project state.
142
215
  ```
143
216
 
144
217
  ## `zitadel eject`
@@ -188,6 +261,84 @@ DESCRIPTION
188
261
 
189
262
  _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.49/src/commands/help.ts)_
190
263
 
264
+ ## `zitadel logs`
265
+
266
+ Show local Zitadel server logs.
267
+
268
+ ```
269
+ USAGE
270
+ $ zitadel logs [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug] [--follow]
271
+ [--tail <value>]
272
+
273
+ FLAGS
274
+ -c, --cwd=<value> Project directory to operate on.
275
+ -f, --force Overwrite protected files on conflict.
276
+ -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
277
+ -s, --server=<value> Override the resolved server URL.
278
+ --debug Debug logging.
279
+ --dry-run Preview without mutating files or the platform.
280
+ --follow Follow logs.
281
+ --tail=<value> [default: 200] Number of lines to show.
282
+ --verbose Verbose logging.
283
+
284
+ GLOBAL FLAGS
285
+ --json Format output as json.
286
+
287
+ DESCRIPTION
288
+ Show local Zitadel server logs.
289
+ ```
290
+
291
+ ## `zitadel plan`
292
+
293
+ Validate config without mutation and preview the sync diff.
294
+
295
+ ```
296
+ USAGE
297
+ $ zitadel plan [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug] [-e
298
+ development|preview|production]
299
+
300
+ FLAGS
301
+ -c, --cwd=<value> Project directory to operate on.
302
+ -e, --environment=<option> Target environment (default: development).
303
+ <options: development|preview|production>
304
+ -f, --force Overwrite protected files on conflict.
305
+ -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
306
+ -s, --server=<value> Override the resolved server URL.
307
+ --debug Debug logging.
308
+ --dry-run Preview without mutating files or the platform.
309
+ --verbose Verbose logging.
310
+
311
+ GLOBAL FLAGS
312
+ --json Format output as json.
313
+
314
+ DESCRIPTION
315
+ Validate config without mutation and preview the sync diff.
316
+ ```
317
+
318
+ ## `zitadel reset`
319
+
320
+ Delete the local Zitadel server runtime and data.
321
+
322
+ ```
323
+ USAGE
324
+ $ zitadel reset [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug]
325
+
326
+ FLAGS
327
+ -c, --cwd=<value> Project directory to operate on.
328
+ -f, --force Overwrite protected files on conflict.
329
+ -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
330
+ -s, --server=<value> Override the resolved server URL.
331
+ --debug Debug logging.
332
+ --dry-run Preview without mutating files or the platform.
333
+ --verbose Verbose logging.
334
+
335
+ GLOBAL FLAGS
336
+ --json Format output as json.
337
+
338
+ DESCRIPTION
339
+ Delete the local Zitadel server runtime and data.
340
+ ```
341
+
191
342
  ## `zitadel search`
192
343
 
193
344
  Search for a command.
@@ -211,7 +362,7 @@ Create a Zitadel project and scaffold local auth.
211
362
  ```
212
363
  USAGE
213
364
  $ zitadel setup [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug]
214
- [--framework next] [--renderer react|web-component]
365
+ [--framework next|nuxt|react|vue|angular] [--renderer react|web-component] [--dev-port <value>] [--skip-install]
215
366
 
216
367
  FLAGS
217
368
  -c, --cwd=<value> Project directory to operate on.
@@ -219,11 +370,14 @@ FLAGS
219
370
  -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
220
371
  -s, --server=<value> Override the resolved server URL.
221
372
  --debug Debug logging.
373
+ --dev-port=<value> Dev-server port; also the issuer origin registered with Zitadel. Defaults to the detected
374
+ port. Use distinct ports to run several scaffolded apps side by side.
222
375
  --dry-run Preview without mutating files or the platform.
223
376
  --framework=<option> Framework to target.
224
- <options: next>
377
+ <options: next|nuxt|react|vue|angular>
225
378
  --renderer=<option> Renderer (default: react).
226
379
  <options: react|web-component>
380
+ --skip-install Do not install dependencies after setup updates package.json.
227
381
  --verbose Verbose logging.
228
382
 
229
383
  GLOBAL FLAGS
@@ -234,11 +388,42 @@ DESCRIPTION
234
388
 
235
389
  EXAMPLES
236
390
  $ zitadel setup --framework next
391
+
392
+ $ zitadel setup --framework react --dev-port 3000
393
+ ```
394
+
395
+ ## `zitadel start`
396
+
397
+ Start a local Zitadel server.
398
+
399
+ ```
400
+ USAGE
401
+ $ zitadel start [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug] [--image
402
+ <value>] [--port <value>] [--runtime binary|docker]
403
+
404
+ FLAGS
405
+ -c, --cwd=<value> Project directory to operate on.
406
+ -f, --force Overwrite protected files on conflict.
407
+ -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
408
+ -s, --server=<value> Override the resolved server URL.
409
+ --debug Debug logging.
410
+ --dry-run Preview without mutating files or the platform.
411
+ --image=<value> Container image to run.
412
+ --port=<value> [default: 8080] Local HTTP port.
413
+ --runtime=<option> Local runtime backend.
414
+ <options: binary|docker>
415
+ --verbose Verbose logging.
416
+
417
+ GLOBAL FLAGS
418
+ --json Format output as json.
419
+
420
+ DESCRIPTION
421
+ Start a local Zitadel server.
237
422
  ```
238
423
 
239
424
  ## `zitadel status`
240
425
 
241
- Summarize the local project state.
426
+ Summarize the local Zitadel server and project state.
242
427
 
243
428
  ```
244
429
  USAGE
@@ -257,7 +442,31 @@ GLOBAL FLAGS
257
442
  --json Format output as json.
258
443
 
259
444
  DESCRIPTION
260
- Summarize the local project state.
445
+ Summarize the local Zitadel server and project state.
446
+ ```
447
+
448
+ ## `zitadel stop`
449
+
450
+ Stop the local Zitadel server.
451
+
452
+ ```
453
+ USAGE
454
+ $ zitadel stop [--json] [-c <value>] [-s <value>] [-n] [-f] [--dry-run] [--verbose] [--debug]
455
+
456
+ FLAGS
457
+ -c, --cwd=<value> Project directory to operate on.
458
+ -f, --force Overwrite protected files on conflict.
459
+ -n, --non-interactive Disable prompts. Required when scripting or running as an agent.
460
+ -s, --server=<value> Override the resolved server URL.
461
+ --debug Debug logging.
462
+ --dry-run Preview without mutating files or the platform.
463
+ --verbose Verbose logging.
464
+
465
+ GLOBAL FLAGS
466
+ --json Format output as json.
467
+
468
+ DESCRIPTION
469
+ Stop the local Zitadel server.
261
470
  ```
262
471
 
263
472
  ## `zitadel uninstall`
package/SKILLS.md CHANGED
@@ -4,8 +4,8 @@ description: >-
4
4
  Set up and manage Zitadel authentication in a local project with the
5
5
  agent-friendly `zitadel` CLI. Use when the user wants to add login,
6
6
  registration, or session handling, create a Zitadel project, scaffold auth
7
- routes for a Next.js App Router app, or plan and apply Zitadel config changes
8
- from repo state.
7
+ for a Next.js, React, Vue, Angular, or Nuxt app, or plan and apply Zitadel
8
+ config changes from repo state.
9
9
  ---
10
10
 
11
11
  # Zitadel CLI
@@ -24,9 +24,13 @@ parse the result rather than scraping human output.
24
24
  metadata) or run `zitadel <command> --help` for the full per-command flag list.
25
25
 
26
26
  ```sh
27
- npx @zitadel/cli@latest <command> --non-interactive --json
27
+ npx @zitadel/cli@alpha <command> --non-interactive --json
28
28
  ```
29
29
 
30
+ During the public alpha, bare `npx @zitadel/cli` is promoted to the same tested
31
+ alpha CLI so discovery works for first-time users. Prefer `@alpha` or an exact
32
+ `0.1.0-alpha.N` selector in agent scripts and bug reports for reproducibility.
33
+
30
34
  ## Reading the envelope
31
35
 
32
36
  Each invocation prints one JSON object:
@@ -38,6 +42,16 @@ Each invocation prints one JSON object:
38
42
  - On failure: `code` (e.g. `E_VALIDATION`, `E_NETWORK`, `E_CONFLICT`) and
39
43
  `message`.
40
44
  - `next_commands`: the suggested follow-ups. Prefer these over free-text hints.
45
+ - `E_LOCAL_SERVER_NOT_RUNNING`: start the local runtime with
46
+ `npx @zitadel/cli@alpha start`, then retry with `--server local`.
47
+ - `E_PORT_IN_USE`: the requested local runtime port already has a listener.
48
+ Stop that process, run `npx @zitadel/cli@alpha stop --all` for host-wide
49
+ CLI-managed local runtimes, or choose another `start --port`.
50
+
51
+ Capture stdout and stderr separately when scripting. Some terminals and agent
52
+ UIs display both streams together, but the machine contract is one parseable
53
+ JSON object on stdout; installer, audit, and package-manager progress belongs
54
+ on stderr.
41
55
 
42
56
  Exit codes mirror the error class (3 = validation, 4 = network, 5 = conflict,
43
57
  1 = auth, 2 = not-implemented). An unknown command is handled by the CLI's help
@@ -48,24 +62,103 @@ layer, not the envelope.
48
62
  - `setup` — create a Zitadel project and scaffold local auth (routes,
49
63
  middleware, `.zitadel/**`, env templates). The project's default user schema
50
64
  and login flow are provisioned server-side at creation, so setup neither
51
- scaffolds nor uploads them. Flags: `--framework`, `--renderer`.
65
+ scaffolds nor uploads them. Agents must pass `--framework` when scaffolding
66
+ into a fresh directory; interactive humans can omit it and choose from the
67
+ prompt. Flags: `--framework next|react|vue|angular|nuxt`, `--renderer
68
+ react|web-component` (selects the Next.js auth-page renderer; accepted for any
69
+ framework and recorded in `zitadel.json` branding, but only Next varies its
70
+ generated templates by it), `--dev-port` (dev-server port, also the issuer
71
+ origin registered with Zitadel — use distinct ports to run several scaffolded
72
+ apps side by side), `--skip-install`.
52
73
  - `plan` — validate config and preview the sync diff without mutating anything.
53
74
  - `apply` — validate and upload repo config to the platform.
54
- - `doctor` — verify generated files and local state; `--fix` re-applies missing
55
- managed files.
56
- - `status` summarize the local project state.
75
+ - `doctor` — verify generated app files and local state once `zitadel.json`
76
+ exists. The default local runtime is the `@zitadel/server` npm binary;
77
+ Docker checks apply only when using `--runtime docker` or `--image`.
78
+ `--fix` re-applies missing managed files.
79
+ - `status` — summarize the local runtime and project state.
57
80
  - `eject` (alias `uninstall`) — remove managed files and local Zitadel state;
58
81
  requires `--force` when non-interactive.
82
+ - `start` — start the managed local Zitadel server and persist runtime metadata
83
+ under `.zitadel/local/runtime.json`. Use `--runtime docker` or `--image` for
84
+ the Docker backend.
85
+ - `stop` — stop the managed runtime while preserving
86
+ `.zitadel/local/nextgen-data`. Use `stop --all` to sweep all discovered
87
+ host-wide CLI-managed local runtime processes, including healthy runtimes
88
+ from other local projects; it does not kill arbitrary `/healthz` listeners.
89
+ - `logs` — print managed runtime logs; `--follow` streams in human mode.
90
+ - `reset` — stop/remove the managed runtime and delete local runtime data;
91
+ requires `--force` when non-interactive.
92
+
93
+ Alpha releases are fixed product package trains. `npx @zitadel/cli@alpha start`
94
+ uses the matching `@zitadel/server` package by default. `zitadel start --runtime
95
+ docker --image <ref>` remains the explicit image override for debugging.
59
96
 
60
97
  ## Golden path
61
98
 
62
99
  ```sh
63
- npx @zitadel/cli@latest setup --framework next --non-interactive --json
64
- npx @zitadel/cli@latest doctor --non-interactive --json
65
- npx @zitadel/cli@latest plan --non-interactive --json
66
- npx @zitadel/cli@latest apply --non-interactive --json
100
+ npx @zitadel/cli@alpha doctor --non-interactive --json
101
+ npx @zitadel/cli@alpha start --non-interactive --json
102
+ npx @zitadel/cli@alpha setup --framework next --server local --non-interactive --json
103
+ npx @zitadel/cli@alpha doctor --non-interactive --json
104
+ npx @zitadel/cli@alpha plan --non-interactive --json
105
+ npx @zitadel/cli@alpha apply --non-interactive --json
106
+ ```
107
+
108
+ Exact alpha train invocation:
109
+
110
+ ```sh
111
+ npx @zitadel/cli@0.1.0-alpha.N doctor --non-interactive --json
112
+ npx @zitadel/cli@0.1.0-alpha.N start --non-interactive --json
113
+ npx @zitadel/cli@0.1.0-alpha.N setup --framework next --server local --non-interactive --json
67
114
  ```
68
115
 
116
+ After `setup`, follow `data.next_commands` to start the app. Prove the generated
117
+ auth flow in a visible browser by registering a unique user, logging out, logging
118
+ back in with the same email/password, and ending on the signed-in profile page.
119
+ Do not treat a rendered login or registration form as completion.
120
+
121
+ ### Driving the login UI
122
+
123
+ `<zitadel-login>` and `<zitadel-logout>` are Lit elements with open shadow
124
+ roots. The stable automation hooks live inside nested shadow roots, so a flat
125
+ `document.querySelector('[data-testid="zitadel-input-email"]')` will not find
126
+ the native control. Browser drivers with shadow-DOM-aware locators, such as
127
+ Playwright, can target the hooks directly. Generic DOM-eval drivers should
128
+ pierce shadow roots recursively:
129
+
130
+ ```js
131
+ function deepQuery(sel, root = document) {
132
+ const hit = root.querySelector(sel);
133
+ if (hit) return hit;
134
+ for (const el of root.querySelectorAll("*")) {
135
+ if (el.shadowRoot) {
136
+ const result = deepQuery(sel, el.shadowRoot);
137
+ if (result) return result;
138
+ }
139
+ }
140
+ return null;
141
+ }
142
+ ```
143
+
144
+ Use host hooks such as `zitadel-field-email`, `zitadel-field-password`, and
145
+ `zitadel-action-submit` when targeting the Lit atoms. Use native shadow-control
146
+ hooks such as `zitadel-input-email`, `zitadel-input-password`, and
147
+ `zitadel-action-submit-button` when filling or clicking the underlying input or
148
+ button. For sign-out, open the user menu button if needed, then pierce to
149
+ `.signout-btn`; Playwright-style locators may use `zitadel-logout .signout-btn`.
150
+ The canonical component hook list lives in `packages/components/README.md`.
151
+
152
+ The checked-in automated regression path is `moon run workspace:journey`, which
153
+ exercises fresh-app setup plus registration, logout, and login across the
154
+ supported frameworks.
155
+
69
156
  Repo config is authoritative: edit `zitadel.json` or files under `.zitadel/`,
70
157
  then re-run `plan` and `apply`. Managed files carry a marker comment; `eject`
71
158
  removes only files that still carry it, preserving anything the user replaced.
159
+ For app-local development, `--server local` resolves through
160
+ `.zitadel/local/runtime.json` and requires a healthy `npx @zitadel/cli@alpha start`
161
+ runtime. Runtime-only `.zitadel/local/**` state does not block fresh
162
+ same-directory scaffolding. `setup` installs dependencies with the detected
163
+ package manager by default; pass `--skip-install` when the agent or host
164
+ workflow will install dependencies separately.
@@ -1,8 +1,9 @@
1
- import { o as readZitadelSecret, s as BaseCommand } from "../project-C3pSfbao.mjs";
2
- import { a as makeSyncers, i as runSyncLoop, n as summarizePlan, o as environmentSchema, r as buildSyncPlan, t as renderPlan } from "../sync-Cuyh-X1J.mjs";
1
+ import { t as BaseCommand } from "../oclif-B7lBzh3R.mjs";
2
+ import { o as readZitadelSecret } from "../project-Cd0L3PtM.mjs";
3
+ import { a as makeSyncers, i as runSyncLoop, n as summarizePlan, o as environmentSchema, r as buildSyncPlan, t as renderPlan } from "../sync-BojoQm2P.mjs";
3
4
  import { Flags } from "@oclif/core";
4
- import { consola as consola$1 } from "consola";
5
5
  import { createZitadelClient } from "@zitadel/api/client";
6
+ import { consola as consola$1 } from "consola";
6
7
  //#region src/commands/apply.ts
7
8
  /**
8
9
  * `zitadel apply` — validate and upload repo config to the platform.
@@ -15,7 +16,6 @@ import { createZitadelClient } from "@zitadel/api/client";
15
16
  */
16
17
  var Apply = class Apply extends BaseCommand {
17
18
  static description = "Validate and upload repo config to the platform.";
18
- static hidden = true;
19
19
  static flags = { environment: Flags.string({
20
20
  char: "e",
21
21
  description: "Target environment (default: development).",
@@ -1 +1 @@
1
- {"version":3,"file":"apply.mjs","names":[],"sources":["../../src/commands/apply.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport { consola } from \"consola\";\n\nimport { createZitadelClient } from \"@zitadel/api/client\";\n\nimport { BaseCommand, type JsonEnvelope } from \"../lib/oclif\";\nimport { environmentSchema } from \"../lib/environment\";\nimport { buildSyncPlan, makeSyncers, renderPlan, runSyncLoop, summarizePlan } from \"../lib/sync\";\nimport { readZitadelSecret } from \"../lib/project\";\n\n/**\n * `zitadel apply` — validate and upload repo config to the platform.\n *\n * Runs the sync loop to convergence, or (with `--dry-run`) previews the diff\n * without mutating. All validation — structural shape and `${VAR}` / `*_env`\n * reference presence — happens inside the sync engine ({@link buildSyncPlan}),\n * so an invalid or under-configured file fails with `E_VALIDATION` before any\n * platform call.\n */\nexport default class Apply extends BaseCommand {\n static override description = \"Validate and upload repo config to the platform.\";\n // Temporarily hidden while we collapse the dev workflow around `setup`'s\n // auto-apply. The logic stays wired up so re-exposing this command is a\n // one-line flip when we settle on the surface area.\n static override hidden = true;\n static override flags = {\n environment: Flags.string({\n char: \"e\",\n description: \"Target environment (default: development).\",\n options: [...environmentSchema.options],\n }),\n };\n\n async run(): Promise<JsonEnvelope> {\n const { flags } = await this.parse(Apply);\n await this.toMeta(flags);\n const { cwd, source, env, dryRun, isTTY } = this.meta;\n\n const secret = await readZitadelSecret(cwd);\n consola.info(`Project ${secret.project_id}`);\n consola.info(`Server ${source}`);\n const client = createZitadelClient({\n baseUrl: source,\n token: secret.project_secret,\n });\n const syncers = makeSyncers({ client, projectId: secret.project_id, env });\n\n if (!dryRun) {\n consola.start(\"Syncing schemas and flows to Zitadel\");\n await runSyncLoop(cwd, syncers);\n consola.success(\"Sync complete\");\n return this.emit({ status: \"ok\", data: { synced: true } });\n }\n\n consola.start(\"Building plan (dry run)\");\n const plan = await buildSyncPlan(cwd, syncers, true);\n const summary = summarizePlan(plan);\n consola.success(\n `Plan: ${summary.creates} create${summary.creates === 1 ? \"\" : \"s\"}, ` +\n `${summary.updates} update${summary.updates === 1 ? \"\" : \"s\"}, ` +\n `${summary.deletes} delete${summary.deletes === 1 ? \"\" : \"s\"}`,\n );\n return this.emit({\n status: \"ok\",\n data: summary,\n pretty: renderPlan(plan, isTTY),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,IAAqB,QAArB,MAAqB,cAAc,YAAY;CAC7C,OAAgB,cAAc;CAI9B,OAAgB,SAAS;CACzB,OAAgB,QAAQ,EACtB,aAAa,MAAM,OAAO;EACxB,MAAM;EACN,aAAa;EACb,SAAS,CAAC,GAAG,kBAAkB,QAAQ;EACxC,CAAC,EACH;CAED,MAAM,MAA6B;EACjC,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,MAAM;AACzC,QAAM,KAAK,OAAO,MAAM;EACxB,MAAM,EAAE,KAAK,QAAQ,KAAK,QAAQ,UAAU,KAAK;EAEjD,MAAM,SAAS,MAAM,kBAAkB,IAAI;AAC3C,YAAQ,KAAK,aAAa,OAAO,aAAa;AAC9C,YAAQ,KAAK,aAAa,SAAS;EAKnC,MAAM,UAAU,YAAY;GAAE,QAJf,oBAAoB;IACjC,SAAS;IACT,OAAO,OAAO;IACf,CACmC;GAAE,WAAW,OAAO;GAAY;GAAK,CAAC;AAE1E,MAAI,CAAC,QAAQ;AACX,aAAQ,MAAM,uCAAuC;AACrD,SAAM,YAAY,KAAK,QAAQ;AAC/B,aAAQ,QAAQ,gBAAgB;AAChC,UAAO,KAAK,KAAK;IAAE,QAAQ;IAAM,MAAM,EAAE,QAAQ,MAAM;IAAE,CAAC;;AAG5D,YAAQ,MAAM,0BAA0B;EACxC,MAAM,OAAO,MAAM,cAAc,KAAK,SAAS,KAAK;EACpD,MAAM,UAAU,cAAc,KAAK;AACnC,YAAQ,QACN,SAAS,QAAQ,QAAQ,SAAS,QAAQ,YAAY,IAAI,KAAK,IAAI,IAC9D,QAAQ,QAAQ,SAAS,QAAQ,YAAY,IAAI,KAAK,IAAI,IAC1D,QAAQ,QAAQ,SAAS,QAAQ,YAAY,IAAI,KAAK,MAC5D;AACD,SAAO,KAAK,KAAK;GACf,QAAQ;GACR,MAAM;GACN,QAAQ,WAAW,MAAM,MAAM;GAChC,CAAC"}
1
+ {"version":3,"file":"apply.mjs","names":[],"sources":["../../src/commands/apply.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport { consola } from \"consola\";\n\nimport { createZitadelClient } from \"@zitadel/api/client\";\n\nimport { BaseCommand, type JsonEnvelope } from \"../lib/oclif\";\nimport { environmentSchema } from \"../lib/environment\";\nimport { buildSyncPlan, makeSyncers, renderPlan, runSyncLoop, summarizePlan } from \"../lib/sync\";\nimport { readZitadelSecret } from \"../lib/project\";\n\n/**\n * `zitadel apply` — validate and upload repo config to the platform.\n *\n * Runs the sync loop to convergence, or (with `--dry-run`) previews the diff\n * without mutating. All validation — structural shape and `${VAR}` / `*_env`\n * reference presence — happens inside the sync engine ({@link buildSyncPlan}),\n * so an invalid or under-configured file fails with `E_VALIDATION` before any\n * platform call.\n */\nexport default class Apply extends BaseCommand {\n static override description = \"Validate and upload repo config to the platform.\";\n static override flags = {\n environment: Flags.string({\n char: \"e\",\n description: \"Target environment (default: development).\",\n options: [...environmentSchema.options],\n }),\n };\n\n async run(): Promise<JsonEnvelope> {\n const { flags } = await this.parse(Apply);\n await this.toMeta(flags);\n const { cwd, source, env, dryRun, isTTY } = this.meta;\n\n const secret = await readZitadelSecret(cwd);\n consola.info(`Project ${secret.project_id}`);\n consola.info(`Server ${source}`);\n const client = createZitadelClient({\n baseUrl: source,\n token: secret.project_secret,\n });\n const syncers = makeSyncers({ client, projectId: secret.project_id, env });\n\n if (!dryRun) {\n consola.start(\"Syncing schemas and flows to Zitadel\");\n await runSyncLoop(cwd, syncers);\n consola.success(\"Sync complete\");\n return this.emit({ status: \"ok\", data: { synced: true } });\n }\n\n consola.start(\"Building plan (dry run)\");\n const plan = await buildSyncPlan(cwd, syncers, true);\n const summary = summarizePlan(plan);\n consola.success(\n `Plan: ${summary.creates} create${summary.creates === 1 ? \"\" : \"s\"}, ` +\n `${summary.updates} update${summary.updates === 1 ? \"\" : \"s\"}, ` +\n `${summary.deletes} delete${summary.deletes === 1 ? \"\" : \"s\"}`,\n );\n return this.emit({\n status: \"ok\",\n data: summary,\n pretty: renderPlan(plan, isTTY),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAqB,QAArB,MAAqB,cAAc,YAAY;CAC7C,OAAgB,cAAc;CAC9B,OAAgB,QAAQ,EACtB,aAAa,MAAM,OAAO;EACxB,MAAM;EACN,aAAa;EACb,SAAS,CAAC,GAAG,kBAAkB,QAAQ;EACxC,CAAC,EACH;CAED,MAAM,MAA6B;EACjC,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,MAAM;AACzC,QAAM,KAAK,OAAO,MAAM;EACxB,MAAM,EAAE,KAAK,QAAQ,KAAK,QAAQ,UAAU,KAAK;EAEjD,MAAM,SAAS,MAAM,kBAAkB,IAAI;AAC3C,YAAQ,KAAK,aAAa,OAAO,aAAa;AAC9C,YAAQ,KAAK,aAAa,SAAS;EAKnC,MAAM,UAAU,YAAY;GAAE,QAJf,oBAAoB;IACjC,SAAS;IACT,OAAO,OAAO;IACf,CACmC;GAAE,WAAW,OAAO;GAAY;GAAK,CAAC;AAE1E,MAAI,CAAC,QAAQ;AACX,aAAQ,MAAM,uCAAuC;AACrD,SAAM,YAAY,KAAK,QAAQ;AAC/B,aAAQ,QAAQ,gBAAgB;AAChC,UAAO,KAAK,KAAK;IAAE,QAAQ;IAAM,MAAM,EAAE,QAAQ,MAAM;IAAE,CAAC;;AAG5D,YAAQ,MAAM,0BAA0B;EACxC,MAAM,OAAO,MAAM,cAAc,KAAK,SAAS,KAAK;EACpD,MAAM,UAAU,cAAc,KAAK;AACnC,YAAQ,QACN,SAAS,QAAQ,QAAQ,SAAS,QAAQ,YAAY,IAAI,KAAK,IAAI,IAC9D,QAAQ,QAAQ,SAAS,QAAQ,YAAY,IAAI,KAAK,IAAI,IAC1D,QAAQ,QAAQ,SAAS,QAAQ,YAAY,IAAI,KAAK,MAC5D;AACD,SAAO,KAAK,KAAK;GACf,QAAQ;GACR,MAAM;GACN,QAAQ,WAAW,MAAM,MAAM;GAChC,CAAC"}