Auto Engineer CLI
A powerful command-line interface for automating development workflows, following Node.js CLI best practices.
Features
- ✅ POSIX-compliant command line arguments
- ✅ Empathic CLI with interactive prompts and helpful error messages
- ✅ Colorful output with graceful degradation
- ✅ Rich interactions with progress spinners and prompts
- ✅ STDIN support for piping data
- ✅ Structured output in JSON format
- ✅ Cross-platform compatibility
- ✅ Configuration precedence (CLI args > env vars > config files)
- ✅ Containerized distribution via Docker
- ✅ Analytics with strict opt-in
- ✅ Proper error handling with error codes
- ✅ Debug mode for troubleshooting
Installation
npm (Recommended)
npm install -g @auto-engineer/cli
Docker
docker pull auto-engineer/cli
docker run --rm auto-engineer/cli --help
Quick Start
Commands
generate
Generate code, documentation, or other artifacts.
auto-engineer generate [options]
Options:
-t, --type <type>
- Type of generation (code, docs, tests)
-o, --output <path>
- Output path for generated files
-f, --force
- Overwrite existing files
--stdin
- Read input from STDIN
Examples:
auto-engineer generate --type code
auto-engineer generate --type docs --output ./docs
echo "component" | auto-engineer generate --stdin
analyze
Analyze code quality and provide insights.
auto-engineer analyze [options]
Options:
-p, --path <path>
- Path to analyze (default: current directory)
-f, --format <format>
- Output format (text, json)
--stdin
- Analyze content from STDIN
Examples:
auto-engineer analyze
auto-engineer analyze --path ./src --format json
cat file.js | auto-engineer analyze --stdin
Global Options
-v, --version
- Show version number
-d, --debug
- Enable debug mode
--no-color
- Disable colored output
--json
- Output in JSON format
--api-token <token>
- API token for external services
--project-path <path>
- Project path to work with
Environment Variables
DEBUG=auto-engineer
- Enable debug mode
NO_COLOR=1
- Disable colored output
OUTPUT_FORMAT=json
- Set output format
AUTO_ENGINEER_API_TOKEN=<token>
- Set API token
AUTO_ENGINEER_ANALYTICS=false
- Disable analytics (enabled by default)
Configuration
Auto-engineer follows configuration precedence:
- Command line arguments (highest priority)
- Environment variables
- Project configuration (
.auto-engineer.json
)
- User configuration (
~/.auto-engineer.json
)
- System configuration (defaults)
Project Configuration
Create .auto-engineer.json
in your project root:
{
"projectType": "node-ts",
"packageManager": "npm",
"testFramework": "vitest",
"enableLinting": true,
"enableGitHooks": true
}
Error Codes
Auto-engineer uses standardized error codes for easy troubleshooting:
E4001
- Validation error
E4002
- Configuration error
E4003
- Invalid API token
E4004
- Invalid project path
E4005
- Missing generation type
E4006
- Missing output path
E4007
- Invalid path type
E4008
- Path does not exist
E5001
- Runtime error
E9999
- Unknown error
Analytics
Auto-engineer collects anonymous usage analytics to improve the tool. Analytics are:
- Enabled by default - Analytics are collected to help improve the tool
- Anonymous - No personal information is collected
- Transparent - You can see what data is collected in debug mode
- Controllable - You can disable anytime
To disable analytics:
export AUTO_ENGINEER_ANALYTICS=false
Analytics data includes:
- Command usage (which commands are run)
- Success/failure rates
- Error codes (for debugging)
- Platform information (Node.js version, OS)
- Tool version
This data helps us understand usage patterns and improve the tool's reliability and features.
Development
Prerequisites
- Node.js 18.0.0 or higher
- npm, yarn, or pnpm
Setup
npm install
npm run build
npm run dev
npm test
npm run test:coverage
Project Structure
src/
├── commands/ # Command implementations
│ ├── generate.ts
│ ├── analyze.ts
│ └── demo.ts
├── utils/ # Utility functions
│ ├── config.ts # Configuration management
│ ├── errors.ts # Error handling
│ ├── terminal.ts # Terminal utilities
│ └── analytics.ts # Analytics
└── index.ts # Main entry point
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support