Skip to content

Latest commit

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Iterator

Iterator finds bugs in a pull request and fixes them one by one. It uses any coding terminal (OpenCode, Claude Code, etc.) to do the actual work.

Install

curl -fsSL https://raw.githubusercontent.com/potrepka/iterator/main/install.sh | bash

Usage

Run this inside a git repository.

iterator PR [OPTIONS]

Arguments

FlagDefaultDescription
PR(required)Pull request number

Options

FlagDefaultDescription
--terminalopencode runCommand to run the coding terminal
--prompt/review $PRPrompt sent to the terminal ($PR and $BRANCH are replaced)
--outputbugs/$BRANCH.mdFile where bugs are collected ($PR and $BRANCH are replaced)
--search8Search iterations per round
--fix128Upper bound of fix iterations per round
--repeat4Number of rounds
--verbose(off)Show terminal output

Examples

Different terminals:

iterator 10
iterator 11 --terminal "claude -p"
iterator 12 --terminal "codex exec"
iterator 13 --terminal "gemini -p"

Custom prompt and output:

iterator 14 --prompt '/audit $PR'
iterator 15 --output 'output/$BRANCH.md'

Note: Use single quotes for --prompt and --output values. Double quotes will cause the shell to expand $PR and $BRANCH before Iterator can substitute them.

Fewer iterations:

iterator 16 --search 4 --repeat 2

How It Works

Each round has two phases:

  1. Search: Runs the review prompt for --search iterations in separate terminal sessions. Each session appends any bugs it finds to the output file, skipping duplicates.
  2. Fix: Picks the easiest bug to fix from the file, fixes it, removes it from the file, deletes the file if empty, commits the changes, and pushes. Repeats until the file is deleted or --fix iterations is reached.

The script runs Search and Fix for --repeat rounds, then exits.

Versioning

The script checks for a newer version on each run and updates itself if one is available.

License

MIT

About

Fix bugs in your PRs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages