Fixotron CLI is an AI-powered developer tool that automatically detects and fixes bugs in JavaScript, TypeScript, and Python files.
It integrates with Groq and Google Gemini, applies strict prompt engineering and security safeguards, and provides a full workflow for:
✓Reading code files
✓Building contextual prompts
✓Calling AI models
✓Parsing responses safely
✓Showing syntax-highlighted diffs
✓Writing fixes to disk
✓Managing backups and history
✓Running fixed code in a sandbox
-
Multi-Provider AI : Groq and Gemini
-
Smart Context Strategy :
• Files <1000 lines → full file sent to AI
• Files ≥1000 lines → relevant snippets + structural summary
-
Security Gate : Blocks AI access to sensitive code: • process.env
• crypto
• jwt
• bcrypt
• auth middleware
• authorization headers
-
Automatic Fixing • Syntax errors
• Runtime errors
• Optional logic fixes (--logic-fix)
-
Backup and Restore
• Timestamped backups before overwriting files
-
Undo/Redo : Persistent fix history
-
Batch Fixing
| Layer | Technology |
|---|---|
| Language | TypeScript (Node.js) |
| CLI Framework | Commander.js |
| AI Providers | Groq API, Gemini API |
| Terminal UI | Chalk, Ora, cli-highlight, Inquirer |
| Git Integration | simple-git |
| Testing | Jest + ts-jest |
| Runtime | ts-node |
1️. Clone the repository
git clone https://github.com/yourusername/fixotron-cli.git
cd fixotron-cli2. dependencies
npm install3️. Setup environment variables
cp .env.example .envEdit .env and add your API keys.
GROQ_API_KEY=gsk_your_key_here
GEMINI_API_KEY=AIza_your_key_here
DEFAULT_PROVIDER=groqFix a single file
npx ts-node main.ts fix --file src/server.tsFix and save back to disk
npx ts-node main.ts fix --file src/server.ts --save --backupFix an entire folder
npx ts-node main.ts fix --folder src --save --backupFix code from stdin
npx ts-node main.ts fix --paste < broken.jsor
echo "const x = {" | npx ts-node main.ts fix --pasteEnable logic bug fixing
npx ts-node main.ts fix --file utils.ts --logic-fix --saveAllow AI to modify security-critical code
npx ts-node main.ts fix --file auth.ts --allow-security-modifications --save --backupAuto-commit fixes to Git
npx ts-node main.ts fix --file src/api.ts --save --auto-commitRun fixed code in sandbox
npx ts-node main.ts fix --file script.js --save --runUse Gemini instead of Groq
npx ts-node main.ts fix --file src/app.ts --provider geminiUndo the last fix
npx ts-node main.ts undoRedo the fix
npx ts-node main.ts redoView history
npx ts-node main.ts history| Flag | Description |
|---|---|
--file <path> |
Fix a single file |
--folder <path> |
Fix all supported files recursively |
--paste |
Read code from stdin |
--logic-fix |
Enable logic/algorithmic bug fixing |
--allow-security-modifications |
Allow AI to modify auth/crypto/env code |
--save |
Write fixed code to disk |
--backup |
Create timestamped backup |
--auto-commit |
Commit fixes to git |
--run |
Execute fixed code in sandbox |
--provider <name> |
AI provider (groq or gemini) |
--model <name> |
Override model |
--debug |
Enable verbose logging |
| Extension | Language |
|---|---|
.ts, .tsx |
TypeScript |
.js, .jsx |
JavaScript |
.py |
Python |
Your file
│
▼
contextBuilder.ts
├── <1000 lines → send full file
└── ≥1000 lines → extract snippets + summary
│
▼
promptBuilder.ts
└── builds AI prompt with rules
│
▼
aiClient.ts
├── calls Groq / Gemini
├── retries with backoff
└── parses response safely
│
▼
bugFixer.ts
├── security gate
├── history manager
├── file write
├── git commit
└── sandbox execution
│
▼
outputFormatter.ts
└── syntax-highlighted terminal output
Run all tests
npm testWatch mode
npm run test:watchCoverage
npm run test:coverage