AI-powered code reviewer and autonomous developer agent
Project description
🐒 Infinite Monkey Agent
An intelligent, lightweight, zero-dependency Python package and GitHub Action that serves a dual role:
- AI Code Review Judge: Evaluates Pull Request diffs, runs test suites, and leaves inline review comments or workflow annotations.
- Autonomous Developer Agent: Listens for created issues, executes a tool-calling development loop (reads files, writes fixes, runs tests), pushes code to a branch, opens a Pull Request, and links it back to the issue.
📦 Installation
To install the CLI tool globally or in your local python environment:
pip install infinite-monkey-agent
To run it locally in development mode from the cloned source directory:
# In the repository root
pip install .
🛠️ CLI Subcommands & Local Usage
Once installed, the CLI tool can be executed using the infinite-monkey-agent command:
1. PR Code Review Mode (review)
Runs a git diff against a branch and reviews code modifications.
# Review changes compared to main branch
infinite-monkey-agent review --branch main
# Run review offline on a saved .diff file (mock LLM mode)
infinite-monkey-agent review --diff-file ./path/to/my.diff --mock
2. Autonomous Developer Mode (develop)
Solves an issue in a workspace loop until code compiles and tests pass.
# Run developer agent locally using a mock issue payload
infinite-monkey-agent develop --issue-file ./issue_payload.json --mock
🚀 GitHub Actions Setup
Add these workflows under .github/workflows/ in your target repository:
📋 1. Pull Request Code Review (.github/workflows/ai-review.yml)
Runs whenever a PR is opened or updated, executing tests and placing comments on lines with issues.
name: AI Pull Request Reviewer
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # Required to post inline review comments
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run AI Code Reviewer
uses: zakerytclarke/infinite-monkey-agent@main
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
model: 'google/gemini-2.5-pro'
run_tests: 'true'
🚀 2. Autonomous Issue Developer (.github/workflows/ai-developer.yml)
Runs when a new issue is opened. The developer agent checks out code, runs a loop to implement modifications, pushes a branch, and opens a Pull Request.
name: AI Issue Developer
on:
issues:
types: [opened]
jobs:
develop:
runs-on: ubuntu-latest
permissions:
contents: write # Required to checkout code, create branches, and push commits
pull-requests: write # Required to open the PR
issues: write # Required to leave comments linking back to the PR
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run AI Developer Agent
uses: zakerytclarke/infinite-monkey-agent@main
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
model: 'google/gemini-2.5-pro'
run_tests: 'true'
max_steps: '15' # Limit development loops to control execution time
🐍 Publishing to PyPI (Continuous Delivery)
Whenever a commit is merged or pushed directly to the main branch, a GitHub Action automatically builds the python source package and wheel, then deploys them to PyPI using Trusted Publishers.
See the release workflow config in .github/workflows/release.yml.
🔑 Authentication Settings
Configure any of the following environment keys or inputs to authenticate:
- OpenRouter: Set
openrouter_api_keyinput orOPENROUTER_API_KEYenv. - OpenAI: Set
openai_api_keyinput orOPENAI_API_KEYenv. - Gemini: Set
gemini_api_keyinput orGEMINI_API_KEYenv.
📄 License
This project is licensed under the MIT 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infinite_monkey_agent-1.0.0.tar.gz.
File metadata
- Download URL: infinite_monkey_agent-1.0.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76c46e29c3df284f360fafa9b11a4eb5fa7709fb366b2ac08cda276d61c2a330
|
|
| MD5 |
250a028a502a9375bba7652ec772a10c
|
|
| BLAKE2b-256 |
2f63ff4e4f15b66ea279c7c4651074eeb6c2419e0112104cc01e13f01a49445a
|
Provenance
The following attestation bundles were made for infinite_monkey_agent-1.0.0.tar.gz:
Publisher:
release.yml on zakerytclarke/infinite-monkey-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infinite_monkey_agent-1.0.0.tar.gz -
Subject digest:
76c46e29c3df284f360fafa9b11a4eb5fa7709fb366b2ac08cda276d61c2a330 - Sigstore transparency entry: 1705812903
- Sigstore integration time:
-
Permalink:
zakerytclarke/infinite-monkey-agent@9ef74f37b1be657d70cfde9d5eb8e63d06ecb624 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zakerytclarke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9ef74f37b1be657d70cfde9d5eb8e63d06ecb624 -
Trigger Event:
push
-
Statement type:
File details
Details for the file infinite_monkey_agent-1.0.0-py3-none-any.whl.
File metadata
- Download URL: infinite_monkey_agent-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50a93b5100cc0005611ce96fa626084946c8dc1013eeafcdb29d78fe96c3e845
|
|
| MD5 |
0b14e91111f42723a6465c0de34fea54
|
|
| BLAKE2b-256 |
4319a311f6ea02a78392326881e7b2e25a6ce276bf539998692f23bcc221fbe6
|
Provenance
The following attestation bundles were made for infinite_monkey_agent-1.0.0-py3-none-any.whl:
Publisher:
release.yml on zakerytclarke/infinite-monkey-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infinite_monkey_agent-1.0.0-py3-none-any.whl -
Subject digest:
50a93b5100cc0005611ce96fa626084946c8dc1013eeafcdb29d78fe96c3e845 - Sigstore transparency entry: 1705812921
- Sigstore integration time:
-
Permalink:
zakerytclarke/infinite-monkey-agent@9ef74f37b1be657d70cfde9d5eb8e63d06ecb624 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zakerytclarke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9ef74f37b1be657d70cfde9d5eb8e63d06ecb624 -
Trigger Event:
push
-
Statement type: