An autonomous CLI tool that acts as an AI-powered open source contributor, automatically analyzing GitHub issues, generating verified fixes through iterative testing, and creating pull requests.
- β Analyzes issues semantically using Gemini 3
- β Searches code surgically with 90% context reduction
- β Self-corrects through test failures (up to 5 iterations)
- β Creates verified PRs automatically
- Node.js 18+
- npm or yarn
- Git
- Ripgrep (
brew install ripgrepon macOS,apt install ripgrepon Ubuntu)
# Clone the repository
git clone <your-repo-url>
cd oss-dev
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Edit .env with your API keys (already configured if you're the developer)
# Build the project
npm run build
# Run the CLI
npm run dev fix <github-issue-url>The project requires three API keys (already configured in .env):
- Purpose: AI-powered code analysis and generation
- Get it from: https://makersuite.google.com/app/apikey
- Purpose: Isolated sandbox testing
- Get it from: https://e2b.dev/docs
- Purpose: Repository access and PR creation
- Create at: https://github.com/settings/tokens
- Required scopes:
repo,workflow
# Fix a GitHub issue
npm run dev fix https://github.com/owner/repo/issues/123
# Dry run (analyze only, no PR)
npm run dev fix https://github.com/owner/repo/issues/123 --dry-run
# Verbose output
npm run dev fix https://github.com/owner/repo/issues/123 --verbose
# Limit fix attempts
npm run dev fix https://github.com/owner/repo/issues/123 --max-attempts 3CLI Layer (Commander.js)
β
Orchestrator (Workflow coordination)
β
ββ GitHub Client (Octokit)
ββ Agents (Gemini 3)
β ββ Issue Analyzer (Pro)
β ββ Scout Agent (Flash)
β ββ Engineer Agent (Pro)
ββ Search (Ripgrep)
ββ Sandbox (E2B)
oss-dev/
βββ src/
β βββ cli/ # CLI interface
β βββ agents/ # AI agents (Analyzer, Scout, Engineer)
β βββ tools/ # GitHub client, Ripgrep search
β βββ sandbox/ # E2B sandbox, fingerprinting
β βββ orchestrator/ # Workflow, fix loop
β βββ types/ # TypeScript interfaces
β βββ utils/ # Logger, config
βββ tests/
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ e2e/ # End-to-end tests
βββ .kiro/specs/ # Feature specifications
β βββ oss-dev-cli/
β βββ requirements.md
β βββ design.md
β βββ tasks.md
βββ DEVELOPMENT.md # Complete build guide
βββ IMPLEMENTATION.md # Technical implementation details
βββ DEPLOYMENT.md # Deployment guide
ALWAYS DO CORE IMPLEMENTATION - Avoid patchwork completely. Build solid, maintainable code from the start.
KEEP CODE CLEAN - Only add comments when needed and keep them small and meaningful.
MAINTAIN CORE LOGIC - Keep core logic consistent throughout the app.
SIMPLE COMMIT MESSAGES - Write meaningful, short commit messages without FEAT/ECHO prefixes.
# Development mode with auto-reload
npm run dev
# Build TypeScript
npm run build
# Run tests
npm test
# Run tests with coverage
npm test -- --coverage
# Run linter
npm run lint
# Type check
npx tsc --noEmitThe project uses a dual testing approach:
- Verify specific examples and edge cases
- Test integration points between components
- Test error conditions
- Verify universal properties across all inputs
- Test with randomized inputs (100+ iterations)
- Catch edge cases that unit tests might miss
Framework: Jest + fast-check
- DEVELOPMENT.md - Complete build guide with phase-by-phase instructions
- IMPLEMENTATION.md - Technical details on APIs, prompting strategies, and system design
- DEPLOYMENT.md - Production deployment guide (npm, Docker, binaries)
- .kiro/specs/oss-dev-cli/ - Feature specifications (requirements, design, tasks)
Follow the tasks in .kiro/specs/oss-dev-cli/tasks.md:
- Project Setup - Initialize TypeScript, install dependencies
- Core Types - Define interfaces and data models
- Utilities - Logger, config management
- GitHub Integration - URL parser, GitHub client
- Agents - Issue Analyzer, Scout, Engineer
- Search - Ripgrep integration
- Sandbox - E2B sandbox, fingerprinting
- Orchestration - Fix loop, main workflow
- CLI - Command-line interface
- Testing - Unit, integration, E2E tests
- Parse URL β Extract owner/repo/issue number
- Fetch Issue β Get title, body, labels from GitHub
- Analyze Issue β Extract structured information with Gemini
- Clone Repo β Shallow clone to temp directory
- Detect Stack β Identify language, package manager
- Search Code β Generate targeted ripgrep queries
- Provision Sandbox β Create E2B environment
- Fix Loop β Iteratively generate and test fixes
- Create PR β Commit changes and open pull request
- Cleanup β Terminate sandbox, remove temp files
- Uses targeted ripgrep searches instead of full codebase analysis
- 90% reduction in context size
- Significantly lower API costs
- Generates fix β Applies to sandbox β Runs tests
- If tests fail, diagnoses the issue and tries again
- Up to 5 attempts with learning from previous failures
- Gemini Flash for routing and search queries (10x cheaper)
- Gemini Pro for reasoning and code generation (higher quality)
- Strategic model selection based on task complexity
- Gemini API: https://ai.google.dev/docs
- E2B Sandboxes: https://e2b.dev/docs
- Octokit (GitHub API): https://octokit.github.io/rest.js/
- Ripgrep: https://github.com/BurntSushi/ripgrep
- fast-check (Property Testing): https://fast-check.dev/
MIT
Contributions welcome after the initial implementation!
Ready to build? Start with task 1 in .kiro/specs/oss-dev-cli/tasks.md π