Skip to main content

A CLI tool to run Claude on git worktrees with automated commits

Project description

Papagai Logo

papagai

papagai is a commandline utility to have Claude go off and do something in a git repository. Any changes made by claude are done in a worktree, allowing multiple tasks to work simultaneously.

Installation

$ pip install https://github.com/whot/papagai

If running from the git repository, use uv:

$ uv run papagai

Usage

The primary subcommands are code and do to get Claude to do something. They are identical but the code command primes Claude to be a half-decent programmer so you can focus on merely the task instructions.

$ papagai code
Please tell me what you want me to do (Ctrl+D to complete)
Update all .format() strings with f-strings
Working in papagai/main-2025-11-12-7be3946e (based off main)
[...]
My work here is done. Check out branch papagai/main-2025-11-12-7be3946e or papagai/latest

# The same by passing instructions via a file
$ echo "Update all .format() strings with f-strings" > instructions.md
$ papagai code instructions.md
[...]
My work here is done. Check out branch papagai/main-2025-11-12-abc134fe or papagai/latest

The papagai/latest branch is always updated to point to the most recent papagai branch.

The do command works exactly the same way but it does not prime Claude so you will have to add this to the task (if need be).

# Instructions via a file
$ echo "You are a native spanish speaker. Translate all strings to Spanish" > instructions.md
$ papagai do instructions.md

The instructions should be in Markdown. If there is a frontmatter key "tools" it is extracted and passed to Claude as the set of allowed tools. For example:

---
tools: Bash(uv :*)
---
Update all .format() strings with f-strings

If you really trust Claude, you can tell it to create a new proper branch directly or merge the results into the current branch:

$ papagai code --branch new-features instructions.md
$ papagai code --branch . instructions.md

This will still create the papagai branches but also merge them back into the given branch (where . stands for "current branch").

Pre-written tasks

The papagai task command runs pre-written tasks. These are read from $XDG_CONFIG_HOME/papagai/tasks/**/*.md and must look like this:

---
description: some description
---
You are a very smart LLM. Blah blah.

Additionally papagai ships with built-in tasks. These are tasks that were (somewhat) successfully used elsewhere and might be useful for other repos.

$ papagai task --list
[...]
python/update-to-3.9                ... update a Python code base to Python 3.9+
$ papagai task python/update-to-3.9

The --list command will also list any tasks in XDG_CONFIG_HOME.

Variable substitution in task files

  • {BRANCH} is replaced with the original branch
  • {WORKTREE_BRANCH} is replaced with the current working branch

Code Review

The review command is a convenience shortcut for running a code review:

$ papagai review

This command will review all commits on the current branch, providing inline feedback and creating fixup commits for any issues found.

Cleanup

papagai works on branches (and in workdirs), if you want to get rid yourself of any leftover branches use:

$ papagai purge

Acknowledgements

papagai is motivated by and based on claude-review-agent.

Most of papagai (especially the tests!) was written using Claude.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

papagai-0.2.0.tar.gz (625.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

papagai-0.2.0-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file papagai-0.2.0.tar.gz.

File metadata

  • Download URL: papagai-0.2.0.tar.gz
  • Upload date:
  • Size: 625.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for papagai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 96b249cad665cbf1686b36aca6d9d500d8c217b68ed0583d37cd103e54c75c38
MD5 525ad1f9c160f5c34e1e7535f2c60843
BLAKE2b-256 f31ab551218bf65816bbbd689aac56332f9f45f700a4671751c466fc09e4e87d

See more details on using hashes here.

File details

Details for the file papagai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: papagai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for papagai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d96663369adc98446c950a0c8496dc80def08766dd18b32dfa7d8ef722646e7
MD5 9885e08a3a87fd9d958f6a36f84f1a7c
BLAKE2b-256 15324ceba437aa2c8c8bdc68db54f25492e7f3d8dcc88100e3ac1a34e698736f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page