fix yargs

This commit is contained in:
Ramnique Singh 2025-11-21 11:43:59 +05:30
parent 97e47faca8
commit 014c8a56f5

View file

@ -11,7 +11,8 @@ yargs(hideBin(process.argv))
(y) => y
.option("agent", {
type: "string",
description: "The agent to run (defaults to copilot)",
description: "The agent to run",
default: "copilot",
})
.option("run_id", {
type: "string",
@ -26,10 +27,9 @@ yargs(hideBin(process.argv))
description: "Do not interact with the user",
default: false,
}),
async (argv) => {
let agent = argv.agent ?? "copilot";
await app({
agent,
(argv) => {
app({
agent: argv.agent,
runId: argv.run_id,
input: argv.input,
noInteractive: argv.noInteractive,
@ -47,23 +47,23 @@ yargs(hideBin(process.argv))
const exampleName = String(argv.example).trim();
try {
const imported = await importExample(exampleName);
// Build output message
const output = [
`✓ Imported example '${exampleName}'`,
` Agents: ${imported.importedAgents.join(", ")}`,
` Primary: ${imported.entryAgent}`,
];
if (imported.addedServers.length > 0) {
output.push(` MCP servers added: ${imported.addedServers.join(", ")}`);
}
if (imported.skippedServers.length > 0) {
output.push(` MCP servers skipped (already configured): ${imported.skippedServers.join(", ")}`);
}
console.log(output.join("\n"));
if (imported.postInstallInstructions) {
console.log("\n" + "=".repeat(60));
console.log("POST-INSTALL INSTRUCTIONS");
@ -71,7 +71,7 @@ yargs(hideBin(process.argv))
console.log(imported.postInstallInstructions);
console.log("=".repeat(60) + "\n");
}
console.log(`\nRun: rowboatx --agent ${imported.entryAgent}`);
} catch (error) {
console.error("Error:", error?.message ?? error);