CLI for PR Pilot, a text-to-task automation platform for Github.
Project description
Install | Documentation | Blog | Website
PR Pilot Command-Line Interface
PR Pilot gives you a natural language interface for your Github projects. Given a prompt, it uses LLMs (Large Language Models) to autonomously fulfill tasks by interacting with your code base and Github issues.
Using prompt templates, you can create powerful, reusable commands that can be executed by PR Pilot.
🛠️ Usage
Open a terminal and ls
into a repository you have installed PR Pilot.
In your repository, use the pilot
command:
pilot task "Tell me about this project!"
📝 Ask PR Pilot to edit a local file for you:
pilot edit cli/cli.py "Make sure all functions and classes have docstrings."
⚡ Generate code quickly and save it as a file:
pilot task -o test_utils.py --code "Write some unit tests for the utils.py file."
🔍 Capture part of your screen and add it to a prompt:
pilot task -o component.html --code --snap "Write a Bootstrap5 component that looks like this."
📊 Get an organized view of your Github issues:
pilot task "Find all open Github issues labeled as 'bug', categorize and prioritize them"
📝 Generate parts of your documentation with a template:
pilot task --direct -f prompts/README.md.jinja2 -o README.md
To learn more about templates, check out the prompts directory.
📝 Execute a step-by-step plan:
Break down more complex tasks into smaller steps with a plan:
# document_cli.yaml
name: Document the CLI
prompt: |
The CLI is great, but we need a comprehensive user documentation.
The documentation should be stored as Markdown files in the repository.
steps:
- name: Identify documentation needs
output_file: doc_instructions.md
prompt: |
1. Read `cli/cli.py`
2. Identify the key features of the CLI and how it works
3. List the documentation files that need to be created and outline their content
4. Create step-by-step instructions for creating the documentation
- name: Document the CLI
template: doc_instructions.md
Run it with pilot plan document_cli.yaml
.
⚙️ Options and Parameters
The CLI has global parameters and options that can be used to customize its behavior.
Usage: pilot [OPTIONS] COMMAND [ARGS]...
PR Pilot CLI - https://docs.pr-pilot.ai
Delegate routine work to AI with confidence and predictability.
Examples:
- 📸 Create a Bootstrap5 component based on a screenshot:
pilot task -o component.html --code --snap "Write a Bootstrap5 component that looks like this."
- 🛠️ Refactor and clean up code:
pilot edit main.js "Break up large functions, organize the file and add comments."
- 🔄 Interact across services and tools:
pilot task "Find all open Linear and Github issues labeled as 'bug' and send them to the #bugs Slack channel."
Options:
--wait / --no-wait Wait for PR Pilot to finish the task.
--repo TEXT Github repository in the format owner/repo.
--spinner / --no-spinner Display a loading indicator.
--quiet / --chatty Disable all status messages.
-m, --model TEXT GPT model to use.
-b, --branch TEXT Run the task on a specific branch.
--sync / --no-sync Run task on your current branch and pull PR
Pilot's changes when done.
--debug Display debug information.
--help Show this message and exit.
Commands:
edit ✍️ Let PR Pilot edit a file for you.
plan 📋 Let PR Pilot execute a plan for you.
task 🛠️ Create a new task for PR Pilot.
Commands
Hand over a task to PR Pilot.
Usage: pilot task [OPTIONS] [PROMPT]
🛠️ Create a new task for PR Pilot.
Examples:
- Generate unit tests for a Python file:
pilot task -o test_utils.py --code "Write some unit tests for the utils.py file."
- Create a Bootstrap5 component based on a screenshot:
pilot task -o component.html --code --snap "Write a Bootstrap5 component that looks like this."
- Send a list of all bug issues to Slack:
pilot task "Find all open Github issues labeled as 'bug' and send them to the #bugs Slack channel."
Options:
--snap 📸 Select a portion of your screen to add as an image to
the task.
--cheap 💸 Use the cheapest GPT model (gpt-3.5-turbo)
--code 💻 Optimize prompt and settings for generating code
-f, --file PATH 📂 Generate prompt from a template file.
--direct 🔄 Do not feed the rendered template as a prompt into PR
Pilot, but render it directly as output.
-o, --output PATH 💾 Output file for the result.
--help Show this message and exit.
Let PR Pilot edit a file for you.
Usage: pilot edit [OPTIONS] FILE_PATH [PROMPT]
✍️ Let PR Pilot edit a file for you.
Examples:
- ✍️ Quickly add docstrings to a Python file:
pilot edit main.py "Add docstrings for all classes, functions and parameters."
- ♻️ Refactor and clean up code:
pilot edit main.js "Break up large functions, organize the file and add comments."
- 🧩 Implement placeholders:
pilot edit "I left placeholder comments in the file. Please replace them with the actual code."
Options:
--snap 📸 Add a screenshot to your prompt.
--help Show this message and exit.
Let PR Pilot execute a step-by-step plan.
Usage: pilot plan [OPTIONS] FILE_PATH
📋 Let PR Pilot execute a plan for you.
Options:
--help Show this message and exit.
📦 Installation
Two options are available for installing the CLI:
pip
pip install --upgrade pr-pilot-cli
Homebrew:
brew tap pr-pilot-ai/homebrew-tap
brew install pr-pilot-cli
⚙️ Configuration
The configuration file is located at ~/.pr-pilot.yaml
.
# Your API Key from https://app.pr-pilot.ai/dashboard/api-keys/
api_key: YOUR_API_KEY
# Default Github repository if not running CLI in a repository directory
default_repo: owner/repo
# Enabled --sync by default
auto_sync: true
# Suppress status messages by default
quiet: true
🤝 Contributing
Contributors are welcome to improve the CLI by submitting pull requests or reporting issues. For more details, check the project's GitHub repository.
📜 License
The PR Pilot CLI is open-source software licensed under the GPL-3 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pr_pilot_cli-1.8.10.tar.gz
.
File metadata
- Download URL: pr_pilot_cli-1.8.10.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 704c3961760fb75ce48ec163181fccff87cd250fc93f6314d37201adab946a6d |
|
MD5 | ea03208c9352351362958d9c3074f6f8 |
|
BLAKE2b-256 | 1462ded99016dfcd1ab91e0cdebd4f2082f0eac80e13655a88f07bbc125ef69c |
File details
Details for the file pr_pilot_cli-1.8.10-py3-none-any.whl
.
File metadata
- Download URL: pr_pilot_cli-1.8.10-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30dd4ed55e6430b2b7efbbee0787083392d5b367ef307e9d07406bb65746196 |
|
MD5 | 61716993c98046d53a125d2b8d500ab6 |
|
BLAKE2b-256 | a797ad14e2886091b7561ea5f546c3ae8ec767a5cd70c2a2addfacb8e7abecb9 |