ai-harness / src /cli /index.ts
stevenkhan's picture
Initial AI Harness - production-grade model-agnostic CLI agent runtime
908562b verified
// ─── CLI Entry Point ────────────────────────────────────────────────────────
import { Command } from 'commander';
import { chatCommand } from './commands/chat.js';
import { runCommand } from './commands/run.js';
import { providersCommand } from './commands/providers.js';
import { toolsCommand } from './commands/tools.js';
import { skillsCommand } from './commands/skills.js';
import { configCommand } from './commands/config.js';
import { renderBanner } from './renderers/index.js';
const program = new Command();
program
.name('harness')
.description('Production-grade, model-agnostic AI agent CLI')
.version('0.1.0');
program
.command('chat')
.description('Interactive chat with the AI agent')
.option('-p, --provider <provider>', 'Provider to use', 'anthropic')
.option('-m, --model <model>', 'Model to use')
.option('-s, --skills <skills...>', 'Skills to load', ['coding'])
.option('--verbose', 'Show detailed event information')
.option('--compact', 'Minimal output mode')
.action(chatCommand);
program
.command('run <goal>')
.description('Run an autonomous task with the given goal')
.option('-p, --provider <provider>', 'Provider to use', 'anthropic')
.option('-m, --model <model>', 'Model to use')
.option('-s, --skills <skills...>', 'Skills to load', ['coding'])
.option('--max-turns <n>', 'Maximum turns', '20')
.option('--budget-tokens <n>', 'Token budget')
.option('--budget-cost <n>', 'Cost budget in USD')
.option('--approval <mode>', 'Approval mode', 'confirm-writes')
.option('--verbose', 'Show detailed event information')
.option('--compact', 'Minimal output mode')
.action(runCommand);
program
.command('providers')
.description('List available providers and models')
.action(providersCommand);
program
.command('tools')
.description('List available tools')
.action(toolsCommand);
program
.command('skills')
.description('List available skills')
.action(skillsCommand);
program
.command('config')
.description('Show or edit configuration')
.option('--show', 'Show current config')
.action(configCommand);
// Show banner and parse
renderBanner();
program.parse();