update: added export capability

This commit is contained in:
tusharmagar 2025-11-21 16:24:23 +05:30
parent 58fa1b91c3
commit c562248850
3 changed files with 638 additions and 1 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env node
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { app, modelConfig, updateState, importExample, listExamples } from '../dist/app.js';
import { app, modelConfig, updateState, importExample, listExamples, exportWorkflow } from '../dist/app.js';
yargs(hideBin(process.argv))
@ -90,6 +90,24 @@ yargs(hideBin(process.argv))
}
}
)
.command(
"export",
"Export a workflow with all dependencies (outputs to stdout)",
(y) => y
.option("agent", {
type: "string",
description: "Entry agent name to export",
demandOption: true,
}),
async (argv) => {
try {
await exportWorkflow(String(argv.agent).trim());
} catch (error) {
console.error("Error:", error?.message ?? error);
process.exit(1);
}
}
)
.command(
"model-config",
"Select model",