UNPKG

@every-env/cli

Version:

Multi-agent orchestrator for AI-powered development workflows

92 lines (68 loc) 2.84 kB
# fix: simplify Every CLI interface to remove unnecessary abstractions ## Summary Remove all the abstraction layers and complex pattern systems. Just make it work with the least amount of code. ## Current Problems - Too many abstractions: PatternExecutor, CommandRegistry, BasePatternCommand, etc. - Complex configuration system with JSON schemas and validation - Over-engineered pattern resolution with namespaces and overrides - Too many dependencies (30+ npm packages) - 2000+ lines of code for what should be simple CLI commands ## Proposed Solution Replace the entire CLI with a single ~200 line file that: 1. **Direct command execution** - No command registry, just a switch statement 2. **Inline prompts** - No liquid templates, just string interpolation 3. **Simple subprocess calls** - Direct exec() to Claude, no agent managers 4. **No configuration files** - Hardcode sensible defaults 5. **Minimal dependencies** - Just commander and child_process ## Implementation ```typescript #!/usr/bin/env node import { Command } from 'commander'; import { exec } from 'child_process'; import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs'; const program = new Command(); program .name('every') .version('1.0.0') .command('init') .action(() => { // Just copy some files, no templates writeFileSync('.every/config.json', '{"version": "1.0.0"}'); console.log('✓ Initialized'); }); program .command('plan <description>') .action((description) => { const date = new Date().toISOString().split('T')[0]; const filename = `plans/${date}-plan.md`; mkdirSync('plans', { recursive: true }); const prompt = `Create an implementation plan for: ${description} Output format: Markdown file with sections for Overview, Tasks, Timeline`; exec(`echo '${prompt}' | claude`, (err, stdout) => { if (err) throw err; writeFileSync(filename, stdout); console.log(`✓ Created ${filename}`); }); }); program.parse(); ``` ## Benefits - **80% less code** - From 2000+ lines to ~200 lines - **No abstractions** - Everything is direct and obvious - **Fast** - No startup overhead from loading patterns and configs - **Easy to modify** - Just edit one file - **No build step** - Can run directly with node ## Trade-offs Accepted - No plugin system (YAGNI) - No custom patterns (just modify the code) - No parallel execution (sequential is fine) - No progress bars (console.log works) - No dry-run mode (just comment out the exec) ## Success Criteria - [ ] Replace entire src/ directory with single cli.js file - [ ] Remove all dependencies except commander - [ ] All commands work with direct subprocess calls - [ ] No configuration files required - [ ] Total implementation under 300 lines ## Labels `refactor`, `simplification`, `technical-debt`