Skip to main content

🐒 Infinite Monkey Agent

License: MIT PyPI version GitHub Action Python

An intelligent, lightweight, zero-dependency Python package and GitHub Action that serves a dual role:

  1. AI Code Review Judge: Evaluates Pull Request diffs, runs test suites, and leaves inline review comments or workflow annotations.
  2. 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_key input or OPENROUTER_API_KEY env.
  • OpenAI: Set openai_api_key input or OPENAI_API_KEY env.
  • Gemini: Set gemini_api_key input or GEMINI_API_KEY env.

📄 License

This project is licensed under the MIT License.

Metadata

Release files for infinite-monkey-agent 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infinite-monkey-agent 1.0.0
File Size Uploaded
infinite_monkey_agent-1.0.0.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for infinite-monkey-agent 1.0.0
File Interpreter ABI Platform
infinite_monkey_agent-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.8 kB

Release files / infinite_monkey_agent-1.0.0.tar.gz

Download URL infinite_monkey_agent-1.0.0.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
76c46e29c3df284f360fafa9b11a4eb5fa7709fb366b2ac08cda276d61c2a330
BLAKE2b-256 checksum
How to use checksums
2f63ff4e4f15b66ea279c7c4651074eeb6c2419e0112104cc01e13f01a49445a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

Release files / infinite_monkey_agent-1.0.0-py3-none-any.whl

Download URL infinite_monkey_agent-1.0.0-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50a93b5100cc0005611ce96fa626084946c8dc1013eeafcdb29d78fe96c3e845
BLAKE2b-256 checksum
How to use checksums
4319a311f6ea02a78392326881e7b2e25a6ce276bf539998692f23bcc221fbe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page