Skip to content

Commit

Permalink
Allow passing --packet or -p to garden tool to filter down diagra…
Browse files Browse the repository at this point in the history
…m to a single packet.

Everything not in that packet will be treated like a remote seed in the diagram.

Part of #1. Part of #19.
  • Loading branch information
jkomoros committed Jul 9, 2023
1 parent 5b77118 commit 4eb5fc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/garden/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const cliOptions = z.object({
help: z.optional(z.boolean()),
mock: z.optional(z.boolean()),
diagram: z.optional(z.boolean()),
packet: z.optional(z.string()),
warn: z.optional(z.boolean()),
verbose: z.optional(z.boolean()),
profile: z.optional(z.string())
Expand All @@ -51,7 +52,7 @@ const main = async (opts : CLIOptions) => {
}
}
if (opts.diagram) {
console.log(garden.diagram());
console.log(garden.diagram(opts.packet));
exit(0);
}
const seedID = opts.seed || '';
Expand Down Expand Up @@ -90,9 +91,10 @@ const main = async (opts : CLIOptions) => {
verbose: {type: Boolean, optional: true, alias: 'v', description: 'Turn on verbose logging of seed calculation'},
mock: {type: Boolean, optional: true, alias: 'm', description: 'Whether to mock results, e.g. by not calling production LLM APIs'},
warn: {type: Boolean, optional: true, alias: 'w', description: 'Prints warnings about seed packets'},
packet: {type: String, optional: true, alias: 'p', description: 'If provided, will operate only over the given packet'},
diagram: {type: Boolean, optional: true, description: 'Print out a mermaid diagram for garden and quit'},
help: {type: Boolean, optional: true, alias: 'h', description: 'Print this usage guide'},
profile: {type: String, optional: true, alias: 'p', description: 'The profile to use if not default'}
profile: {type: String, optional: true, description: 'The profile to use if not default'}
}, {
headerContentSections: [{
header: 'prompt-garden',
Expand Down

0 comments on commit 4eb5fc6

Please sign in to comment.