@zitadel/cli 0.1.0-alpha.9 → 0.2.0

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 (49) hide show
  1. package/README.md +4043 -229
  2. package/bin/run.js +8 -0
  3. package/dist/index.mjs +24173 -0
  4. package/dist/index.mjs.map +1 -0
  5. package/dist/lib/oclif/help.mjs +117 -0
  6. package/dist/lib/oclif/help.mjs.map +1 -0
  7. package/dist/skills-hint-CBoak9HL.mjs +4348 -0
  8. package/dist/skills-hint-CBoak9HL.mjs.map +1 -0
  9. package/oclif.manifest.json +8635 -253
  10. package/package.json +106 -15
  11. package/skills/zitadel-cli/SKILL.md +538 -0
  12. package/skills/zitadel-cli/references/driving-login-ui.md +109 -0
  13. package/SKILLS.md +0 -157
  14. package/dist/commands/apply.mjs +0 -62
  15. package/dist/commands/apply.mjs.map +0 -1
  16. package/dist/commands/doctor.mjs +0 -569
  17. package/dist/commands/doctor.mjs.map +0 -1
  18. package/dist/commands/eject.mjs +0 -145
  19. package/dist/commands/eject.mjs.map +0 -1
  20. package/dist/commands/logs.mjs +0 -58
  21. package/dist/commands/logs.mjs.map +0 -1
  22. package/dist/commands/plan.mjs +0 -52
  23. package/dist/commands/plan.mjs.map +0 -1
  24. package/dist/commands/reset.mjs +0 -79
  25. package/dist/commands/reset.mjs.map +0 -1
  26. package/dist/commands/setup.mjs +0 -856
  27. package/dist/commands/setup.mjs.map +0 -1
  28. package/dist/commands/start.mjs +0 -288
  29. package/dist/commands/start.mjs.map +0 -1
  30. package/dist/commands/status.mjs +0 -112
  31. package/dist/commands/status.mjs.map +0 -1
  32. package/dist/commands/stop.mjs +0 -105
  33. package/dist/commands/stop.mjs.map +0 -1
  34. package/dist/docker-CnGQK3ZK.mjs +0 -432
  35. package/dist/docker-CnGQK3ZK.mjs.map +0 -1
  36. package/dist/docker-guidance-ypN3IM3o.mjs +0 -21
  37. package/dist/docker-guidance-ypN3IM3o.mjs.map +0 -1
  38. package/dist/oclif-B7lBzh3R.mjs +0 -808
  39. package/dist/oclif-B7lBzh3R.mjs.map +0 -1
  40. package/dist/orca-U142Wrau.mjs +0 -2556
  41. package/dist/orca-U142Wrau.mjs.map +0 -1
  42. package/dist/ports-B09RjuHx.mjs +0 -111
  43. package/dist/ports-B09RjuHx.mjs.map +0 -1
  44. package/dist/processes-Cw8TO1SY.mjs +0 -120
  45. package/dist/processes-Cw8TO1SY.mjs.map +0 -1
  46. package/dist/project-Cd0L3PtM.mjs +0 -87
  47. package/dist/project-Cd0L3PtM.mjs.map +0 -1
  48. package/dist/sync-BojoQm2P.mjs +0 -733
  49. package/dist/sync-BojoQm2P.mjs.map +0 -1
@@ -0,0 +1,117 @@
1
+ import { A as compareInGroup, O as COMMAND_GROUPS, i as exploreAllCommands, k as CommandGroups, t as showSkillsHint } from "../../skills-hint-CBoak9HL.mjs";
2
+ import { Help, toConfiguredId, ux } from "@oclif/core";
3
+ //#region src/lib/oclif/help.ts
4
+ /**
5
+ * Summaries for oclif plugin commands that ship without one. `version` prints
6
+ * a blank line otherwise.
7
+ */
8
+ const PLUGIN_SUMMARIES = { version: "Show the CLI version" };
9
+ /**
10
+ * Root help in the style of `gh --help`: a tagline, usage, the commands under
11
+ * headed groups, then flags and examples. A family of commands (`users`,
12
+ * `release`) is one row, and its own help lists the operations. Only
13
+ * {@link showRootHelp} is replaced; per-command and per-topic help
14
+ * (`start --help`, `schemas --help`) stay oclif's own, with a pointer back to
15
+ * the root screen added. Wired in via `oclif.helpClass` in `package.json`.
16
+ */
17
+ var ZitadelHelp = class extends Help {
18
+ async showRootHelp() {
19
+ const { bin } = this.config;
20
+ const commands = this.rootCommands();
21
+ const groups = COMMAND_GROUPS.map((group) => [group, this.rowsOf(this.commandsOf(commands, group))]).filter(([, rows]) => rows.length > 0);
22
+ const width = Math.max(0, ...groups.flatMap(([, rows]) => rows.map((row) => row.name.length)));
23
+ const list = (rows) => rows.map((row) => `${row.name.padEnd(width)} ${row.summary}`).join("\n");
24
+ const sections = [
25
+ this.render(this.config.pjson.oclif.description ?? this.config.pjson.description ?? ""),
26
+ this.section("Usage", `${bin} <command> [flags]`),
27
+ `Run a command below. Use \`${bin} <command> --help\` to see its options.`,
28
+ ...groups.map(([group, rows]) => this.section(group, list(rows))),
29
+ this.section("Flags", ["--help Show help for command", `--version Show ${bin} version`].join("\n")),
30
+ this.section("Examples", [
31
+ `$ ${bin} setup --framework next`,
32
+ `$ ${bin} start`,
33
+ `$ ${bin} doctor`
34
+ ].join("\n"))
35
+ ];
36
+ if (process.argv.length <= 2) await showSkillsHint({
37
+ env: process.env,
38
+ interactive: Boolean(process.stdout.isTTY && process.stdin.isTTY)
39
+ });
40
+ this.log(sections.join("\n\n"));
41
+ }
42
+ async showCommandHelp(command) {
43
+ await super.showCommandHelp(command);
44
+ this.log(exploreAllCommands(this.config.version));
45
+ }
46
+ async showTopicHelp(topic) {
47
+ await super.showTopicHelp(topic);
48
+ this.log(exploreAllCommands(this.config.version));
49
+ }
50
+ /**
51
+ * The commands the root screen lists: every visible command, grouped or
52
+ * not, whatever its depth. Alias entries and `help` itself are left out.
53
+ */
54
+ rootCommands() {
55
+ return this.sortedCommands.filter((command) => command.id !== "help" && !command.aliases?.includes(command.id));
56
+ }
57
+ /**
58
+ * The commands a group lists. oclif's own utilities declare no group and are
59
+ * listed with the last one.
60
+ */
61
+ commandsOf(commands, group) {
62
+ return commands.filter((command) => command.group === group || command.group === void 0 && group === CommandGroups.diagnostics);
63
+ }
64
+ /**
65
+ * The rows of one group. Commands sharing a first word (`users create`,
66
+ * `users get`) are one row named for it, described by the topic when it has
67
+ * a description and otherwise by the command of that name; a command on its
68
+ * own keeps its name. Rows follow `groupOrder` (the lowest of a family's
69
+ * commands), then the name.
70
+ */
71
+ rowsOf(commands) {
72
+ const families = /* @__PURE__ */ new Map();
73
+ for (const command of commands) {
74
+ const [family = command.id] = command.id.split(":");
75
+ families.set(family, [...families.get(family) ?? [], command]);
76
+ }
77
+ return [...families].map(([family, members]) => {
78
+ const order = Math.min(...members.map((member) => member.groupOrder ?? Number.MAX_SAFE_INTEGER));
79
+ if (!members.some((member) => member.id.includes(":"))) {
80
+ const [only] = members;
81
+ return {
82
+ name: toConfiguredId(family, this.config),
83
+ summary: this.oneLineSummary(only?.summary ?? only?.description, only?.id),
84
+ order
85
+ };
86
+ }
87
+ const topic = this.config.topics.find((candidate) => candidate.name === family);
88
+ const root = members.find((member) => member.id === family) ?? members[0];
89
+ return {
90
+ name: toConfiguredId(family, this.config),
91
+ summary: this.oneLineSummary(topic?.description ?? root?.summary ?? root?.description),
92
+ order
93
+ };
94
+ }).sort((a, b) => compareInGroup({
95
+ id: a.name,
96
+ groupOrder: a.order
97
+ }, {
98
+ id: b.name,
99
+ groupOrder: b.order
100
+ }));
101
+ }
102
+ /**
103
+ * The summary as `gh` prints it: the first clause of the summary or
104
+ * description, with no trailing full stop. Built from the raw statics rather
105
+ * than {@link summary} so a user theme's colour codes cannot end up inside
106
+ * the clause; the theme is applied once the text is final.
107
+ */
108
+ oneLineSummary(text, id) {
109
+ const source = (id === void 0 ? void 0 : PLUGIN_SUMMARIES[id]) ?? text ?? "";
110
+ const [clause = ""] = this.render(source).split(/[.:]\s|\n/, 1);
111
+ return ux.colorize(this.config.theme?.commandSummary, clause.trim().replace(/\.$/, ""));
112
+ }
113
+ };
114
+ //#endregion
115
+ export { ZitadelHelp as default };
116
+
117
+ //# sourceMappingURL=help.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.mjs","names":[],"sources":["../../../src/lib/oclif/help.ts"],"sourcesContent":["import { type Command, Help, type Interfaces, toConfiguredId, ux } from \"@oclif/core\";\n\nimport { exploreAllCommands } from \"../journey-guidance\";\nimport { showSkillsHint } from \"../skills-hint\";\nimport { COMMAND_GROUPS, type CommandGroup, CommandGroups, compareInGroup } from \"./groups\";\n\n/** A loaded command plus the root-help statics `BaseCommand` (`./base`) declares. */\ntype GroupedCommand = Command.Loadable & { group?: CommandGroup; groupOrder?: number };\n\n/** One line of the root screen: a command, or a family of commands under one name. */\ntype Row = { name: string; summary: string; order: number };\n\n/**\n * Summaries for oclif plugin commands that ship without one. `version` prints\n * a blank line otherwise.\n */\nconst PLUGIN_SUMMARIES: Readonly<Record<string, string>> = {\n version: \"Show the CLI version\",\n};\n\n/**\n * Root help in the style of `gh --help`: a tagline, usage, the commands under\n * headed groups, then flags and examples. A family of commands (`users`,\n * `release`) is one row, and its own help lists the operations. Only\n * {@link showRootHelp} is replaced; per-command and per-topic help\n * (`start --help`, `schemas --help`) stay oclif's own, with a pointer back to\n * the root screen added. Wired in via `oclif.helpClass` in `package.json`.\n */\nexport default class ZitadelHelp extends Help {\n protected override async showRootHelp(): Promise<void> {\n const { bin } = this.config;\n const commands = this.rootCommands();\n const groups = COMMAND_GROUPS.map(\n (group) => [group, this.rowsOf(this.commandsOf(commands, group))] as const,\n ).filter(([, rows]) => rows.length > 0);\n const width = Math.max(0, ...groups.flatMap(([, rows]) => rows.map((row) => row.name.length)));\n const list = (rows: readonly Row[]): string =>\n rows.map((row) => `${row.name.padEnd(width)} ${row.summary}`).join(\"\\n\");\n\n const sections = [\n this.render(this.config.pjson.oclif.description ?? this.config.pjson.description ?? \"\"),\n this.section(\"Usage\", `${bin} <command> [flags]`),\n `Run a command below. Use \\`${bin} <command> --help\\` to see its options.`,\n ...groups.map(([group, rows]) => this.section(group, list(rows))),\n this.section(\n \"Flags\",\n [\"--help Show help for command\", `--version Show ${bin} version`].join(\"\\n\"),\n ),\n this.section(\n \"Examples\",\n [`$ ${bin} setup --framework next`, `$ ${bin} start`, `$ ${bin} doctor`].join(\"\\n\"),\n ),\n ];\n // Only a bare `zitadel`, not `zitadel --help` or an unknown command's help.\n if (process.argv.length <= 2) {\n await showSkillsHint({\n env: process.env,\n interactive: Boolean(process.stdout.isTTY && process.stdin.isTTY),\n });\n }\n this.log(sections.join(\"\\n\\n\"));\n }\n\n override async showCommandHelp(command: Command.Loadable): Promise<void> {\n await super.showCommandHelp(command);\n this.log(exploreAllCommands(this.config.version));\n }\n\n override async showTopicHelp(topic: Interfaces.Topic): Promise<void> {\n await super.showTopicHelp(topic);\n this.log(exploreAllCommands(this.config.version));\n }\n\n /**\n * The commands the root screen lists: every visible command, grouped or\n * not, whatever its depth. Alias entries and `help` itself are left out.\n */\n private rootCommands(): GroupedCommand[] {\n return (this.sortedCommands as GroupedCommand[]).filter(\n (command) => command.id !== \"help\" && !command.aliases?.includes(command.id),\n );\n }\n\n /**\n * The commands a group lists. oclif's own utilities declare no group and are\n * listed with the last one.\n */\n private commandsOf(commands: readonly GroupedCommand[], group: CommandGroup): GroupedCommand[] {\n return commands.filter(\n (command) =>\n command.group === group ||\n (command.group === undefined && group === CommandGroups.diagnostics),\n );\n }\n\n /**\n * The rows of one group. Commands sharing a first word (`users create`,\n * `users get`) are one row named for it, described by the topic when it has\n * a description and otherwise by the command of that name; a command on its\n * own keeps its name. Rows follow `groupOrder` (the lowest of a family's\n * commands), then the name.\n */\n private rowsOf(commands: readonly GroupedCommand[]): Row[] {\n const families = new Map<string, GroupedCommand[]>();\n for (const command of commands) {\n const [family = command.id] = command.id.split(\":\");\n families.set(family, [...(families.get(family) ?? []), command]);\n }\n const rows = [...families].map(([family, members]): Row => {\n const order = Math.min(\n ...members.map((member) => member.groupOrder ?? Number.MAX_SAFE_INTEGER),\n );\n const isFamily = members.some((member) => member.id.includes(\":\"));\n if (!isFamily) {\n const [only] = members;\n return {\n name: toConfiguredId(family, this.config),\n summary: this.oneLineSummary(only?.summary ?? only?.description, only?.id),\n order,\n };\n }\n const topic = this.config.topics.find((candidate) => candidate.name === family);\n const root = members.find((member) => member.id === family) ?? members[0];\n return {\n name: toConfiguredId(family, this.config),\n summary: this.oneLineSummary(topic?.description ?? root?.summary ?? root?.description),\n order,\n };\n });\n return rows.sort((a, b) =>\n compareInGroup({ id: a.name, groupOrder: a.order }, { id: b.name, groupOrder: b.order }),\n );\n }\n\n /**\n * The summary as `gh` prints it: the first clause of the summary or\n * description, with no trailing full stop. Built from the raw statics rather\n * than {@link summary} so a user theme's colour codes cannot end up inside\n * the clause; the theme is applied once the text is final.\n */\n private oneLineSummary(text: string | undefined, id?: string): string {\n const source = (id === undefined ? undefined : PLUGIN_SUMMARIES[id]) ?? text ?? \"\";\n const [clause = \"\"] = this.render(source).split(/[.:]\\s|\\n/, 1);\n return ux.colorize(this.config.theme?.commandSummary, clause.trim().replace(/\\.$/, \"\"));\n }\n}\n"],"mappings":";;;;;;;AAgBA,MAAM,mBAAqD,EACzD,SAAS,uBACX;;;;;;;;;AAUA,IAAqB,cAArB,cAAyC,KAAK;CAC5C,MAAyB,eAA8B;EACrD,MAAM,EAAE,QAAQ,KAAK;EACrB,MAAM,WAAW,KAAK,aAAa;EACnC,MAAM,SAAS,eAAe,KAC3B,UAAU,CAAC,OAAO,KAAK,OAAO,KAAK,WAAW,UAAU,KAAK,CAAC,CAAC,CAClE,CAAC,CAAC,QAAQ,GAAG,UAAU,KAAK,SAAS,CAAC;EACtC,MAAM,QAAQ,KAAK,IAAI,GAAG,GAAG,OAAO,SAAS,GAAG,UAAU,KAAK,KAAK,QAAQ,IAAI,KAAK,MAAM,CAAC,CAAC;EAC7F,MAAM,QAAQ,SACZ,KAAK,KAAK,QAAQ,GAAG,IAAI,KAAK,OAAO,KAAK,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,IAAI;EAE1E,MAAM,WAAW;GACf,KAAK,OAAO,KAAK,OAAO,MAAM,MAAM,eAAe,KAAK,OAAO,MAAM,eAAe,EAAE;GACtF,KAAK,QAAQ,SAAS,GAAG,IAAI,mBAAmB;GAChD,8BAA8B,IAAI;GAClC,GAAG,OAAO,KAAK,CAAC,OAAO,UAAU,KAAK,QAAQ,OAAO,KAAK,IAAI,CAAC,CAAC;GAChE,KAAK,QACH,SACA,CAAC,qCAAqC,oBAAoB,IAAI,SAAS,CAAC,CAAC,KAAK,IAAI,CACpF;GACA,KAAK,QACH,YACA;IAAC,KAAK,IAAI;IAA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