Summary
Build a proper CLI interface to replace direct node script execution, supporting commands like 'npx reglance capture' and 'npm run reglance compare'.
Current Usage
node capture.mjs property
node compare.mjs property
node control.mjs property
Target Usage
npx reglance capture property
npx reglance compare property
npx reglance control property
Tasks
- Create bin/reglance.js as CLI entry point
- Add command parsing (capture, compare, control commands)
- Support global and local installation modes
- Add help text and usage instructions
- Implement proper argument validation
- Add --help and --version flags
- Support additional flags (--config, --verbose, --output, etc.)
CLI Features
- Command help: reglance help, reglance capture --help
- Version info: reglance --version
- Config override: reglance capture --config ./custom.config.js
- Output directory: reglance capture --output ./custom-output
- Verbose logging: reglance capture --verbose
- Dry run mode: reglance capture --dry-run
Error Handling
- Clear error messages for invalid commands
- Helpful suggestions for typos
- Exit codes: 0 for success, 1 for errors
- Proper error logging vs standard output
Acceptance Criteria
- CLI works with npx reglance [command]
- All existing functionality accessible via CLI
- Help text is clear and comprehensive
- Error messages are user-friendly
- Supports both global and local installation
Summary
Build a proper CLI interface to replace direct node script execution, supporting commands like 'npx reglance capture' and 'npm run reglance compare'.
Current Usage
Target Usage
Tasks
CLI Features
Error Handling
Acceptance Criteria