@zitadel/cli 1.0.0-alpha.21 → 1.0.0-alpha.23

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 (64) hide show
  1. package/README.md +2248 -227
  2. package/SKILLS.md +246 -58
  3. package/dist/groups-CMB0fMzE.mjs +22 -0
  4. package/dist/groups-CMB0fMzE.mjs.map +1 -0
  5. package/dist/index.mjs +16027 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/lib/oclif/help.mjs +67 -0
  8. package/dist/lib/oclif/help.mjs.map +1 -0
  9. package/oclif.manifest.json +4577 -185
  10. package/package.json +42 -8
  11. package/dist/branding-cygSBPkV.mjs +0 -79
  12. package/dist/branding-cygSBPkV.mjs.map +0 -1
  13. package/dist/claim-state-DlfD6Res.mjs +0 -66
  14. package/dist/claim-state-DlfD6Res.mjs.map +0 -1
  15. package/dist/commands/apply.mjs +0 -81
  16. package/dist/commands/apply.mjs.map +0 -1
  17. package/dist/commands/branding/eject.mjs +0 -104
  18. package/dist/commands/branding/eject.mjs.map +0 -1
  19. package/dist/commands/claim.mjs +0 -415
  20. package/dist/commands/claim.mjs.map +0 -1
  21. package/dist/commands/doctor.mjs +0 -1122
  22. package/dist/commands/doctor.mjs.map +0 -1
  23. package/dist/commands/eject.mjs +0 -157
  24. package/dist/commands/eject.mjs.map +0 -1
  25. package/dist/commands/logs.mjs +0 -58
  26. package/dist/commands/logs.mjs.map +0 -1
  27. package/dist/commands/plan.mjs +0 -65
  28. package/dist/commands/plan.mjs.map +0 -1
  29. package/dist/commands/reset.mjs +0 -79
  30. package/dist/commands/reset.mjs.map +0 -1
  31. package/dist/commands/schemas/list.mjs +0 -146
  32. package/dist/commands/schemas/list.mjs.map +0 -1
  33. package/dist/commands/setup.mjs +0 -1271
  34. package/dist/commands/setup.mjs.map +0 -1
  35. package/dist/commands/start.mjs +0 -288
  36. package/dist/commands/start.mjs.map +0 -1
  37. package/dist/commands/status.mjs +0 -151
  38. package/dist/commands/status.mjs.map +0 -1
  39. package/dist/commands/stop.mjs +0 -105
  40. package/dist/commands/stop.mjs.map +0 -1
  41. package/dist/designs-Ckz18Dpo.mjs +0 -38
  42. package/dist/designs-Ckz18Dpo.mjs.map +0 -1
  43. package/dist/docker-Ev1Ggt9l.mjs +0 -436
  44. package/dist/docker-Ev1Ggt9l.mjs.map +0 -1
  45. package/dist/environment-rjRVkJjW.mjs +0 -17
  46. package/dist/environment-rjRVkJjW.mjs.map +0 -1
  47. package/dist/journey-guidance-BGrOX_gT.mjs +0 -40
  48. package/dist/journey-guidance-BGrOX_gT.mjs.map +0 -1
  49. package/dist/oclif-CanO3zdt.mjs +0 -1769
  50. package/dist/oclif-CanO3zdt.mjs.map +0 -1
  51. package/dist/orca-66vAxeIe.mjs +0 -3917
  52. package/dist/orca-66vAxeIe.mjs.map +0 -1
  53. package/dist/package-manager-DFdLcDx1.mjs +0 -194
  54. package/dist/package-manager-DFdLcDx1.mjs.map +0 -1
  55. package/dist/ports-BM20XIZb.mjs +0 -116
  56. package/dist/ports-BM20XIZb.mjs.map +0 -1
  57. package/dist/processes-DKHPkU8O.mjs +0 -120
  58. package/dist/processes-DKHPkU8O.mjs.map +0 -1
  59. package/dist/project-CHhot85s.mjs +0 -140
  60. package/dist/project-CHhot85s.mjs.map +0 -1
  61. package/dist/sync-BBlACKzT.mjs +0 -1633
  62. package/dist/sync-BBlACKzT.mjs.map +0 -1
  63. package/dist/user-schema-DTuOsdKE.mjs +0 -91
  64. package/dist/user-schema-DTuOsdKE.mjs.map +0 -1
@@ -1,151 +0,0 @@
1
- import { c as checkLocalServerHealth, h as readRuntimeMetadata, j as publicCliCommand, t as BaseCommand, v as runtimeSummary, x as resolveCwd } from "../oclif-CanO3zdt.mjs";
2
- import { n as claimCommand, r as claimState, t as claimAction } from "../claim-state-DlfD6Res.mjs";
3
- import { n as customizeAndPublishActions, r as verifyLoginAction } from "../journey-guidance-BGrOX_gT.mjs";
4
- import { a as readProjectServer, c as readZitadelConfig, l as readZitadelSecret, n as hasZitadelSecret, r as readDevelopmentIssuer, t as hasZitadelConfig } from "../project-CHhot85s.mjs";
5
- import { m as isProcessRunning, s as inspectContainer } from "../docker-Ev1Ggt9l.mjs";
6
- import { createZitadelClient } from "@zitadel/api/client";
7
- //#region src/commands/status.ts
8
- /**
9
- * `zitadel status` — summarize the local server and project state.
10
- *
11
- * This is intentionally informational: a missing `zitadel.json`, stopped
12
- * local server, or orphaned config should be visible without making `status`
13
- * itself fail.
14
- */
15
- var Status = class Status extends BaseCommand {
16
- static description = "Summarize the local Zitadel server and project state.";
17
- async run() {
18
- const { flags } = await this.parse(Status);
19
- const runtime = await readRuntimeMetadata(resolveCwd(typeof flags.cwd === "string" ? flags.cwd : void 0));
20
- if (flags.server === "local") await this.toMeta(flags, {
21
- resolveServer: false,
22
- source: runtime?.server_url ?? "http://localhost:8080"
23
- });
24
- else await this.toMeta(flags);
25
- let docker;
26
- let dockerError;
27
- if (runtime?.backend === "docker") try {
28
- docker = await inspectContainer(runtime.container_name);
29
- } catch (error) {
30
- dockerError = error instanceof Error ? error.message : String(error);
31
- }
32
- const healthy = runtime ? await checkLocalServerHealth(runtime.server_url) : false;
33
- const processRunning = runtime?.backend === "binary" ? isProcessRunning(runtime.pid) : false;
34
- const serverLifecycle = lifecycleForRuntime({
35
- docker,
36
- healthy,
37
- processRunning,
38
- runtime
39
- });
40
- const project = await projectStatus(this.meta.cwd);
41
- const users = project.lifecycle === "configured" ? await detectUserPresence(this.meta.cwd, this.meta.source) : "unknown";
42
- const nextCommands = nextCommandsFor(serverLifecycle, project, users, this.meta.cliVersion);
43
- const nextActions = nextActionsFor(project, users, this.meta.cliVersion);
44
- return this.emit({
45
- status: "ok",
46
- data: {
47
- title: "Zitadel status.",
48
- server: {
49
- lifecycle: serverLifecycle,
50
- runtime: runtimeSummary(runtime),
51
- docker: {
52
- available: dockerError === void 0,
53
- error: dockerError,
54
- container_exists: docker?.exists ?? false,
55
- container_running: docker?.running ?? false
56
- },
57
- process: runtime?.backend === "binary" ? {
58
- pid: runtime.pid,
59
- running: processRunning
60
- } : void 0,
61
- health: {
62
- healthy,
63
- url: runtime?.server_url
64
- }
65
- },
66
- project,
67
- next_actions: nextActions,
68
- next_commands: nextCommands
69
- }
70
- });
71
- }
72
- };
73
- function lifecycleForRuntime(input) {
74
- if (!input.runtime) return "missing";
75
- if (input.runtime.backend === "binary") {
76
- if (input.processRunning && input.healthy) return "running";
77
- return input.processRunning ? "unhealthy" : "stopped";
78
- }
79
- if (input.docker?.running && input.healthy) return "running";
80
- if (input.docker?.exists) return "unhealthy";
81
- return "stopped";
82
- }
83
- async function projectStatus(cwd) {
84
- if (!await hasZitadelConfig(cwd)) return {
85
- lifecycle: "not-configured",
86
- message: "zitadel.json has not been created yet."
87
- };
88
- const config = await readZitadelConfig(cwd);
89
- if (!await hasZitadelSecret(cwd)) return {
90
- lifecycle: "orphaned-config",
91
- project_id: typeof config.project === "string" ? config.project : void 0,
92
- message: "zitadel.json exists but .zitadel/secret is missing."
93
- };
94
- const secret = await readZitadelSecret(cwd);
95
- const claim = claimState({
96
- secret,
97
- server: readProjectServer(config)
98
- });
99
- return {
100
- lifecycle: "configured",
101
- project_id: String(config.project ?? secret.project_id ?? ""),
102
- issuer: readDevelopmentIssuer(config),
103
- ...claim.kind === "not-applicable" ? {} : { claim }
104
- };
105
- }
106
- const PRESENCE_PROBE_TIMEOUT_MS = 1500;
107
- /**
108
- * Whether the project has any users yet — the journey signal that stages the
109
- * guidance: before the first successful registration the next step is
110
- * verifying login, afterwards it is customizing and publishing config. Best
111
- * effort by design: any failure (server unreachable, stale secret, timeout)
112
- * reads as `unknown` and the caller keeps the lifecycle-only output.
113
- */
114
- async function detectUserPresence(cwd, source) {
115
- try {
116
- const probe = createZitadelClient({
117
- baseUrl: source,
118
- token: (await readZitadelSecret(cwd)).project_secret
119
- }).queryUsers({ limit: 1 }, { signal: AbortSignal.timeout(PRESENCE_PROBE_TIMEOUT_MS) }).then(({ users }) => users.length > 0 ? "some" : "none").catch(() => "unknown");
120
- return await Promise.race([probe, new Promise((resolve) => {
121
- setTimeout(() => resolve("unknown"), PRESENCE_PROBE_TIMEOUT_MS + 250).unref();
122
- })]);
123
- } catch {
124
- return "unknown";
125
- }
126
- }
127
- function nextActionsFor(project, users, cliVersion) {
128
- if (project.lifecycle === "not-configured") return ["From your app directory, run setup; the CLI will detect the framework or ask in an empty directory."];
129
- if (project.lifecycle !== "configured") return [];
130
- const claim = project.claim?.kind === "detached" ? [claimAction(cliVersion)] : [];
131
- if (users === "none") return [verifyLoginAction(project.issuer), ...claim];
132
- if (users === "some") return [...customizeAndPublishActions(cliVersion), ...claim];
133
- return claim;
134
- }
135
- function nextCommandsFor(serverLifecycle, project, users, cliVersion) {
136
- const commands = [];
137
- if (serverLifecycle !== "running") commands.push(publicCliCommand("start", cliVersion));
138
- if (project.lifecycle === "not-configured") commands.push(publicCliCommand("setup --server local", cliVersion));
139
- else if (project.lifecycle === "orphaned-config") commands.push(publicCliCommand("setup --force", cliVersion), publicCliCommand("doctor --fix", cliVersion));
140
- else {
141
- commands.push(publicCliCommand("doctor", cliVersion));
142
- if (project.claim?.kind === "detached") commands.push(claimCommand(cliVersion));
143
- if (users === "none") commands.push(publicCliCommand("plan", cliVersion));
144
- else commands.push(publicCliCommand("apply", cliVersion));
145
- }
146
- return commands;
147
- }
148
- //#endregion
149
- export { Status as default };
150
-
151
- //# sourceMappingURL=status.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.mjs","names":[],"sources":["../../src/commands/status.ts"],"sourcesContent":["import { createZitadelClient } from \"@zitadel/api/client\";\n\nimport { claimAction, claimCommand, claimState, type ClaimState } from \"../lib/claim-state\";\nimport { isProcessRunning } from \"../lib/local-server/binary\";\nimport { inspectContainer } from \"../lib/local-server/docker\";\nimport { customizeAndPublishActions, verifyLoginAction } from \"../lib/journey-guidance\";\nimport {\n DEFAULT_LOCAL_SERVER_URL,\n checkLocalServerHealth,\n readRuntimeMetadata,\n runtimeSummary,\n} from \"../lib/local-server/runtime\";\nimport { BaseCommand, type JsonEnvelope } from \"../lib/oclif\";\nimport { resolveCwd } from \"../lib/paths\";\nimport {\n hasZitadelConfig,\n hasZitadelSecret,\n readDevelopmentIssuer,\n readProjectServer,\n readZitadelConfig,\n readZitadelSecret,\n} from \"../lib/project\";\nimport { publicCliCommand } from \"../lib/public-cli\";\n\n/**\n * `zitadel status` — summarize the local server and project state.\n *\n * This is intentionally informational: a missing `zitadel.json`, stopped\n * local server, or orphaned config should be visible without making `status`\n * itself fail.\n */\nexport default class Status extends BaseCommand {\n static override description = \"Summarize the local Zitadel server and project state.\";\n\n async run(): Promise<JsonEnvelope> {\n const { flags } = await this.parse(Status);\n const cwd = resolveCwd(typeof flags.cwd === \"string\" ? flags.cwd : undefined);\n const runtime = await readRuntimeMetadata(cwd);\n if (flags.server === \"local\") {\n await this.toMeta(flags, {\n resolveServer: false,\n source: runtime?.server_url ?? DEFAULT_LOCAL_SERVER_URL,\n });\n } else {\n await this.toMeta(flags);\n }\n let docker: Awaited<ReturnType<typeof inspectContainer>> | undefined;\n let dockerError: string | undefined;\n if (runtime?.backend === \"docker\") {\n try {\n docker = await inspectContainer(runtime.container_name);\n } catch (error) {\n dockerError = error instanceof Error ? error.message : String(error);\n }\n }\n const healthy = runtime ? await checkLocalServerHealth(runtime.server_url) : false;\n const processRunning = runtime?.backend === \"binary\" ? isProcessRunning(runtime.pid) : false;\n const serverLifecycle = lifecycleForRuntime({ docker, healthy, processRunning, runtime });\n\n const project = await projectStatus(this.meta.cwd);\n const users =\n project.lifecycle === \"configured\"\n ? await detectUserPresence(this.meta.cwd, this.meta.source)\n : \"unknown\";\n const nextCommands = nextCommandsFor(serverLifecycle, project, users, this.meta.cliVersion);\n const nextActions = nextActionsFor(project, users, this.meta.cliVersion);\n\n return this.emit({\n status: \"ok\",\n data: {\n title: \"Zitadel status.\",\n server: {\n lifecycle: serverLifecycle,\n runtime: runtimeSummary(runtime),\n docker: {\n available: dockerError === undefined,\n error: dockerError,\n container_exists: docker?.exists ?? false,\n container_running: docker?.running ?? false,\n },\n process:\n runtime?.backend === \"binary\"\n ? {\n pid: runtime.pid,\n running: processRunning,\n }\n : undefined,\n health: {\n healthy,\n url: runtime?.server_url,\n },\n },\n project,\n next_actions: nextActions,\n next_commands: nextCommands,\n },\n });\n }\n}\n\nfunction lifecycleForRuntime(input: {\n docker: Awaited<ReturnType<typeof inspectContainer>> | undefined;\n healthy: boolean;\n processRunning: boolean;\n runtime: Awaited<ReturnType<typeof readRuntimeMetadata>>;\n}): string {\n if (!input.runtime) {\n return \"missing\";\n }\n if (input.runtime.backend === \"binary\") {\n if (input.processRunning && input.healthy) {\n return \"running\";\n }\n return input.processRunning ? \"unhealthy\" : \"stopped\";\n }\n if (input.docker?.running && input.healthy) {\n return \"running\";\n }\n if (input.docker?.exists) {\n return \"unhealthy\";\n }\n return \"stopped\";\n}\n\ntype ProjectStatus =\n | {\n lifecycle: \"not-configured\";\n message: string;\n }\n | {\n lifecycle: \"orphaned-config\";\n project_id?: string;\n message: string;\n }\n | {\n lifecycle: \"configured\";\n project_id: string;\n issuer?: string;\n /**\n * Whether the project is attached to a team, from the local\n * `.zitadel/secret`. Omitted entirely off the cloud, where there is\n * nothing to attach and the field would only invite agents to act on it.\n */\n claim?: ClaimState;\n };\n\nasync function projectStatus(cwd: string): Promise<ProjectStatus> {\n if (!(await hasZitadelConfig(cwd))) {\n return {\n lifecycle: \"not-configured\",\n message: \"zitadel.json has not been created yet.\",\n };\n }\n\n const config = await readZitadelConfig(cwd);\n if (!(await hasZitadelSecret(cwd))) {\n return {\n lifecycle: \"orphaned-config\",\n project_id: typeof config.project === \"string\" ? config.project : undefined,\n message: \"zitadel.json exists but .zitadel/secret is missing.\",\n };\n }\n\n const secret = await readZitadelSecret(cwd);\n // Gated on the server recorded in `zitadel.json`, not `this.meta.source`:\n // `status --server local` rewrites the source for the health probe, but it\n // does not move the project, so the source would answer the wrong question.\n const claim = claimState({ secret, server: readProjectServer(config) });\n return {\n lifecycle: \"configured\",\n project_id: String(config.project ?? secret.project_id ?? \"\"),\n issuer: readDevelopmentIssuer(config),\n ...(claim.kind === \"not-applicable\" ? {} : { claim }),\n };\n}\n\ntype UserPresence = \"none\" | \"some\" | \"unknown\";\n\nconst PRESENCE_PROBE_TIMEOUT_MS = 1500;\n\n/**\n * Whether the project has any users yet — the journey signal that stages the\n * guidance: before the first successful registration the next step is\n * verifying login, afterwards it is customizing and publishing config. Best\n * effort by design: any failure (server unreachable, stale secret, timeout)\n * reads as `unknown` and the caller keeps the lifecycle-only output.\n */\nasync function detectUserPresence(cwd: string, source: string): Promise<UserPresence> {\n try {\n const secret = await readZitadelSecret(cwd);\n const client = createZitadelClient({\n baseUrl: source,\n token: secret.project_secret,\n });\n const probe = client\n .queryUsers({ limit: 1 }, { signal: AbortSignal.timeout(PRESENCE_PROBE_TIMEOUT_MS) })\n .then(({ users }): UserPresence => (users.length > 0 ? \"some\" : \"none\"))\n .catch((): UserPresence => \"unknown\");\n // The abort signal alone is not enough: DNS resolution can outlive it\n // (getaddrinfo runs on the threadpool and some environments take many\n // seconds to fail), and `status` must stay snappy. Race a detached timer\n // so the answer degrades to \"unknown\" at the deadline no matter what the\n // socket layer does; unref'd so it never keeps the CLI process alive.\n return await Promise.race([\n probe,\n new Promise<UserPresence>((resolve) => {\n setTimeout(() => resolve(\"unknown\"), PRESENCE_PROBE_TIMEOUT_MS + 250).unref();\n }),\n ]);\n } catch {\n return \"unknown\";\n }\n}\n\nfunction nextActionsFor(project: ProjectStatus, users: UserPresence, cliVersion: string): string[] {\n if (project.lifecycle === \"not-configured\") {\n return [\n \"From your app directory, run setup; the CLI will detect the framework or ask in an empty directory.\",\n ];\n }\n if (project.lifecycle !== \"configured\") {\n return [];\n }\n // Additive to the journey staging rather than a stage of its own: attaching a\n // team is orthogonal to whether login works yet, so it appends to whichever\n // stage the user is in instead of displacing it.\n const claim = project.claim?.kind === \"detached\" ? [claimAction(cliVersion)] : [];\n if (users === \"none\") {\n return [verifyLoginAction(project.issuer), ...claim];\n }\n if (users === \"some\") {\n return [...customizeAndPublishActions(cliVersion), ...claim];\n }\n return claim;\n}\n\nfunction nextCommandsFor(\n serverLifecycle: string,\n project: ProjectStatus,\n users: UserPresence,\n cliVersion: string,\n): string[] {\n const commands: string[] = [];\n if (serverLifecycle !== \"running\") {\n commands.push(publicCliCommand(\"start\", cliVersion));\n }\n if (project.lifecycle === \"not-configured\") {\n commands.push(publicCliCommand(\"setup --server local\", cliVersion));\n } else if (project.lifecycle === \"orphaned-config\") {\n commands.push(\n publicCliCommand(\"setup --force\", cliVersion),\n publicCliCommand(\"doctor --fix\", cliVersion),\n );\n } else {\n commands.push(publicCliCommand(\"doctor\", cliVersion));\n if (project.claim?.kind === \"detached\") {\n commands.push(claimCommand(cliVersion));\n }\n if (users === \"none\") {\n // Staged like next_actions: before the first login is proven in a\n // browser, publishing is premature — `plan` previews safely and the\n // verify mission lives in next_actions. `apply` joins once users\n // exist (\"some\") or when the probe can't tell (\"unknown\" keeps the\n // lifecycle-only behavior rather than withholding on no signal).\n commands.push(publicCliCommand(\"plan\", cliVersion));\n } else {\n commands.push(publicCliCommand(\"apply\", cliVersion));\n }\n }\n return commands;\n}\n"],"mappings":";;;;;;;;;;;;;;AA+BA,IAAqB,SAArB,MAAqB,eAAe,YAAY;CAC9C,OAAgB,cAAc;CAE9B,MAAM,MAA6B;EACjC,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,OAAO;EAE1C,MAAM,UAAU,MAAM,oBADV,WAAW,OAAO,MAAM,QAAQ,WAAW,MAAM,MAAM,KAAA,EACtB,CAAC;AAC9C,MAAI,MAAM,WAAW,QACnB,OAAM,KAAK,OAAO,OAAO;GACvB,eAAe;GACf,QAAQ,SAAS,cAAA;GAClB,CAAC;MAEF,OAAM,KAAK,OAAO,MAAM;EAE1B,IAAI;EACJ,IAAI;AACJ,MAAI,SAAS,YAAY,SACvB,KAAI;AACF,YAAS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OACZ,QAAO,CAAC,kBAAkB,QAAQ,OAAO,EAAE,GAAG,MAAM;AAEtD,KAAI,UAAU,OACZ,QAAO,CAAC,GAAG,2BAA2B,WAAW,EAAE,GAAG,MAAM;AAE9D,QAAO;;AAGT,SAAS,gBACP,iBACA,SACA,OACA,YACU;CACV,MAAM,WAAqB,EAAE;AAC7B,KAAI,oBAAoB,UACtB,UAAS,KAAK,iBAAiB,SAAS,WAAW,CAAC;AAEtD,KAAI,QAAQ,cAAc,iBACxB,UAAS,KAAK,iBAAiB,wBAAwB,WAAW,CAAC;UAC1D,QAAQ,cAAc,kBAC/B,UAAS,KACP,iBAAiB,iBAAiB,WAAW,EAC7C,iBAAiB,gBAAgB,WAAW,CAC7C;MACI;AACL,WAAS,KAAK,iBAAiB,UAAU,WAAW,CAAC;AACrD,MAAI,QAAQ,OAAO,SAAS,WAC1B,UAAS,KAAK,aAAa,WAAW,CAAC;AAEzC,MAAI,UAAU,OAMZ,UAAS,KAAK,iBAAiB,QAAQ,WAAW,CAAC;MAEnD,UAAS,KAAK,iBAAiB,SAAS,WAAW,CAAC;;AAGxD,QAAO"}
@@ -1,105 +0,0 @@
1
- import { E as ZitadelError, h as readRuntimeMetadata, j as publicCliCommand, p as localContainerName, t as BaseCommand, x as resolveCwd } from "../oclif-CanO3zdt.mjs";
2
- import { g as stopBinaryRuntime, u as stopAndRemoveContainer } from "../docker-Ev1Ggt9l.mjs";
3
- import { t as discoverManagedRuntimeProcesses } from "../processes-DKHPkU8O.mjs";
4
- import { Flags } from "@oclif/core";
5
- //#region src/commands/stop.ts
6
- var Stop = class Stop extends BaseCommand {
7
- static description = "Stop the local Zitadel server.";
8
- static flags = { all: Flags.boolean({ description: "Stop all discovered CLI-managed local Zitadel runtime processes." }) };
9
- async run() {
10
- const { flags } = await this.parse(Stop);
11
- const runtime = await readRuntimeMetadata(resolveCwd(typeof flags.cwd === "string" ? flags.cwd : void 0));
12
- await this.toMeta(flags, {
13
- resolveServer: false,
14
- source: runtime?.server_url ?? "http://localhost:8080"
15
- });
16
- if (flags.all) return this.stopAllManagedRuntimes();
17
- const containerName = runtime?.backend === "docker" ? runtime.container_name : localContainerName(this.meta.cwd);
18
- if (this.meta.dryRun) return this.emit({
19
- status: "ok",
20
- data: {
21
- title: "Local Zitadel server stop plan.",
22
- runtime: {
23
- backend: runtime?.backend ?? "missing",
24
- ...runtime?.backend === "binary" ? {
25
- pid: runtime.pid,
26
- log_path: runtime.log_path
27
- } : { container_name: containerName },
28
- data_preserved: true,
29
- data_dir: runtime?.data_dir
30
- },
31
- next_commands: [publicCliCommand("stop", this.meta.cliVersion)]
32
- }
33
- });
34
- let stopResult;
35
- if (runtime?.backend === "binary") {
36
- stopResult = await stopBinaryRuntime(runtime.pid);
37
- if (stopResult.status === "failed") throw new ZitadelError("E_VALIDATION", "Local Zitadel server did not stop", {
38
- hint: "Inspect the local runtime process and stop it manually, then rerun `zitadel stop`.",
39
- details: {
40
- runtime,
41
- stop_result: stopResult
42
- }
43
- });
44
- } else await stopAndRemoveContainer(containerName);
45
- return this.emit({
46
- status: "ok",
47
- data: {
48
- title: stopResult?.status === "stale" ? "Local Zitadel server was not running." : "Local Zitadel server stopped.",
49
- runtime: {
50
- backend: runtime?.backend ?? "missing",
51
- ...runtime?.backend === "binary" ? {
52
- pid: runtime.pid,
53
- log_path: runtime.log_path,
54
- stop_result: stopResult
55
- } : { container_name: containerName },
56
- data_preserved: true,
57
- data_dir: runtime?.data_dir
58
- }
59
- }
60
- });
61
- }
62
- async stopAllManagedRuntimes() {
63
- const discovery = await discoverManagedRuntimeProcesses();
64
- if (!discovery.supported) return this.emit({
65
- status: "ok",
66
- data: {
67
- title: "Managed local runtime process discovery is unavailable.",
68
- sweep: {
69
- supported: false,
70
- error: discovery.error,
71
- stopped: []
72
- }
73
- },
74
- warnings: ["managed-runtime-processes: discovery unavailable"]
75
- });
76
- const results = [];
77
- for (const processInfo of discovery.processes) results.push({
78
- process: processInfo,
79
- stop_result: await stopBinaryRuntime(processInfo.pid)
80
- });
81
- if (results.filter((result) => result.stop_result.status === "failed").length > 0) throw new ZitadelError("E_VALIDATION", "Some managed local runtime processes did not stop", {
82
- hint: "Inspect the failed process IDs and stop them manually, then rerun `zitadel stop --all`.",
83
- details: {
84
- supported: true,
85
- results
86
- }
87
- });
88
- return this.emit({
89
- status: "ok",
90
- data: {
91
- title: results.length === 0 ? "No host-wide managed local runtime processes found." : "Host-wide managed local runtime processes stopped.",
92
- sweep: {
93
- supported: true,
94
- scope: "host",
95
- count: results.length,
96
- results
97
- }
98
- }
99
- });
100
- }
101
- };
102
- //#endregion
103
- export { Stop as default };
104
-
105
- //# sourceMappingURL=stop.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stop.mjs","names":[],"sources":["../../src/commands/stop.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\n\nimport { ZitadelError } from \"../lib/errors\";\nimport { stopBinaryRuntime, type StopBinaryRuntimeResult } from \"../lib/local-server/binary\";\nimport { stopAndRemoveContainer } from \"../lib/local-server/docker\";\nimport {\n discoverManagedRuntimeProcesses,\n type ManagedRuntimeProcess,\n} from \"../lib/local-server/processes\";\nimport {\n DEFAULT_LOCAL_SERVER_URL,\n localContainerName,\n readRuntimeMetadata,\n} from \"../lib/local-server/runtime\";\nimport { BaseCommand, type JsonEnvelope } from \"../lib/oclif\";\nimport { resolveCwd } from \"../lib/paths\";\nimport { publicCliCommand } from \"../lib/public-cli\";\n\nexport default class Stop extends BaseCommand {\n static override description = \"Stop the local Zitadel server.\";\n static override flags = {\n all: Flags.boolean({\n description: \"Stop all discovered CLI-managed local Zitadel runtime processes.\",\n }),\n };\n\n async run(): Promise<JsonEnvelope> {\n const { flags } = await this.parse(Stop);\n const cwd = resolveCwd(typeof flags.cwd === \"string\" ? flags.cwd : undefined);\n const runtime = await readRuntimeMetadata(cwd);\n await this.toMeta(flags, {\n resolveServer: false,\n source: runtime?.server_url ?? DEFAULT_LOCAL_SERVER_URL,\n });\n\n if (flags.all) {\n return this.stopAllManagedRuntimes();\n }\n\n const containerName =\n runtime?.backend === \"docker\" ? runtime.container_name : localContainerName(this.meta.cwd);\n if (this.meta.dryRun) {\n return this.emit({\n status: \"ok\",\n data: {\n title: \"Local Zitadel server stop plan.\",\n runtime: {\n backend: runtime?.backend ?? \"missing\",\n ...(runtime?.backend === \"binary\"\n ? { pid: runtime.pid, log_path: runtime.log_path }\n : { container_name: containerName }),\n data_preserved: true,\n data_dir: runtime?.data_dir,\n },\n next_commands: [publicCliCommand(\"stop\", this.meta.cliVersion)],\n },\n });\n }\n\n let stopResult: StopBinaryRuntimeResult | undefined;\n if (runtime?.backend === \"binary\") {\n stopResult = await stopBinaryRuntime(runtime.pid);\n if (stopResult.status === \"failed\") {\n throw new ZitadelError(\"E_VALIDATION\", \"Local Zitadel server did not stop\", {\n hint: \"Inspect the local runtime process and stop it manually, then rerun `zitadel stop`.\",\n details: { runtime, stop_result: stopResult },\n });\n }\n } else {\n await stopAndRemoveContainer(containerName);\n }\n\n return this.emit({\n status: \"ok\",\n data: {\n title:\n stopResult?.status === \"stale\"\n ? \"Local Zitadel server was not running.\"\n : \"Local Zitadel server stopped.\",\n runtime: {\n backend: runtime?.backend ?? \"missing\",\n ...(runtime?.backend === \"binary\"\n ? {\n pid: runtime.pid,\n log_path: runtime.log_path,\n stop_result: stopResult,\n }\n : { container_name: containerName }),\n data_preserved: true,\n data_dir: runtime?.data_dir,\n },\n },\n });\n }\n\n private async stopAllManagedRuntimes(): Promise<JsonEnvelope> {\n const discovery = await discoverManagedRuntimeProcesses();\n if (!discovery.supported) {\n return this.emit({\n status: \"ok\",\n data: {\n title: \"Managed local runtime process discovery is unavailable.\",\n sweep: { supported: false, error: discovery.error, stopped: [] },\n },\n warnings: [\"managed-runtime-processes: discovery unavailable\"],\n });\n }\n\n const results: ManagedRuntimeSweepResult[] = [];\n for (const processInfo of discovery.processes) {\n results.push({\n process: processInfo,\n stop_result: await stopBinaryRuntime(processInfo.pid),\n });\n }\n const failed = results.filter((result) => result.stop_result.status === \"failed\");\n if (failed.length > 0) {\n throw new ZitadelError(\"E_VALIDATION\", \"Some managed local runtime processes did not stop\", {\n hint: \"Inspect the failed process IDs and stop them manually, then rerun `zitadel stop --all`.\",\n details: { supported: true, results },\n });\n }\n\n return this.emit({\n status: \"ok\",\n data: {\n title:\n results.length === 0\n ? \"No host-wide managed local runtime processes found.\"\n : \"Host-wide managed local runtime processes stopped.\",\n sweep: {\n supported: true,\n scope: \"host\",\n count: results.length,\n results,\n },\n },\n });\n }\n}\n\ntype ManagedRuntimeSweepResult = Readonly<{\n process: ManagedRuntimeProcess;\n stop_result: StopBinaryRuntimeResult;\n}>;\n"],"mappings":";;;;;AAkBA,IAAqB,OAArB,MAAqB,aAAa,YAAY;CAC5C,OAAgB,cAAc;CAC9B,OAAgB,QAAQ,EACtB,KAAK,MAAM,QAAQ,EACjB,aAAa,oEACd,CAAC,EACH;CAED,MAAM,MAA6B;EACjC,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,KAAK;EAExC,MAAM,UAAU,MAAM,oBADV,WAAW,OAAO,MAAM,QAAQ,WAAW,MAAM,MAAM,KAAA,EACtB,CAAC;AAC9C,QAAM,KAAK,OAAO,OAAO;GACvB,eAAe;GACf,QAAQ,SAAS,cAAA;GAClB,CAAC;AAEF,MAAI,MAAM,IACR,QAAO,KAAK,wBAAwB;EAGtC,MAAM,gBACJ,SAAS,YAAY,WAAW,QAAQ,iBAAiB,mBAAmB,KAAK,KAAK,IAAI;AAC5F,MAAI,KAAK,KAAK,OACZ,QAAO,KAAK,KAAK;GACf,QAAQ;GACR,MAAM;IACJ,OAAO;IACP,SAAS;KACP,SAAS,SAAS,WAAW;KAC7B,GAAI,SAAS,YAAY,WACrB;MAAE,KAAK,QAAQ;MAAK,UAAU,QAAQ;MAAU,GAChD,EAAE,gBAAgB,eAAe;KACrC,gBAAgB;KAChB,UAAU,SAAS;KACpB;IACD,eAAe,CAAC,iBAAiB,QAAQ,KAAK,KAAK,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AQ;KACf;KACD;IACF;GACF,CAAC"}
@@ -1,38 +0,0 @@
1
- //#region src/lib/branding/designs.ts
2
- /**
3
- * Human-facing name and one-line hint for each shipped login design. Shared
4
- * by the setup wizard, `branding eject`, and the setup summary so the label a
5
- * user picks ("Split (reversed)") and the slug the machine records
6
- * (`split-right`) stay visibly paired everywhere — the summary echoing a slug
7
- * the prompt never showed reads as "did my selection apply?".
8
- */
9
- const BRANDING_DESIGN_INFO = {
10
- centered: {
11
- label: "Centered",
12
- hint: "the built-in look, forked as an editable template"
13
- },
14
- split: {
15
- label: "Split",
16
- hint: "brand panel left, form right; narrow containers show a compact brand mark"
17
- },
18
- "split-right": {
19
- label: "Split (reversed)",
20
- hint: "form left, brand panel right; narrow containers show a compact brand mark"
21
- },
22
- hero: {
23
- label: "Hero",
24
- hint: "landing-style brand pane left, form right; editable text fallback when narrow"
25
- },
26
- minimal: {
27
- label: "Minimal",
28
- hint: "no card chrome, fields straight on the page"
29
- }
30
- };
31
- /** The prompt label for a design slug, falling back to the slug itself. */
32
- function brandingDesignLabel(design) {
33
- return BRANDING_DESIGN_INFO[design]?.label ?? design;
34
- }
35
- //#endregion
36
- export { brandingDesignLabel as n, BRANDING_DESIGN_INFO as t };
37
-
38
- //# sourceMappingURL=designs-Ckz18Dpo.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"designs-Ckz18Dpo.mjs","names":[],"sources":["../src/lib/branding/designs.ts"],"sourcesContent":["import type { BrandingDesign } from \"@zitadel/config/defaults\";\n\n/**\n * Human-facing name and one-line hint for each shipped login design. Shared\n * by the setup wizard, `branding eject`, and the setup summary so the label a\n * user picks (\"Split (reversed)\") and the slug the machine records\n * (`split-right`) stay visibly paired everywhere — the summary echoing a slug\n * the prompt never showed reads as \"did my selection apply?\".\n */\nexport const BRANDING_DESIGN_INFO: Record<BrandingDesign, { label: string; hint: string }> = {\n centered: {\n label: \"Centered\",\n hint: \"the built-in look, forked as an editable template\",\n },\n split: {\n label: \"Split\",\n hint: \"brand panel left, form right; narrow containers show a compact brand mark\",\n },\n \"split-right\": {\n label: \"Split (reversed)\",\n hint: \"form left, brand panel right; narrow containers show a compact brand mark\",\n },\n hero: {\n label: \"Hero\",\n hint: \"landing-style brand pane left, form right; editable text fallback when narrow\",\n },\n minimal: {\n label: \"Minimal\",\n hint: \"no card chrome, fields straight on the page\",\n },\n};\n\n/** The prompt label for a design slug, falling back to the slug itself. */\nexport function brandingDesignLabel(design: string): string {\n return (BRANDING_DESIGN_INFO as Record<string, { label: string }>)[design]?.label ?? design;\n}\n"],"mappings":";;;;;;;;AASA,MAAa,uBAAgF;CAC3F,UAAU;EACR,OAAO;EACP,MAAM;EACP;CACD,OAAO;EACL,OAAO;EACP,MAAM;EACP;CACD,eAAe;EACb,OAAO;EACP,MAAM;EACP;CACD,MAAM;EACJ,OAAO;EACP,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,MAAM;EACP;CACF;;AAGD,SAAgB,oBAAoB,QAAwB;AAC1D,QAAQ,qBAA2D,SAAS,SAAS"}