πŸ”§ Sweep CLI

Sweep CLI Installation

Prerequisites: python 3.10, pip

Sweep CLI is a locally running version of Sweep (no data will enter our servers).
To use our hosted Sweep, install here (2 min) (opens in a new tab). To self-host your own Sweep, visit deployment (15 min).

Setup environment variables

To grant Sweep repository access create a new GitHub Personal Access Token (PAT) here (opens in a new tab). Sweep will run entirely locally, and no code will be shared outside of OpenAI API and GitHub.
You also need to create an OpenAI API token (opens in a new tab).

Add both to your .env:

.env
REPO=YOUR-USERNAME/YOUR-REPO
GITHUB_PAT=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Install the Sweep CLI

terminal
pip install sweepai

Run the Sweep CLI

Create a GitHub Issue like the examples in our guide in your repo, and run the following command:

terminal
sweep run https://github.com/YOUR-USERNAME/YOUR-REPO/issues/1

To have Sweep automatically fix newly created issues, you can also run the following command:

terminal
sweep watch YOUR-USERNAME/YOUR-REPO

πŸŽ‰ Congratulations!

You have successfully set up the Sweep CLI. You can now use Sweep to help you with your GitHub issues and pull requests. To set up Sweep for your organization see self-hosting the GitHub App and book a call (opens in a new tab) with us for a commercial license.