Sweep — Turn GitHub Issues into Pull Requests
AI agent that turns GitHub issues into pull requests automatically. Handles bug fixes and small features with context-aware code generation.
Installation agent prête
Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.
npx -y tokrepo@latest install 41907c03-6866-46b0-a559-c0d21d6298ed --target codexÀ exécuter après confirmation du plan en dry-run.
What it is
Sweep is an AI-powered GitHub bot that reads issue descriptions and generates pull requests with the corresponding code changes. You write an issue describing a bug or a small feature, tag Sweep, and it analyzes your codebase, generates a fix, and opens a PR for review.
The project originally ran as a hosted service. The Sweep team has since pivoted to building a JetBrains AI coding assistant plugin, but the codebase remains available as an open-source reference for building AI code generation agents.
How it saves time or tokens
For routine bug fixes and small feature additions, the cycle of reading code, writing a fix, and opening a PR can take 30 minutes or more. Sweep reduces this to the time it takes to write an issue description. The estimated token cost is approximately 496 tokens per workflow.
Sweep also demonstrates a pattern for AI agent design: it scans the full repository for context, plans changes across multiple files, and handles the git workflow (branch, commit, PR) automatically.
How to use
- The hosted Sweep bot is no longer actively maintained. To use Sweep, run it locally or study the codebase:
git clone https://github.com/sweepai/sweep.git
cd sweep
pip install -r requirements.txt
- Configure your GitHub token and OpenAI API key in the environment.
- Run the agent against a repository:
export GITHUB_TOKEN=ghp_...
export OPENAI_API_KEY=sk-...
python -m sweepai.app
Example
# GitHub Issue (tagged for Sweep)
Title: Fix broken pagination on /api/users endpoint
Body:
The /api/users endpoint returns all users instead of
respecting the `page` and `limit` query parameters.
The SQL query in `src/routes/users.ts` is missing
OFFSET and LIMIT clauses.
# Sweep generates a PR:
# - Modifies src/routes/users.ts to add OFFSET/LIMIT
# - Updates the test file to cover pagination
# - Opens PR with description explaining the changes
Related on TokRepo
- AI Tools for Coding -- Other AI coding assistants and agents
- AI Tools for Automation -- Workflow automation tools for development teams
Common pitfalls
- The hosted Sweep bot is no longer actively maintained. Expect to run and modify the codebase yourself if you want to use it.
- Sweep works best for small, well-described issues. Complex multi-file refactors or architectural changes are beyond its current capability.
- Generated PRs still need human review. Sweep can introduce subtle bugs, especially in code with complex business logic or edge cases.
Questions fréquentes
The Sweep team has pivoted to building a JetBrains AI plugin. The original GitHub bot codebase is archived but still available. It serves as a reference implementation for building AI code agents.
Yes. The codebase is open-source and can be run locally with your own GitHub token and OpenAI API key. However, you may need to update dependencies and adapt the code since it is no longer actively maintained.
Sweep is designed for small to medium changes: bug fixes, adding a new endpoint, updating configuration. It works across multiple files but struggles with large refactors or changes that require deep architectural understanding.
Sweep uses OpenAI's GPT models for code generation. The codebase can be adapted to use other LLM providers that support the OpenAI API format.
Sweep indexes your repository, builds a map of files and their relationships, and uses this context when generating code. It reads relevant files based on the issue description to understand the code that needs to change.
Sources citées (3)
- Sweep GitHub Repository— Sweep turns GitHub issues into pull requests using AI
- Sweep README— The team pivoted to a JetBrains AI plugin
- Sweep Documentation— Uses OpenAI GPT models for context-aware code generation
En lien sur TokRepo
Source et remerciements
sweep — ⭐ 7,600+ JetBrains AI Plugin
Thanks to the Sweep team for pioneering the issue-to-PR workflow. The concept influenced many subsequent AI coding tools.
Fil de discussion
Actifs similaires
SWE-agent — Autonomous GitHub Issue Solver
SWE-agent lets LLMs autonomously fix GitHub issues and find security vulnerabilities. 18.9K+ stars. State-of-the-art on SWE-bench. MIT.
Upptime — GitHub-Powered Uptime Monitor and Status Page
An open-source uptime monitor and status page powered entirely by GitHub Actions, Issues, and Pages, requiring no server or database.
Jekyll — The Ruby Static Site Generator Behind GitHub Pages
Jekyll transforms plain text files into static websites and blogs. It reads Markdown and Liquid templates, generates a complete site at build time, and powers GitHub Pages natively.
act — Run GitHub Actions Locally
act lets you run GitHub Actions workflows on your local machine. Test and debug your CI/CD pipelines without pushing to GitHub, using Docker containers to simulate the GitHub Actions runner environment.