@hypercli/cli 0.1.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -0
  3. package/bin/run.js +13 -0
  4. package/dist/autocomplete/base.d.ts +17 -0
  5. package/dist/autocomplete/base.d.ts.map +1 -0
  6. package/dist/autocomplete/base.js +58 -0
  7. package/dist/autocomplete/base.js.map +1 -0
  8. package/dist/autocomplete/completions/bash.d.ts +3 -0
  9. package/dist/autocomplete/completions/bash.d.ts.map +1 -0
  10. package/dist/autocomplete/completions/bash.js +94 -0
  11. package/dist/autocomplete/completions/bash.js.map +1 -0
  12. package/dist/autocomplete/completions/powershell.d.ts +9 -0
  13. package/dist/autocomplete/completions/powershell.d.ts.map +1 -0
  14. package/dist/autocomplete/completions/powershell.js +307 -0
  15. package/dist/autocomplete/completions/powershell.js.map +1 -0
  16. package/dist/autocomplete/completions/shared.d.ts +19 -0
  17. package/dist/autocomplete/completions/shared.d.ts.map +1 -0
  18. package/dist/autocomplete/completions/shared.js +89 -0
  19. package/dist/autocomplete/completions/shared.js.map +1 -0
  20. package/dist/autocomplete/completions/types.d.ts +20 -0
  21. package/dist/autocomplete/completions/types.d.ts.map +1 -0
  22. package/dist/autocomplete/completions/types.js +2 -0
  23. package/dist/autocomplete/completions/types.js.map +1 -0
  24. package/dist/autocomplete/completions/zsh.d.ts +15 -0
  25. package/dist/autocomplete/completions/zsh.d.ts.map +1 -0
  26. package/dist/autocomplete/completions/zsh.js +276 -0
  27. package/dist/autocomplete/completions/zsh.js.map +1 -0
  28. package/dist/autocomplete/dynamic/cache.d.ts +35 -0
  29. package/dist/autocomplete/dynamic/cache.d.ts.map +1 -0
  30. package/dist/autocomplete/dynamic/cache.js +163 -0
  31. package/dist/autocomplete/dynamic/cache.js.map +1 -0
  32. package/dist/autocomplete/dynamic/index.d.ts +10 -0
  33. package/dist/autocomplete/dynamic/index.d.ts.map +1 -0
  34. package/dist/autocomplete/dynamic/index.js +9 -0
  35. package/dist/autocomplete/dynamic/index.js.map +1 -0
  36. package/dist/autocomplete/dynamic/resolver.d.ts +40 -0
  37. package/dist/autocomplete/dynamic/resolver.d.ts.map +1 -0
  38. package/dist/autocomplete/dynamic/resolver.js +164 -0
  39. package/dist/autocomplete/dynamic/resolver.js.map +1 -0
  40. package/dist/autocomplete/dynamic/types.d.ts +39 -0
  41. package/dist/autocomplete/dynamic/types.d.ts.map +1 -0
  42. package/dist/autocomplete/dynamic/types.js +2 -0
  43. package/dist/autocomplete/dynamic/types.js.map +1 -0
  44. package/dist/commands/autocomplete/create.d.ts +30 -0
  45. package/dist/commands/autocomplete/create.d.ts.map +1 -0
  46. package/dist/commands/autocomplete/create.js +141 -0
  47. package/dist/commands/autocomplete/create.js.map +1 -0
  48. package/dist/commands/autocomplete/generate.d.ts +16 -0
  49. package/dist/commands/autocomplete/generate.d.ts.map +1 -0
  50. package/dist/commands/autocomplete/generate.js +59 -0
  51. package/dist/commands/autocomplete/generate.js.map +1 -0
  52. package/dist/commands/autocomplete/index.d.ts +14 -0
  53. package/dist/commands/autocomplete/index.d.ts.map +1 -0
  54. package/dist/commands/autocomplete/index.js +66 -0
  55. package/dist/commands/autocomplete/index.js.map +1 -0
  56. package/dist/commands/autocomplete/script.d.ts +12 -0
  57. package/dist/commands/autocomplete/script.d.ts.map +1 -0
  58. package/dist/commands/autocomplete/script.js +32 -0
  59. package/dist/commands/autocomplete/script.js.map +1 -0
  60. package/dist/commands/config/show.d.ts +12 -0
  61. package/dist/commands/config/show.d.ts.map +1 -0
  62. package/dist/commands/config/show.js +64 -0
  63. package/dist/commands/config/show.js.map +1 -0
  64. package/dist/commands/init.d.ts +11 -0
  65. package/dist/commands/init.d.ts.map +1 -0
  66. package/dist/commands/init.js +76 -0
  67. package/dist/commands/init.js.map +1 -0
  68. package/dist/help/custom-help.d.ts +14 -0
  69. package/dist/help/custom-help.d.ts.map +1 -0
  70. package/dist/help/custom-help.js +110 -0
  71. package/dist/help/custom-help.js.map +1 -0
  72. package/dist/help/theme.d.ts +7 -0
  73. package/dist/help/theme.d.ts.map +1 -0
  74. package/dist/help/theme.js +50 -0
  75. package/dist/help/theme.js.map +1 -0
  76. package/dist/hooks/refresh-cache.d.ts +4 -0
  77. package/dist/hooks/refresh-cache.d.ts.map +1 -0
  78. package/dist/hooks/refresh-cache.js +10 -0
  79. package/dist/hooks/refresh-cache.js.map +1 -0
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +6 -0
  83. package/dist/index.js.map +1 -0
  84. package/help/config/show.md +27 -0
  85. package/help/cookbook.md +19 -0
  86. package/help/recipe.md +32 -0
  87. package/help/root.md +49 -0
  88. package/oclif.manifest.json +214 -0
  89. package/package.json +126 -0
@@ -0,0 +1,66 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { indent, list } from "@hypercli/ui";
3
+ import { c, msg } from "@hypercli/ui/shortcuts";
4
+ import { AutocompleteBase } from "#autocomplete/base";
5
+ import Create from "#commands/autocomplete/create";
6
+ export default class Index extends AutocompleteBase {
7
+ static args = {
8
+ shell: Args.string({
9
+ description: "Shell type",
10
+ options: ["zsh", "bash", "powershell"],
11
+ required: false,
12
+ }),
13
+ };
14
+ static description = "Display autocomplete installation instructions.";
15
+ static examples = [
16
+ "$ <%= config.bin %> autocomplete",
17
+ "$ <%= config.bin %> autocomplete bash",
18
+ "$ <%= config.bin %> autocomplete zsh",
19
+ "$ <%= config.bin %> autocomplete powershell",
20
+ "$ <%= config.bin %> autocomplete --refresh-cache",
21
+ ];
22
+ static flags = {
23
+ "refresh-cache": Flags.boolean({
24
+ char: "r",
25
+ description: "Refresh cache (ignores displaying instructions)",
26
+ }),
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(Index);
30
+ const shell = args.shell ?? this.determineShell(this.config.shell);
31
+ await Create.run([], this.config);
32
+ if (!flags["refresh-cache"]) {
33
+ this.printShellInstructions(shell);
34
+ }
35
+ }
36
+ printShellInstructions(shell) {
37
+ const setupEnvVar = this.getSetupEnvVar(shell);
38
+ const tabStr = shell === "bash" ? "<TAB><TAB>" : "<TAB>";
39
+ const scriptCommand = `${this.config.bin} autocomplete script ${shell}`;
40
+ this.log("Follow the steps below to enable autocomplete for your shell.\n");
41
+ const steps = [];
42
+ switch (shell) {
43
+ case "bash": {
44
+ steps.push(`Run this command in your terminal:\n\n${c.command(`printf "$(${scriptCommand})" >> ~/.bashrc; source ~/.bashrc`)}\n\nThis adds the ${c.command(setupEnvVar)} variable to your Bash config.\n\n${c.bold("NOTE")}: For login shells, use ${c.command("~/.bash_profile")} or ${c.command("~/.profile")} instead.`);
45
+ steps.push(`Start using autocomplete:\n\n${c.command(`${this.config.bin} ${tabStr}`)} # Command completion\n${c.command(`${this.config.bin} command --${tabStr}`)} # Flag completion`);
46
+ break;
47
+ }
48
+ case "powershell": {
49
+ steps.push(`Run these cmdlets in your PowerShell window:\n\n${c.command("New-Item -Type Directory -Path (Split-Path -Parent $PROFILE) -ErrorAction SilentlyContinue")}\n${c.command(`Add-Content -Path $PROFILE -Value (Invoke-Expression -Command "${scriptCommand}"); .$PROFILE`)}`);
50
+ steps.push(`(Optional) Enable menu completion:\n\n${c.command("Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete")}`);
51
+ steps.push(`Start using autocomplete:\n\n${c.command(`${this.config.bin} ${tabStr}`)} # Command completion\n${c.command(`${this.config.bin} command --${tabStr}`)} # Flag completion`);
52
+ break;
53
+ }
54
+ case "zsh": {
55
+ steps.push(`Run this command in your terminal:\n\n${c.command(`printf "$(${scriptCommand})" >> ~/.zshrc; source ~/.zshrc`)}\n\nThis adds the ${c.command(setupEnvVar)} variable to your zsh config.`);
56
+ steps.push(`(Optional) Check for permission conflicts:\n\n${c.command("compaudit -D")}`);
57
+ steps.push(`Start using autocomplete:\n\n${c.command(`${this.config.bin} ${tabStr}`)} # Command completion\n${c.command(`${this.config.bin} command --${tabStr}`)} # Flag completion`);
58
+ break;
59
+ }
60
+ }
61
+ this.log(indent(list(steps, { ordered: true })));
62
+ this.log("");
63
+ this.log(msg.success("Enjoy!"));
64
+ }
65
+ }
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,gBAAgB;IAClD,MAAM,CAAU,IAAI,GAAG;QACtB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC;YACtC,QAAQ,EAAE,KAAK;SACf,CAAC;KACF,CAAC;IAEF,MAAM,CAAU,WAAW,GAAG,iDAAiD,CAAC;IAEhF,MAAM,CAAU,QAAQ,GAAG;QAC1B,kCAAkC;QAClC,uCAAuC;QACvC,sCAAsC;QACtC,6CAA6C;QAC7C,kDAAkD;KAClD,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACvB,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC;YAC9B,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,iDAAiD;SAC9D,CAAC;KACF,CAAC;IAEF,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,IAAI,C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,CAAC,CAAC;QACjD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { AutocompleteBase } from "#autocomplete/base";
2
+ export default class Script extends AutocompleteBase {
3
+ static args: {
4
+ shell: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static hidden: boolean;
8
+ get prefix(): string;
9
+ get suffix(): string;
10
+ run(): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/commands/autocomplete/script.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,gBAAgB;IACnD,OAAgB,IAAI;;MAMlB;IAEF,OAAgB,WAAW,SAAmD;IAC9E,OAAgB,MAAM,UAAQ;IAE9B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB1B"}
@@ -0,0 +1,32 @@
1
+ import path from "node:path";
2
+ import { Args } from "@oclif/core";
3
+ import { AutocompleteBase } from "#autocomplete/base";
4
+ export default class Script extends AutocompleteBase {
5
+ static args = {
6
+ shell: Args.string({
7
+ description: "Shell type",
8
+ options: ["zsh", "bash", "powershell"],
9
+ required: false,
10
+ }),
11
+ };
12
+ static description = "outputs autocomplete config script for shells";
13
+ static hidden = true;
14
+ get prefix() {
15
+ return "\n";
16
+ }
17
+ get suffix() {
18
+ return ` # ${this.cliBin} autocomplete setup\n`;
19
+ }
20
+ async run() {
21
+ const { args } = await this.parse(Script);
22
+ const shell = args.shell ?? this.config.shell;
23
+ if (shell === "powershell") {
24
+ const completionFuncPath = path.join(this.config.cacheDir, "autocomplete", "functions", "powershell", `${this.cliBin}.ps1`);
25
+ this.log(`. ${completionFuncPath}`);
26
+ }
27
+ else {
28
+ this.log(`${this.prefix}${this.getSetupEnvVar(shell)}=${path.join(this.autocompleteCacheDir, `${shell}_setup`)} && test -f $${this.getSetupEnvVar(shell)} && source $${this.getSetupEnvVar(shell)};${this.suffix}`);
29
+ }
30
+ }
31
+ }
32
+ //# sourceMappingURL=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.js","sourceRoot":"","sources":["../../../src/commands/autocomplete/script.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,gBAAgB;IACnD,MAAM,CAAU,IAAI,GAAG;QACtB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC;YACtC,QAAQ,EAAE,KAAK;SACf,CAAC;KACF,CAAC;IAEF,MAAM,CAAU,WAAW,GAAG,+CAA+C,CAAC;IAC9E,MAAM,CAAU,MAAM,GAAG,IAAI,CAAC;IAE9B,IAAI,MAAM;QACT,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,MAAM;QACT,OAAO,MAAM,IAAI,CAAC,MAAM,uBAAuB,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAE9C,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;YAC5B,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,GAAG,IAAI,CAAC,MAAM,MAAM,CACpB,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,KAAK,kBAAkB,EAAE,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,GAAG,CACP,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,KAAK,QAAQ,CAAC,gBAAgB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CACzM,CAAC;QACH,CAAC;IACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class ConfigShow extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<void>;
10
+ private openInFx;
11
+ }
12
+ //# sourceMappingURL=show.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/commands/config/show.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC9C,OAAgB,WAAW,SAA8C;IAEzE,OAAgB,QAAQ,WAGtB;IAEF,OAAgB,KAAK;;;MASnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB1B,OAAO,CAAC,QAAQ;CAmBhB"}
@@ -0,0 +1,64 @@
1
+ import { spawn } from "node:child_process";
2
+ import { HypergenConfigLoader } from "@hypercli/core";
3
+ import { Command, Flags } from "@oclif/core";
4
+ import chalk from "chalk";
5
+ export default class ConfigShow extends Command {
6
+ static description = "Show the resolved Hypergen configuration";
7
+ static examples = [
8
+ "<%= config.bin %> config show",
9
+ "<%= config.bin %> config show --json",
10
+ ];
11
+ static flags = {
12
+ json: Flags.boolean({
13
+ description: "Output raw JSON (no interactive viewer)",
14
+ default: false,
15
+ }),
16
+ cwd: Flags.directory({
17
+ description: "Working directory",
18
+ default: process.cwd(),
19
+ }),
20
+ };
21
+ async run() {
22
+ const { flags } = await this.parse(ConfigShow);
23
+ const cwd = flags.cwd || process.cwd();
24
+ const config = await HypergenConfigLoader.loadConfig(undefined, cwd);
25
+ const json = JSON.stringify(config, null, 2);
26
+ if (flags.json) {
27
+ this.log(json);
28
+ return;
29
+ }
30
+ // Try to open in fx interactive viewer
31
+ const opened = await this.openInFx(json);
32
+ if (!opened) {
33
+ // Fallback: print with basic syntax coloring
34
+ this.log(colorizeJson(json));
35
+ }
36
+ }
37
+ openInFx(json) {
38
+ return new Promise((resolve) => {
39
+ const child = spawn("fx", [], {
40
+ stdio: ["pipe", "inherit", "inherit"],
41
+ });
42
+ child.on("error", () => {
43
+ // fx not available
44
+ resolve(false);
45
+ });
46
+ child.on("close", (code) => {
47
+ resolve(code === 0);
48
+ });
49
+ child.stdin.write(json);
50
+ child.stdin.end();
51
+ });
52
+ }
53
+ }
54
+ /**
55
+ * Basic JSON syntax coloring fallback when fx is not available.
56
+ */
57
+ function colorizeJson(json) {
58
+ return json
59
+ .replace(/("(?:[^"\\]|\\.)*")\s*:/g, (_, key) => `${chalk.cyan(key)}:`)
60
+ .replace(/:\s*("(?:[^"\\]|\\.)*")/g, (match, val) => match.replace(val, chalk.green(val)))
61
+ .replace(/:\s*(\d+(?:\.\d+)?)/g, (match, num) => match.replace(num, chalk.yellow(num)))
62
+ .replace(/:\s*(true|false|null)\b/g, (match, lit) => match.replace(lit, chalk.magenta(lit)));
63
+ }
64
+ //# sourceMappingURL=show.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.js","sourceRoot":"","sources":["../../../src/commands/config/show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC9C,MAAM,CAAU,WAAW,GAAG,0CAA0C,CAAC;IAEzE,MAAM,CAAU,QAAQ,GAAG;QAC1B,+BAA+B;QAC/B,sCAAsC;KACtC,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACvB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE,KAAK;SACd,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;YACpB,WAAW,EAAE,mBAAmB;YAChC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;SACtB,CAAC;KACF,CAAC;IAEF,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAEvC,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAErE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE7C,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YAChB,IAAI,C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C,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;SACzF,OAAO,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SACtF,OAAO,CAAC,0BAA0B,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class Init extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,OAAgB,WAAW,SAA6C;IAExE,OAAgB,QAAQ,WAItB;IAEF,OAAgB,KAAK;;;MAUnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4D1B"}
@@ -0,0 +1,76 @@
1
+ import { existsSync, mkdirSync } from "node:fs";
2
+ import { join, relative } from "node:path";
3
+ import { createConfigFile, findProjectRoot } from "@hypercli/core";
4
+ import { Command, Flags } from "@oclif/core";
5
+ export default class Init extends Command {
6
+ static description = "Initialize Hyper in the current project";
7
+ static examples = [
8
+ "<%= config.bin %> init",
9
+ "<%= config.bin %> init --force",
10
+ "<%= config.bin %> init --cwd ./my-project",
11
+ ];
12
+ static flags = {
13
+ cwd: Flags.directory({
14
+ description: "Working directory",
15
+ default: process.cwd(),
16
+ }),
17
+ force: Flags.boolean({
18
+ char: "f",
19
+ description: "Overwrite existing configuration",
20
+ default: false,
21
+ }),
22
+ };
23
+ async run() {
24
+ const { flags } = await this.parse(Init);
25
+ const cwd = flags.cwd || process.cwd();
26
+ // Detect project root (looks for package.json, git root, etc.)
27
+ let projectRoot;
28
+ try {
29
+ const found = findProjectRoot(cwd);
30
+ projectRoot = found.root;
31
+ }
32
+ catch {
33
+ // No project root found — use cwd
34
+ projectRoot = cwd;
35
+ }
36
+ const configPath = join(projectRoot, "hyper.config.js");
37
+ const recipesDir = join(projectRoot, ".hyper", "recipes");
38
+ const rel = (p) => relative(cwd, p) || ".";
39
+ // Check if already initialized
40
+ if (existsSync(configPath) && !flags.force) {
41
+ this.log(`Already initialized — ${rel(configPath)} exists.`);
42
+ this.log("Use --force to reinitialize.");
43
+ return;
44
+ }
45
+ // Create config file
46
+ if (flags.force && existsSync(configPath)) {
47
+ // createConfigFile throws on existing file, so remove first
48
+ const fs = await import("node:fs");
49
+ fs.unlinkSync(configPath);
50
+ }
51
+ try {
52
+ const created = await createConfigFile(projectRoot, "js");
53
+ this.log(` created ${rel(created)}`);
54
+ }
55
+ catch (error) {
56
+ this.error(`Failed to create config: ${error instanceof Error ? error.message : String(error)}`);
57
+ }
58
+ // Create .hyper/recipes directory
59
+ if (!existsSync(recipesDir)) {
60
+ mkdirSync(recipesDir, { recursive: true });
61
+ this.log(` created ${rel(recipesDir)}/`);
62
+ }
63
+ // Create a .gitkeep so the empty directory is tracked
64
+ const gitkeep = join(recipesDir, ".gitkeep");
65
+ if (!existsSync(gitkeep)) {
66
+ const fs = await import("node:fs");
67
+ fs.writeFileSync(gitkeep, "");
68
+ }
69
+ this.log("");
70
+ this.log("Hyper initialized. Next steps:");
71
+ this.log(" hyper kit install <kit> Install a generator kit");
72
+ this.log(" hyper recipe list List available recipes");
73
+ this.log(" hyper run <recipe> Run a recipe");
74
+ }
75
+ }
76
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAU,WAAW,GAAG,yCAAyC,CAAC;IAExE,MAAM,CAAU,QAAQ,GAAG;QAC1B,wBAAwB;QACxB,gCAAgC;QAChC,2CAA2C;KAC3C,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACvB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;YACpB,WAAW,EAAE,mBAAmB;YAChC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;SACtB,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACpB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,kCAAkC;YAC/C,OAAO,EAAE,KAAK;SACd,CAAC;KACF,CAAC;IAEF,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAEvC,+DAA+D;QAC/D,IAAI,WAAmB,CAAC;QACxB,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;YACnC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC;QAC1B,CAAC;QAAC,MAAM,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AAC;YAC7B,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3C,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC;QAED,sDAAsD;QACtD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;YACnC,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC/B,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;QAChE,IAAI,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAC/D,IAAI,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACtD,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type Command, Help, type Interfaces } from "@oclif/core";
2
+ export default class MarkdownHelp extends Help {
3
+ showCommandHelp(command: Command.Loadable): Promise<void>;
4
+ protected showRootHelp(): Promise<void>;
5
+ protected showTopicHelp(topic: Interfaces.Topic): Promise<void>;
6
+ protected formatTopics(topics: Interfaces.Topic[]): string;
7
+ protected formatCommands(commands: Command.Loadable[]): string;
8
+ private loadMarkdown;
9
+ private loadRootMarkdown;
10
+ private loadTopicMarkdown;
11
+ private readIfExists;
12
+ private showCommandSubInfo;
13
+ }
14
+ //# sourceMappingURL=custom-help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-help.d.ts","sourceRoot":"","sources":["../../src/help/custom-help.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,IAAI;IAC9B,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;cAU/C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAa7B,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;cAoB3D,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,MAAM;cAYhD,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,MAAM;IAiBvE,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,YAAY;YAIN,kBAAkB;CAYhC"}
@@ -0,0 +1,110 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { renderHelp } from "@hypercli/ui/help";
4
+ import { Help } from "@oclif/core";
5
+ export default class MarkdownHelp extends Help {
6
+ async showCommandHelp(command) {
7
+ const md = this.loadMarkdown(command);
8
+ if (md) {
9
+ this.log(renderHelp(md));
10
+ await this.showCommandSubInfo(command);
11
+ }
12
+ else {
13
+ return super.showCommandHelp(command);
14
+ }
15
+ }
16
+ async showRootHelp() {
17
+ const rootMd = this.loadRootMarkdown();
18
+ if (rootMd) {
19
+ this.log(renderHelp(rootMd));
20
+ const topLevelTopics = this.sortedTopics.filter((t) => !t.name.includes(":"));
21
+ const topLevelCommands = this.sortedCommands.filter((c) => !c.id.includes(":"));
22
+ if (topLevelTopics.length > 0)
23
+ this.log(this.formatTopics(topLevelTopics));
24
+ if (topLevelCommands.length > 0)
25
+ this.log(this.formatCommands(topLevelCommands));
26
+ }
27
+ else {
28
+ return super.showRootHelp();
29
+ }
30
+ }
31
+ async showTopicHelp(topic) {
32
+ const md = this.loadTopicMarkdown(topic);
33
+ if (md) {
34
+ this.log(renderHelp(md));
35
+ const depth = topic.name.split(":").length;
36
+ const subTopics = this.sortedTopics.filter((t) => t.name.startsWith(`${topic.name}:`) && t.name.split(":").length === depth + 1);
37
+ const subCommands = this.sortedCommands.filter((c) => c.id.startsWith(`${topic.name}:`) && c.id.split(":").length === depth + 1);
38
+ if (subTopics.length > 0)
39
+ this.log(this.formatTopics(subTopics));
40
+ if (subCommands.length > 0)
41
+ this.log(this.formatCommands(subCommands));
42
+ }
43
+ else {
44
+ return super.showTopicHelp(topic);
45
+ }
46
+ }
47
+ // --- Styled formatters ---
48
+ formatTopics(topics) {
49
+ const visible = topics.filter((t) => !t.hidden);
50
+ if (visible.length === 0)
51
+ return "";
52
+ const rows = visible
53
+ .map((t) => {
54
+ const name = t.name.replaceAll(":", " ");
55
+ return `| \`${name}\` | ${t.description ?? ""} |`;
56
+ })
57
+ .join("\n");
58
+ return renderHelp(`## Topics\n\n| Topic | Description |\n|-------|-------------|\n${rows}`);
59
+ }
60
+ formatCommands(commands) {
61
+ const visible = commands.filter((c) => !c.hidden);
62
+ if (visible.length === 0)
63
+ return "";
64
+ const rows = visible
65
+ .map((c) => {
66
+ const name = c.id.replaceAll(":", " ");
67
+ const desc = this.summary(c);
68
+ return `| \`${name}\` | ${desc} |`;
69
+ })
70
+ .join("\n");
71
+ return renderHelp(`## Commands\n\n| Command | Description |\n|---------|-------------|\n${rows}`);
72
+ }
73
+ // --- Resolution helpers ---
74
+ loadMarkdown(command) {
75
+ const plugin = this.config.plugins.get(command.pluginName ?? "");
76
+ const root = plugin?.root ?? this.config.root;
77
+ const mdPath = `${join(root, "help", ...command.id.split(":"))}.md`;
78
+ return this.readIfExists(mdPath);
79
+ }
80
+ loadRootMarkdown() {
81
+ return this.readIfExists(join(this.config.root, "help", "root.md"));
82
+ }
83
+ loadTopicMarkdown(topic) {
84
+ // Check CLI root first
85
+ const cliPath = `${join(this.config.root, "help", ...topic.name.split(":"))}.md`;
86
+ if (existsSync(cliPath))
87
+ return readFileSync(cliPath, "utf-8");
88
+ // Check all plugins
89
+ for (const plugin of this.config.plugins.values()) {
90
+ const pluginPath = `${join(plugin.root, "help", ...topic.name.split(":"))}.md`;
91
+ if (existsSync(pluginPath))
92
+ return readFileSync(pluginPath, "utf-8");
93
+ }
94
+ return null;
95
+ }
96
+ readIfExists(path) {
97
+ return existsSync(path) ? readFileSync(path, "utf-8") : null;
98
+ }
99
+ async showCommandSubInfo(command) {
100
+ const name = command.id;
101
+ const depth = name.split(":").length;
102
+ const subTopics = this.sortedTopics.filter((t) => t.name.startsWith(`${name}:`) && t.name.split(":").length === depth + 1);
103
+ const subCommands = this.sortedCommands.filter((c) => c.id.startsWith(`${name}:`) && c.id.split(":").length === depth + 1);
104
+ if (subTopics.length > 0)
105
+ this.log(this.formatTopics(subTopics));
106
+ if (subCommands.length > 0)
107
+ this.log(this.formatCommands(subCommands));
108
+ }
109
+ }
110
+ //# sourceMappingURL=custom-help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-help.js","sourceRoot":"","sources":["../../src/help/custom-help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAgB,IAAI,EAAmB,MAAM,aAAa,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,IAAI;IACpC,KAAK,CAAC,eAAe,CAAC,OAAyB;QACvD,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,EAAE,EAAE,CAAC;YACR,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;YACzB,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;aAAM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C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,KAAK,GAAG,CAAC,CAC9E,CAAC;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAC7C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,KAAK,GAAG,CAAC,CAC1E,CAAC;QACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;QACjE,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IACxE,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ import type { HelpThemeConfig } from "@hypercli/core";
2
+ /**
3
+ * Custom cli-html theme for hyper CLI help output.
4
+ * Provides a clean, readable terminal rendering of markdoÍwn help files.
5
+ */
6
+ export declare const helpTheme: HelpThemeConfig;
7
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/help/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eA4CvB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Custom cli-html theme for hyper CLI help output.
3
+ * Provides a clean, readable terminal rendering of markdoÍwn help files.
4
+ */
5
+ export const helpTheme = {
6
+ lineWidth: {
7
+ max: 100,
8
+ },
9
+ theme: {
10
+ h1: {
11
+ color: "blue bold",
12
+ indicator: {
13
+ marker: "▶︎",
14
+ color: "blue bold",
15
+ },
16
+ },
17
+ h2: {
18
+ color: "yellow bold",
19
+ indicator: {
20
+ marker: "▸",
21
+ color: "yellow bold",
22
+ },
23
+ },
24
+ h3: {
25
+ color: "white bold",
26
+ indicator: {
27
+ marker: "▹",
28
+ color: "white bold",
29
+ },
30
+ },
31
+ code: {
32
+ color: "hex-4EC9B0",
33
+ block: {
34
+ color: "gray",
35
+ numbers: {
36
+ enabled: false,
37
+ },
38
+ },
39
+ },
40
+ table: {
41
+ header: {
42
+ color: "white bold",
43
+ },
44
+ },
45
+ a: {
46
+ color: "cyan underline",
47
+ },
48
+ },
49
+ };
50
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/help/theme.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAoB;IACzC,SAAS,EAAE;QACV,GAAG,EAAE,GAAG;KACR;IACD,KAAK,EAAE;QACN,EAAE,EAAE;YACH,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE;gBACV,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,WAAW;aAClB;SACD;QACD,EAAE,EAAE;YACH,KAAK,EAAE,aAAa;YACpB,SAAS,EAAE;gBACV,MAAM,EAAE,GAAG;gBACX,KAAK,EAAE,aAAa;aACpB;SACD;QACD,EAAE,EAAE;YACH,KAAK,EAAE,YAAY;YACnB,SAAS,EAAE;gBACV,MAAM,EAAE,GAAG;gBACX,KAAK,EAAE,YAAY;aACnB;SACD;QACD,IAAI,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,KAAK,EAAE;gBACN,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE;oBACR,OAAO,EAAE,KAAK;iBACd;aACD;SACD;QACD,KAAK,EAAE;YACN,MAAM,EAAE;gBACP,KAAK,EAAE,YAAY;aACnB;SACD;QACD,CAAC,EAAE;YACF,KAAK,EAAE,gBAAgB;SACvB;KACD;CACD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Hook } from "@oclif/core";
2
+ declare const hook: Hook<"plugins:postinstall">;
3
+ export default hook;
4
+ //# sourceMappingURL=refresh-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-cache.d.ts","sourceRoot":"","sources":["../../src/hooks/refresh-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,qBAAqB,CAMrC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ const hook = async (opts) => {
2
+ try {
3
+ await opts.config.runCommand("autocomplete:create");
4
+ }
5
+ catch {
6
+ // Silently fail — don't block kit install/uninstall
7
+ }
8
+ };
9
+ export default hook;
10
+ //# sourceMappingURL=refresh-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-cache.js","sourceRoot":"","sources":["../../src/hooks/refresh-cache.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAgC,KAAK,EAAE,IAAI,EAAE,EAAE;IACxD,IAAI,CAAC;QACJ,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACR,oDAAoD;IACrD,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const version: string;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ // @hypercli/cli - HyperDev CLI
2
+ import { createRequire } from "node:module";
3
+ const require = createRequire(import.meta.url);
4
+ const pkg = require("../package.json");
5
+ export const version = pkg.version;
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC"}
@@ -0,0 +1,27 @@
1
+ # hyper config show
2
+
3
+ Display the resolved Hypergen configuration in an interactive JSON viewer.
4
+
5
+ ## Usage
6
+
7
+ `hyper config show [--json] [--cwd <dir>]`
8
+
9
+ ## Flags
10
+
11
+ | Flag | Description |
12
+ |------|-------------|
13
+ | `--json` | Output raw JSON instead of interactive viewer |
14
+ | `--cwd <dir>` | Set working directory |
15
+
16
+ ## Examples
17
+
18
+ ```sh
19
+ # Open config in interactive fx viewer
20
+ hyper config show
21
+
22
+ # Pipe config as JSON
23
+ hyper config show --json
24
+
25
+ # Show config for a specific project
26
+ hyper config show --cwd ./my-project
27
+ ```
@@ -0,0 +1,19 @@
1
+ # hyper cookbook
2
+
3
+ Cookbooks are curated collections of related recipes bundled inside a kit. Where a single recipe generates one piece of code, a cookbook groups recipes that belong together — for example, all the scaffolding recipes for a Next.js feature.
4
+
5
+ ## Usage
6
+
7
+ `hyper cookbook <command>`
8
+
9
+ ## Quick Start
10
+
11
+ ```sh
12
+ # List all cookbooks from installed kits
13
+ hyper cookbook list
14
+
15
+ # See what's inside a cookbook
16
+ hyper cookbook info starlight
17
+ ```
18
+
19
+ Run `hyper cookbook <command> --help` for details on any subcommand.