79 lines
2.6 KiB
JavaScript
79 lines
2.6 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* AgentDB Simulation CLI
|
|
*
|
|
* Multi-swarm simulation system for testing AgentDB v2 under various scenarios
|
|
* using OpenRouter LLMs and agentic-flow orchestration.
|
|
*/
|
|
|
|
import { Command } from 'commander';
|
|
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import { config } from 'dotenv';
|
|
|
|
// Load environment variables
|
|
config({ path: path.join(process.cwd(), '.env') });
|
|
|
|
const program = new Command();
|
|
|
|
program
|
|
.name('agentdb-sim')
|
|
.description('AgentDB v2 Multi-Swarm Simulation System')
|
|
.version('2.0.0');
|
|
|
|
program
|
|
.command('run <scenario>')
|
|
.description('Run a simulation scenario')
|
|
.option('-c, --config <file>', 'Configuration file', 'simulation/configs/default.json')
|
|
.option('-v, --verbosity <level>', 'Verbosity level (0-3)', '2')
|
|
.option('-i, --iterations <n>', 'Number of iterations', '10')
|
|
.option('-s, --swarm-size <n>', 'Number of agents in swarm', '5')
|
|
.option('-m, --model <name>', 'LLM model to use', 'anthropic/claude-3.5-sonnet')
|
|
.option('-p, --parallel', 'Run agents in parallel', false)
|
|
.option('-o, --output <dir>', 'Output directory', 'simulation/reports')
|
|
.option('--stream', 'Enable streaming from agentic-synth', false)
|
|
.option('--optimize', 'Enable optimization mode', false)
|
|
.action(async (scenario, options) => {
|
|
const { runSimulation } = await import('./runner.js');
|
|
await runSimulation(scenario, options);
|
|
});
|
|
|
|
program
|
|
.command('list')
|
|
.description('List available scenarios')
|
|
.action(async () => {
|
|
const { listScenarios } = await import('./runner.js');
|
|
await listScenarios();
|
|
});
|
|
|
|
program
|
|
.command('init <scenario>')
|
|
.description('Initialize a new scenario')
|
|
.option('-t, --template <name>', 'Template to use', 'basic')
|
|
.action(async (scenario, options) => {
|
|
const { initScenario } = await import('./runner.js');
|
|
await initScenario(scenario, options);
|
|
});
|
|
|
|
// Analyze and benchmark commands coming in beta
|
|
// program
|
|
// .command('analyze <report>')
|
|
// .description('Analyze simulation results')
|
|
// .option('-f, --format <type>', 'Output format (json|markdown|html)', 'markdown')
|
|
// .action(async (report, options) => {
|
|
// const { analyzeResults} = await import('./analyzer.js');
|
|
// await analyzeResults(report, options);
|
|
// });
|
|
|
|
// program
|
|
// .command('benchmark')
|
|
// .description('Run comprehensive benchmark suite')
|
|
// .option('-a, --all', 'Run all scenarios', false)
|
|
// .option('-o, --output <dir>', 'Output directory', 'simulation/reports/benchmarks')
|
|
// .action(async (options) => {
|
|
// const { runBenchmark } = await import('./benchmark.js');
|
|
// await runBenchmark(options);
|
|
// });
|
|
|
|
program.parse();
|