Cli to dev (#309)

* add workspace access guidelines to instructions

* updated example

* removed incorrect example

* add --example to add the examples from rowboat

* changed --example to --sync-example

* rename sync-examples option to sync-example in CLI

* fix: sync-example implementation

* refactor example import

* fix yargs

* fix: - remove changes to package-lock
- remove output messages from app.js and moved them into importExample

* fix: restore package-lock.json to match main (remove diff)

* fix: naming of the commands

* update: made import-example into import and it can import example workflows or user made workflows

* update: added export capability

* delete: remove misplaced podcast.json file

* removed incomplete gemini3-test example json

* remove: eliminate gemini3-test example from exports

* Fix: better prompting around MCP config
Add: copilot tool to add MCP servers

* clean up prompt

---------

Co-authored-by: Ramnique Singh <30795890+ramnique@users.noreply.github.com>
This commit is contained in:
Tushar 2025-11-25 20:00:43 +05:30 committed by Ramnique Singh
parent 255bc9c48d
commit e47518b98f
12 changed files with 1420 additions and 171 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env node
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { app, modelConfig } from '../dist/app.js';
import { app, modelConfig, updateState, importExample, listExamples, exportWorkflow } from '../dist/app.js';
yargs(hideBin(process.argv))
@ -36,6 +36,78 @@ yargs(hideBin(process.argv))
});
}
)
.command(
"import",
"Import an example workflow (--example) or custom workflow from file (--file)",
(y) => y
.option("example", {
type: "string",
description: "Name of built-in example to import",
})
.option("file", {
type: "string",
description: "Path to custom workflow JSON file",
})
.check((argv) => {
if (!argv.example && !argv.file) {
throw new Error("Either --example or --file must be provided");
}
if (argv.example && argv.file) {
throw new Error("Cannot use both --example and --file at the same time");
}
return true;
}),
async (argv) => {
try {
if (argv.example) {
await importExample(String(argv.example).trim());
} else if (argv.file) {
await importExample(undefined, String(argv.file).trim());
}
} catch (error) {
console.error("Error:", error?.message ?? error);
process.exit(1);
}
}
)
.command(
"list-examples",
"List all available example workflows",
(y) => y,
async () => {
try {
const examples = await listExamples();
if (examples.length === 0) {
console.error("No packaged examples are available to list.");
return;
}
for (const example of examples) {
console.log(example);
}
} catch (error) {
console.error(error?.message ?? error);
process.exit(1);
}
}
)
.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",
@ -60,4 +132,4 @@ yargs(hideBin(process.argv))
updateState(argv.agent, argv.run_id);
}
)
.parse();
.parse();