Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@hypercli/gen

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypercli/gen - npm Package Compare versions

Comparing version
0.2.3
to
0.3.0
+22
dist/commands/cookbook/info.d.ts
/**
* Show detailed information about a cookbook
*/
import { BaseCommand } from "#lib/base-command";
export default class CookbookInfo extends BaseCommand<typeof CookbookInfo> {
static description: string;
static examples: string[];
static flags: {
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
};
static args: {
cookbook: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
};
run(): Promise<void>;
/**
* Display available cookbooks grouped by kit when a cookbook is not found
*/
private suggestAvailableCookbooks;
}
//# sourceMappingURL=info.d.ts.map
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW,CAAC,OAAO,YAAY,CAAC;IACzE,OAAgB,WAAW,SAAgD;IAE3E,OAAgB,QAAQ,WAGtB;IAEF,OAAgB,KAAK;;;;MAMnB;IAEF,OAAgB,IAAI;;MAKlB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAqL1B;;OAEG;YACW,yBAAyB;CAmEvC"}
/**
* Show detailed information about a cookbook
*/
import path from "node:path";
import { c, s } from "@hypercli/ui/shortcuts";
import { Args, Flags } from "@oclif/core";
import { BaseCommand } from "#lib/base-command";
export default class CookbookInfo extends BaseCommand {
static description = "Show detailed information about a cookbook";
static examples = [
"<%= config.bin %> cookbook info starlight",
"<%= config.bin %> cookbook info @kit/starlight/docs --json",
];
static flags = {
...BaseCommand.baseFlags,
json: Flags.boolean({
description: "Output as JSON",
default: false,
}),
};
static args = {
cookbook: Args.string({
description: "Cookbook name or path",
required: true,
}),
};
async run() {
const { args, flags } = await this.parse(CookbookInfo);
try {
this.log(s.hint(`Searching for cookbook: ${args.cookbook}...`));
// 1. Discover all kits
const generators = await this.discovery.discoverAll();
// 2. Find the cookbook in the discovered kits
let foundCookbook;
// Helper to match cookbook name
const targetCookbook = args.cookbook;
for (const generator of generators) {
// We only care about kits (generators with cookbooks)
if (!generator.cookbooks || generator.cookbooks.length === 0)
continue;
// Check if this kit contains the requested cookbook
if (generator.cookbooks.includes(targetCookbook)) {
// Found it! Now we need the path.
// We need to re-parse the kit to get the cookbook globs and find the path
// (GeneratorDiscovery only gives us names)
// Import from @hypercli/core
const { parseKitFile, discoverCookbooksInKit } = await import("@hypercli/core");
const kitYmlPath = path.join(generator.path, "kit.yml");
const parsedKit = await parseKitFile(kitYmlPath);
if (parsedKit.isValid && parsedKit.config.cookbooks) {
const cookbooks = await discoverCookbooksInKit(generator.path, parsedKit.config.cookbooks);
const cookbook = cookbooks.get(targetCookbook);
if (cookbook) {
foundCookbook = {
kitName: generator.name,
kitPath: generator.path,
cookbookName: cookbook.config.name,
cookbookPath: cookbook.dirPath,
config: cookbook.config,
};
break; // Stop searching once found
}
}
}
}
if (!foundCookbook) {
this.log(s.error(`Cookbook not found: ${args.cookbook}`));
await this.suggestAvailableCookbooks(generators);
this.exit(1);
}
// 3. Discover recipes in the cookbook
const { discoverRecipesInCookbook } = await import("@hypercli/core");
// Default recipe globs if not specified in cookbook config
const recipeGlobs = foundCookbook.config.recipes || ["./*/recipe.yml"];
const recipeMap = await discoverRecipesInCookbook(foundCookbook.cookbookPath, recipeGlobs);
const recipePaths = Array.from(recipeMap.values());
// 4. Load recipe details
const recipesWithDetails = [];
for (const recipePath of recipePaths) {
try {
const { recipe } = await this.recipeEngine.loadRecipe(recipePath);
recipesWithDetails.push(recipe);
}
catch (e) {
// Log warning but continue
this.warn(`Failed to load recipe at ${recipePath}: ${e instanceof Error ? e.message : String(e)}`);
}
}
// Sort recipes by name
recipesWithDetails.sort((a, b) => a.name.localeCompare(b.name));
if (flags.json) {
const output = {
name: foundCookbook.cookbookName,
kit: foundCookbook.kitName,
location: foundCookbook.cookbookPath,
description: foundCookbook.config.description,
recipes: recipesWithDetails,
};
this.log(JSON.stringify(output, null, 2));
return;
}
// 5. Display Information
this.log("");
this.log(s.title("Cookbook", foundCookbook.cookbookName));
this.log(s.hr());
this.log(s.keyValue("Location", s.path(foundCookbook.cookbookPath), 10));
this.log(s.keyValue("Kit", c.kit(foundCookbook.kitName), 10));
if (foundCookbook.config.description) {
this.log(s.keyValue("Description", foundCookbook.config.description, 10));
}
this.log("");
this.log(s.header("Recipes", recipesWithDetails.length));
if (recipesWithDetails.length === 0) {
this.log(s.description("(No recipes found)", 2));
}
else {
for (const recipe of recipesWithDetails) {
this.log("");
this.log(s.listItem(c.recipe(recipe.name)));
if (recipe.description) {
this.log(s.description(recipe.description));
}
if (recipe.variables && Object.keys(recipe.variables).length > 0) {
this.log(s.indent(c.helper("Variables:"), 4));
for (const [key, variable] of Object.entries(recipe.variables)) {
const varAny = variable;
let varLine = c.property(` ${key}`);
if (varAny.type) {
varLine += c.subtle(` (${varAny.type})`);
}
if (varAny.required) {
varLine += c.required(" *required*");
}
if (varAny.default !== undefined) {
varLine += c.default(varAny.default);
}
this.log(s.indent(varLine, 4));
if (varAny.description) {
this.log(s.indent(c.text(varAny.description), 6));
}
// Helper to check for enum properties safely
if (varAny.options && Array.isArray(varAny.options)) {
this.log(s.indent(c.enum(`Enum: ${varAny.options.map((o) => (typeof o === "object" ? o.value : o)).join(", ")}`), 6));
}
if (varAny.suggestion) {
this.log(s.indent(c.subtle(`Suggestion: ${varAny.suggestion}`), 6));
}
}
}
}
}
this.log("");
}
catch (error) {
this.error(`Failed to get cookbook info: ${error instanceof Error ? error.message : String(error)}`);
}
}
/**
* Display available cookbooks grouped by kit when a cookbook is not found
*/
async suggestAvailableCookbooks(generators) {
// Collect all cookbooks grouped by kit
const cookbooksByKit = new Map();
for (const generator of generators) {
if (!generator.cookbooks || generator.cookbooks.length === 0)
continue;
const kitCookbooks = [];
// Try to get cookbook details
try {
const { parseKitFile, discoverCookbooksInKit } = await import("@hypercli/core");
const kitYmlPath = path.join(generator.path, "kit.yml");
const parsedKit = await parseKitFile(kitYmlPath);
if (parsedKit.isValid && parsedKit.config.cookbooks) {
const cookbooks = await discoverCookbooksInKit(generator.path, parsedKit.config.cookbooks);
for (const [name, cookbook] of cookbooks) {
kitCookbooks.push({
name,
description: cookbook.config.description,
});
}
}
}
catch {
// Fallback to just names if we can't load details
for (const cookbookName of generator.cookbooks) {
kitCookbooks.push({ name: cookbookName });
}
}
if (kitCookbooks.length > 0) {
cookbooksByKit.set(generator.name, kitCookbooks);
}
}
if (cookbooksByKit.size === 0) {
this.log(c.warning("No cookbooks found in any installed kits."));
this.log(s.hint("\nInstall a kit with: hypergen kit install <kit>"));
return;
}
this.log(c.title("Available cookbooks:"));
this.log(s.hr());
this.log("");
for (const [kitName, cookbooks] of cookbooksByKit) {
this.log(c.heading(`${kitName}:`));
for (const cookbook of cookbooks) {
const name = c.cookbook(` ${cookbook.name}`);
if (cookbook.description) {
this.log(`${name} ${c.subtle(`— ${cookbook.description}`)}`);
}
else {
this.log(name);
}
}
this.log("");
}
this.log(s.hint("Run `hypergen cookbook info <cookbook>` for more details."));
}
}
//# sourceMappingURL=info.js.map
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../src/commands/cookbook/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAA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;IAC/E,CAAC"}
/**
* List cookbooks in a kit or all installed cookbooks
*/
import { BaseCommand } from "#lib/base-command";
export default class CookbookList extends BaseCommand<typeof CookbookList> {
static description: string;
static examples: string[];
static flags: {
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
kit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
};
static args: {
kit: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
};
run(): Promise<void>;
private displayCookbooks;
}
//# sourceMappingURL=list.d.ts.map
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW,CAAC,OAAO,YAAY,CAAC;IACzE,OAAgB,WAAW,SAAwD;IAEnF,OAAgB,QAAQ,WAItB;IAEF,OAAgB,KAAK;;;;;MAUnB;IAEF,OAAgB,IAAI;;MAKlB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA6E1B,OAAO,CAAC,gBAAgB;CAgDxB"}
/**
* List cookbooks in a kit or all installed cookbooks
*/
import { discoverCookbooksInKit, discoverRecipesInCookbook } from "@hypercli/core";
import { c, s } from "@hypercli/ui/shortcuts";
import { Args, Flags } from "@oclif/core";
import { BaseCommand } from "#lib/base-command";
export default class CookbookList extends BaseCommand {
static description = "List cookbooks in a kit or all installed cookbooks";
static examples = [
"<%= config.bin %> cookbook list",
"<%= config.bin %> cookbook list @kit/starlight",
"<%= config.bin %> cookbook list --json",
];
static flags = {
...BaseCommand.baseFlags,
json: Flags.boolean({
description: "Output as JSON",
default: false,
}),
kit: Flags.string({
char: "k",
description: "Filter by kit name",
}),
};
static args = {
kit: Args.string({
description: "Kit to list cookbooks from (optional, lists all if omitted)",
required: false,
}),
};
async run() {
const { args, flags } = await this.parse(CookbookList);
try {
// Discover all kits
const kits = await this.discovery.discoverAll();
// Filter by kit if specified (via arg or flag)
const kitFilter = args.kit || flags.kit;
const targetKits = kitFilter
? kits.filter((k) => k.name === kitFilter ||
k.name.endsWith(`/${kitFilter}`) ||
k.name === `@kit/${kitFilter}`)
: kits;
if (targetKits.length === 0 && kitFilter) {
this.error(`Kit not found: ${kitFilter}`);
}
// Collect cookbooks from all target kits
const cookbooks = [];
for (const kit of targetKits) {
if (!kit.cookbooks || kit.cookbooks.length === 0) {
continue;
}
const kitPath = kit.path;
const cookbookGlobs = ["./cookbooks/*/cookbook.yml"]; // Default pattern
try {
const discoveredCookbooks = await discoverCookbooksInKit(kitPath, cookbookGlobs);
for (const [cookbookName, cookbook] of discoveredCookbooks) {
// Discover actual recipe names from the cookbook directory
const recipeGlobs = cookbook.config.recipes ?? ["./*/recipe.yml"];
let recipeNames;
try {
const discoveredRecipes = await discoverRecipesInCookbook(cookbook.dirPath, recipeGlobs);
if (discoveredRecipes.size > 0) {
recipeNames = Array.from(discoveredRecipes.keys()).sort();
}
}
catch {
// If recipe discovery fails, omit the recipes list
}
cookbooks.push({
name: cookbookName,
kit: kit.name,
description: cookbook.config.description,
version: cookbook.config.version,
recipes: recipeNames,
path: cookbook.dirPath,
});
}
}
catch (error) {
// Skip kits that fail to parse
this.warn(`Failed to discover cookbooks in kit ${kit.name}: ${error}`);
}
}
this.displayCookbooks(cookbooks, flags);
}
catch (error) {
this.error(`Failed to list cookbooks: ${error instanceof Error ? error.message : String(error)}`);
}
this.exit(0);
}
displayCookbooks(cookbooks, flags) {
if (flags.json) {
this.log(JSON.stringify(cookbooks, null, 2));
return;
}
if (cookbooks.length === 0) {
this.log(c.warning("No cookbooks found."));
this.log(s.hint("\nInstall a kit with: hypergen kit install <kit>"));
return;
}
// Group by kit for display
const byKit = new Map();
for (const cookbook of cookbooks) {
const kitCookbooks = byKit.get(cookbook.kit) || [];
kitCookbooks.push(cookbook);
byKit.set(cookbook.kit, kitCookbooks);
}
this.log(s.header("Cookbooks", cookbooks.length));
this.log("");
for (const [kitName, kitCookbooks] of byKit) {
this.log(c.kit(`${kitName}:`));
for (const cookbook of kitCookbooks) {
const versionStr = cookbook.version ? ` ${s.version(cookbook.version)}` : "";
this.log(s.listItem(c.cookbook(cookbook.name) + versionStr));
const bodyLines = [];
if (cookbook.description) {
bodyLines.push(s.description(cookbook.description.trim()));
}
if (cookbook.recipes && cookbook.recipes.length > 0) {
const recipeList = cookbook.recipes.map((r) => c.recipe(r)).join(c.muted(", "));
if (bodyLines.length > 0)
bodyLines.push("");
bodyLines.push(s.description("Recipes: ") + recipeList);
}
if (bodyLines.length > 0) {
this.log(s.listItemBody(...bodyLines));
}
}
}
}
}
//# sourceMappingURL=list.js.map
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/cookbook/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAgC;IACzE,MAAM,CAAU,WAAW,GAAG,oDAAoD,CAAC;IAEnF,MAAM,CAAU,QAAQ,GAAG;QAC1B,iCAAiC;QACjC,gDAAgD;QAChD,wCAAwC;KACxC,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACvB,GAAG,WAAW,CAAC,SAAS;QACxB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,WAAW,EAAE,gBAAgB;YAC7B,OAAO,EAAE,KAAK;SACd,CAAC;QACF,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I,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;gBACxC,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC"}
/**
* Recipe Info command - Show recipe information
*/
import { BaseCommand } from "#lib/base-command";
export default class RecipeInfo extends BaseCommand<typeof RecipeInfo> {
static description: string;
static examples: string[];
static flags: {
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
};
static args: {
recipe: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
};
run(): Promise<void>;
}
//# sourceMappingURL=info.d.ts.map
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/commands/recipe/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW,CAAC,OAAO,UAAU,CAAC;IACrE,OAAgB,WAAW,SAAsC;IAEjE,OAAgB,QAAQ,WAGtB;IAEF,OAAgB,KAAK;;;;MAEnB;IAEF,OAAgB,IAAI;;MAKlB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkE1B"}
/**
* Recipe Info command - Show recipe information
*/
import { Args } from "@oclif/core";
import { BaseCommand } from "#lib/base-command";
import { outputFlags } from "#lib/flags";
import { loadRecipe } from "#recipe-engine/recipe-engine";
export default class RecipeInfo extends BaseCommand {
static description = "Show detailed recipe information";
static examples = [
"<%= config.bin %> <%= command.id %> my-recipe.yml",
"<%= config.bin %> <%= command.id %> .hyper/kits/component.yml --json",
];
static flags = {
...outputFlags,
};
static args = {
recipe: Args.string({
description: "Path to recipe file (.yml or .yaml)",
required: true,
}),
};
async run() {
const { args, flags } = await this.parse(RecipeInfo);
const recipePath = args.recipe;
try {
const result = await loadRecipe(recipePath);
const recipe = result.recipe;
if (flags.json) {
this.log(JSON.stringify(recipe, null, 2));
return;
}
this.log(`Recipe: ${recipe.name}`);
this.log(`Version: ${recipe.version || "unversioned"}`);
if (recipe.description) {
this.log(`Description: ${recipe.description}`);
}
// Variables
const variables = Object.entries(recipe.variables || {});
if (variables.length > 0) {
this.log("");
this.log(`Variables (${variables.length}):`);
for (const [name, varConfig] of variables) {
let line = ` - ${name}`;
if (typeof varConfig === "object" && varConfig !== null) {
const config = varConfig;
if (config.type)
line += ` (${config.type})`;
if (config.required)
line += " *required*";
if (config.default !== undefined)
line += ` [default: ${config.default}]`;
if (config.description)
line += ` - ${config.description}`;
}
this.log(line);
}
}
// Steps
if (recipe.steps?.length) {
this.log("");
this.log(`Steps (${recipe.steps.length}):`);
for (let i = 0; i < recipe.steps.length; i++) {
const step = recipe.steps[i];
let line = ` ${i + 1}. ${step.name || `Step ${i + 1}`}`;
line += ` [${step.tool}]`;
// Check for condition property (may exist on some step types)
const stepWithCondition = step;
if (stepWithCondition.condition)
line += " (conditional)";
this.log(line);
}
}
// Dependencies
if (recipe.dependencies?.length) {
this.log("");
this.log(`Dependencies (${recipe.dependencies.length}):`);
for (const dep of recipe.dependencies) {
this.log(` - ${dep}`);
}
}
}
catch (error) {
const message = error instanceof Error ? error.message : String(error);
this.error(`Failed to read recipe: ${message}`);
}
}
}
//# sourceMappingURL=info.js.map
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../src/commands/recipe/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACrE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AAC,IAAI,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;oBACzD,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC;oBAC1B,8DAA8D;oBAC9D,MAAM,iBAAiB,GAAG,IAAyC,CAAC;oBACpE,IAAI,iBAAiB,CAAC,SAAS;wBAAE,IAAI,IAAI,gBAAgB,CAAC;oBAC1D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC;YACF,CAAC;YAED,eAAe;YACf,IAAI,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;gBACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACb,IAAI,CAAC,GAAG,CAAC,iBAAiB,MAAM,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,CAAC;gBAC1D,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;oBACvC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;gBACxB,CAAC;YACF,CAAC;QACF,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,CAAC,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;QACjD,CAAC;IACF,CAAC"}
/**
* Recipe List command - List available recipes from all discovered kits
*/
import { BaseCommand } from "#lib/base-command";
export default class RecipeList extends BaseCommand<typeof RecipeList> {
static description: string;
static examples: string[];
static flags: {
kit: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
cookbook: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
};
static args: {
kit: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
};
run(): Promise<void>;
/**
* Quick parse a recipe file for display purposes
*/
private quickParseRecipe;
/**
* Get recipe directories by scanning for recipe.yml files
*/
private getRecipeDirs;
private displayRecipes;
}
//# sourceMappingURL=list.d.ts.map
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/recipe/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAahD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW,CAAC,OAAO,UAAU,CAAC;IACrE,OAAgB,WAAW,SAAqD;IAEhF,OAAgB,QAAQ,WAItB;IAEF,OAAgB,KAAK;;;;;;MAUnB;IAEF,OAAgB,IAAI;;MAKlB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAwH1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,cAAc;CA8CtB"}
/**
* Recipe List command - List available recipes from all discovered kits
*/
import fs from "node:fs";
import path from "node:path";
import { c, s } from "@hypercli/ui/shortcuts";
import { Args, Flags } from "@oclif/core";
import yaml from "js-yaml";
import { BaseCommand } from "#lib/base-command";
import { outputFlags } from "#lib/flags";
export default class RecipeList extends BaseCommand {
static description = "List available recipes from all discovered kits";
static examples = [
"<%= config.bin %> <%= command.id %>",
"<%= config.bin %> <%= command.id %> nextjs",
"<%= config.bin %> <%= command.id %> --json",
];
static flags = {
...outputFlags,
kit: Flags.string({
char: "k",
description: "Filter by kit name",
}),
cookbook: Flags.string({
char: "c",
description: "Filter by cookbook name",
}),
};
static args = {
kit: Args.string({
description: "Kit to list recipes from (optional, lists all if omitted)",
required: false,
}),
};
async run() {
const { args, flags } = await this.parse(RecipeList);
try {
// Discover all kits
const kits = await this.discovery.discoverAll();
// Filter by kit if specified (via arg or flag)
const kitFilter = args.kit || flags.kit;
const targetKits = kitFilter
? kits.filter((k) => k.name === kitFilter ||
k.name.endsWith(`/${kitFilter}`) ||
k.name === `@kit/${kitFilter}`)
: kits;
if (targetKits.length === 0 && kitFilter) {
this.error(`Kit not found: ${kitFilter}`);
}
// Collect recipes from all target kits
const recipes = [];
for (const kit of targetKits) {
// Get recipes from cookbooks
if (kit.cookbooks && kit.cookbooks.length > 0) {
const kitPath = kit.path;
// Look for cookbook directories directly
const cookbooksDir = path.join(kitPath, "cookbooks");
if (!fs.existsSync(cookbooksDir)) {
continue;
}
for (const cookbookName of kit.cookbooks) {
// Filter by cookbook if specified
if (flags.cookbook && cookbookName !== flags.cookbook) {
continue;
}
const cookbookDir = path.join(cookbooksDir, cookbookName);
const cookbookYml = path.join(cookbookDir, "cookbook.yml");
if (!fs.existsSync(cookbookYml)) {
continue;
}
// Discover recipes by scanning directories
const recipeDirs = this.getRecipeDirs(cookbookDir);
for (const recipeDir of recipeDirs) {
const recipeName = path.basename(recipeDir);
const recipePath = path.join(recipeDir, "recipe.yml");
if (!fs.existsSync(recipePath)) {
continue;
}
// Quick parse just for display info
const info = this.quickParseRecipe(recipePath);
recipes.push({
name: recipeName,
path: recipePath,
kit: kit.name,
cookbook: cookbookName,
description: info.description,
version: info.version,
steps: info.steps,
});
}
}
}
// Get direct recipes (not in cookbooks)
if (kit.recipes && kit.recipes.length > 0) {
for (const recipeName of kit.recipes) {
// Try to find the recipe file
const possiblePaths = [
path.join(kit.path, "recipes", recipeName, "recipe.yml"),
path.join(kit.path, recipeName, "recipe.yml"),
path.join(kit.path, `${recipeName}.yml`),
];
for (const recipePath of possiblePaths) {
if (fs.existsSync(recipePath)) {
const info = this.quickParseRecipe(recipePath);
recipes.push({
name: recipeName,
path: recipePath,
kit: kit.name,
description: info.description,
version: info.version,
steps: info.steps,
});
break; // Found it, stop trying paths
}
}
}
}
}
// Apply cookbook filter to direct recipes too
if (flags.cookbook) {
const filteredRecipes = recipes.filter((r) => r.cookbook === flags.cookbook);
if (filteredRecipes.length === 0) {
this.error(`Cookbook not found: ${flags.cookbook}`);
}
return this.displayRecipes(filteredRecipes, flags);
}
this.displayRecipes(recipes, flags);
}
catch (error) {
this.error(`Failed to list recipes: ${error instanceof Error ? error.message : String(error)}`);
}
}
/**
* Quick parse a recipe file for display purposes
*/
quickParseRecipe(recipePath) {
try {
const content = fs.readFileSync(recipePath, "utf-8");
const parsed = yaml.load(content);
if (!parsed || typeof parsed !== "object") {
return {};
}
return {
description: parsed.description,
version: parsed.version,
steps: Array.isArray(parsed.steps) ? parsed.steps.length : undefined,
};
}
catch {
return {};
}
}
/**
* Get recipe directories by scanning for recipe.yml files
*/
getRecipeDirs(cookbookDir) {
const recipeDirs = [];
try {
const entries = fs.readdirSync(cookbookDir, { withFileTypes: true });
for (const entry of entries) {
if (entry.isDirectory()) {
const recipeYml = path.join(cookbookDir, entry.name, "recipe.yml");
if (fs.existsSync(recipeYml)) {
recipeDirs.push(path.join(cookbookDir, entry.name));
}
}
}
}
catch {
// Ignore errors
}
return recipeDirs;
}
displayRecipes(recipes, flags) {
if (flags.json) {
this.log(JSON.stringify(recipes, null, 2));
return;
}
if (recipes.length === 0) {
this.log(c.warning("No recipes found."));
this.log(s.hint("\nInstall a kit with: hypergen kit install <kit>"));
return;
}
// Group by kit for display
const byKit = new Map();
for (const recipe of recipes) {
const kitRecipes = byKit.get(recipe.kit) || [];
kitRecipes.push(recipe);
byKit.set(recipe.kit, kitRecipes);
}
this.log(s.header("Available recipes", recipes.length));
this.log("");
for (const [kitName, kitRecipes] of byKit) {
this.log(c.kit(`${kitName}:`));
// Group by cookbook within kit
const byCookbook = new Map();
for (const recipe of kitRecipes) {
const cbRecipes = byCookbook.get(recipe.cookbook) || [];
cbRecipes.push(recipe);
byCookbook.set(recipe.cookbook, cbRecipes);
}
for (const [cookbookName, cbRecipes] of byCookbook) {
const prefix = cookbookName ? c.cookbook(` ${cookbookName}/`) : c.subtle(" (direct)/");
for (const recipe of cbRecipes) {
this.log(` ${prefix}${c.recipe(recipe.name)}`);
if (recipe.description) {
this.log(s.description(recipe.description));
}
}
}
this.log("");
}
}
}
//# sourceMappingURL=list.js.map
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/recipe/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAYzC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACrE,MAAM,CAAU,WAAW,GAAG,iDAAiD,CAAC;IAEhF,MAAM,CAAU,QAAQ,GAAG;QAC1B,qCAAqC;QACrC,4CAA4C;QAC5C,4CAA4C;KAC5C,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACvB,GAAG,WAAW;QACd,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,oBAAoB;SACjC,CAAC;QACF,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;YACtB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,yBAAyB;SACtC,CAAC;KACF,CAAC;IAEF,MAAM,CAAU,IAAI,GAAG;QACtB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,KAAK;SACf,CAAC;KACF,CAAC;IAEF,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GA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ACd,CAAC;IACF,CAAC"}
+274
-4

@@ -25,3 +25,3 @@ {

"name": "cwd",
"default": "/home/runner/work/hyper-coding/hyper-coding/packages/gen",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,

@@ -108,2 +108,272 @@ "multiple": false,

},
"cookbook:info": {
"aliases": [],
"args": {
"cookbook": {
"description": "Cookbook name or path",
"name": "cookbook",
"required": true
}
},
"description": "Show detailed information about a cookbook",
"examples": [
"<%= config.bin %> cookbook info starlight",
"<%= config.bin %> cookbook info @kit/starlight/docs --json"
],
"flags": {
"cwd": {
"description": "Working directory",
"name": "cwd",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"debug": {
"char": "d",
"description": "Enable debug output",
"env": "DEBUG",
"name": "debug",
"allowNo": false,
"type": "boolean"
},
"json": {
"description": "Output as JSON",
"name": "json",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "cookbook:info",
"pluginAlias": "@hypercli/gen",
"pluginName": "@hypercli/gen",
"pluginType": "core",
"strict": true,
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"cookbook",
"info.js"
]
},
"cookbook:list": {
"aliases": [],
"args": {
"kit": {
"description": "Kit to list cookbooks from (optional, lists all if omitted)",
"name": "kit",
"required": false
}
},
"description": "List cookbooks in a kit or all installed cookbooks",
"examples": [
"<%= config.bin %> cookbook list",
"<%= config.bin %> cookbook list @kit/starlight",
"<%= config.bin %> cookbook list --json"
],
"flags": {
"cwd": {
"description": "Working directory",
"name": "cwd",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"debug": {
"char": "d",
"description": "Enable debug output",
"env": "DEBUG",
"name": "debug",
"allowNo": false,
"type": "boolean"
},
"json": {
"description": "Output as JSON",
"name": "json",
"allowNo": false,
"type": "boolean"
},
"kit": {
"char": "k",
"description": "Filter by kit name",
"name": "kit",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "cookbook:list",
"pluginAlias": "@hypercli/gen",
"pluginName": "@hypercli/gen",
"pluginType": "core",
"strict": true,
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"cookbook",
"list.js"
]
},
"recipe:info": {
"aliases": [],
"args": {
"recipe": {
"description": "Path to recipe file (.yml or .yaml)",
"name": "recipe",
"required": true
}
},
"description": "Show detailed recipe information",
"examples": [
"<%= config.bin %> <%= command.id %> my-recipe.yml",
"<%= config.bin %> <%= command.id %> .hyper/kits/component.yml --json"
],
"flags": {
"cwd": {
"description": "Working directory",
"name": "cwd",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"debug": {
"char": "d",
"description": "Enable debug output",
"env": "DEBUG",
"name": "debug",
"allowNo": false,
"type": "boolean"
},
"json": {
"description": "Output as JSON",
"name": "json",
"allowNo": false,
"type": "boolean"
},
"verbose": {
"char": "v",
"description": "Verbose output",
"name": "verbose",
"allowNo": false,
"type": "boolean"
},
"quiet": {
"char": "q",
"description": "Quiet output",
"name": "quiet",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "recipe:info",
"pluginAlias": "@hypercli/gen",
"pluginName": "@hypercli/gen",
"pluginType": "core",
"strict": true,
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"recipe",
"info.js"
]
},
"recipe:list": {
"aliases": [],
"args": {
"kit": {
"description": "Kit to list recipes from (optional, lists all if omitted)",
"name": "kit",
"required": false
}
},
"description": "List available recipes from all discovered kits",
"examples": [
"<%= config.bin %> <%= command.id %>",
"<%= config.bin %> <%= command.id %> nextjs",
"<%= config.bin %> <%= command.id %> --json"
],
"flags": {
"cwd": {
"description": "Working directory",
"name": "cwd",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"debug": {
"char": "d",
"description": "Enable debug output",
"env": "DEBUG",
"name": "debug",
"allowNo": false,
"type": "boolean"
},
"json": {
"description": "Output as JSON",
"name": "json",
"allowNo": false,
"type": "boolean"
},
"verbose": {
"char": "v",
"description": "Verbose output",
"name": "verbose",
"allowNo": false,
"type": "boolean"
},
"quiet": {
"char": "q",
"description": "Quiet output",
"name": "quiet",
"allowNo": false,
"type": "boolean"
},
"kit": {
"char": "k",
"description": "Filter by kit name",
"name": "kit",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"cookbook": {
"char": "c",
"description": "Filter by cookbook name",
"name": "cookbook",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "recipe:list",
"pluginAlias": "@hypercli/gen",
"pluginName": "@hypercli/gen",
"pluginType": "core",
"strict": true,
"enableJsonFlag": false,
"isESM": true,
"relativePath": [
"dist",
"commands",
"recipe",
"list.js"
]
},
"recipe:run": {

@@ -130,3 +400,3 @@ "aliases": [],

"name": "cwd",
"default": "/home/runner/work/hyper-coding/hyper-coding/packages/gen",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,

@@ -255,3 +525,3 @@ "multiple": false,

"name": "cwd",
"default": "/home/runner/work/hyper-coding/hyper-coding/packages/gen",
"default": "/work/hyper/packages/gen",
"hasDynamicHelp": false,

@@ -313,3 +583,3 @@ "multiple": false,

},
"version": "0.2.3"
"version": "0.3.0"
}
+4
-4
{
"name": "@hypercli/gen",
"version": "0.2.3",
"version": "0.3.0",
"type": "module",

@@ -90,5 +90,5 @@ "description": "Code generation engine for HyperDev",

"@clack/prompts": "^0.11.0",
"@hypercli/core": "^0.2.3",
"@hypercli/kit": "^0.2.3",
"@hypercli/ui": "^0.2.3",
"@hypercli/core": "^0.3.0",
"@hypercli/kit": "^0.3.0",
"@hypercli/ui": "^0.3.0",
"@jig-lang/jig": "^1.0.1",

@@ -95,0 +95,0 @@ "@oclif/core": "^4",