{"id":30991686,"url":"https://github.com/frobware/autoprat","last_synced_at":"2025-09-12T20:47:38.447Z","repository":{"id":292846075,"uuid":"982124746","full_name":"frobware/autoprat","owner":"frobware","description":"Autonomous Pull Request Automation Tedium Killer","archived":false,"fork":false,"pushed_at":"2025-08-18T10:59:51.000Z","size":320,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T00:38:15.387Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frobware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-12T12:11:49.000Z","updated_at":"2025-08-18T10:59:54.000Z","dependencies_parsed_at":"2025-05-12T13:32:07.731Z","dependency_job_id":"92012566-6ae7-485f-b8ad-6ebac5bebca4","html_url":"https://github.com/frobware/autoprat","commit_stats":null,"previous_names":["frobware/autoprat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frobware/autoprat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fautoprat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fautoprat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fautoprat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fautoprat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frobware","download_url":"https://codeload.github.com/frobware/autoprat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fautoprat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274873613,"owners_count":25365824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-12T20:47:33.444Z","updated_at":"2025-09-12T20:47:38.438Z","avatar_url":"https://github.com/frobware.png","language":"Rust","readme":"# autoprat\n\n**Stop clicking through GitHub PRs one by one.**\n\nautoprat finds the PRs you care about and generates the commands to act on them in bulk.\n\n## The Problem\n\nYou maintain a busy repository. Every day you need to:\n- Approve PRs from trusted contributors like Dependabot\n- Give `/ok-to-test` to PRs that need it\n- Comment on failing PRs to restart CI\n- Find PRs missing reviews\n\nOpening each PR in a browser tab gets old fast.\n\n## The Solution\n\n```bash\n# Find PRs that need approval.\nautoprat -r owner/repo --needs-approve\n\n# Generate approval commands for Dependabot PRs.\nautoprat -r owner/repo --author dependabot --approve\ngh pr comment 123 --repo owner/repo --body \"/approve\"\ngh pr comment 456 --repo owner/repo --body \"/approve\"\n\n# Execute those commands.\nautoprat -r owner/repo --author dependabot --approve | sh\n```\n\nautoprat queries GitHub once, applies your filters, and outputs standard `gh` commands you can review before running.\n\n## Quick Start\n\n```bash\n# Install.\ncargo install --git https://github.com/frobware/autoprat.git\n\n# See what needs your attention.\nautoprat -r your-org/your-repo --needs-approve --needs-lgtm\n\n# Focus on specific PRs by number or URL.\nautoprat -r your-org/your-repo --detailed 123 456\nautoprat --detailed https://github.com/your-org/your-repo/pull/123\n\n# Exclude specific PRs from processing.\nautoprat -r your-org/your-repo --needs-approve --exclude 123,456 --approve\nautoprat -r your-org/your-repo --exclude https://github.com/your-org/your-repo/pull/789 --lgtm\n\n# Monitor PRs across multiple repositories.\nautoprat --detailed https://github.com/org/repo1/pull/123 https://github.com/org/repo2/pull/456\n\n# Approve trusted bot PRs.\nautoprat -r your-org/your-repo --author dependabot --approve | sh\n\n# Handle PRs needing testing permission.\nautoprat -r your-org/your-repo --needs-ok-to-test --ok-to-test | sh\n```\n\n## Common Workflows\n\n### Daily Maintenance\n```bash\n# What needs my attention today?\nautoprat -r myorg/myrepo --needs-approve --needs-lgtm\n\n# Bulk approve Dependabot PRs.\nautoprat -r myorg/myrepo --author dependabot --approve | sh\n\n# Give testing permission to community PRs.\nautoprat -r myorg/myrepo --needs-ok-to-test --ok-to-test | sh\n```\n\n### CI Firefighting\n```bash\n# Find failing PRs.\nautoprat -r myorg/myrepo --failing-ci\n\n# See detailed failure info with logs.\nautoprat -r myorg/myrepo --failing-ci --detailed-with-logs\n\n# Comment on all failing PRs.\nautoprat -r myorg/myrepo --failing-ci --comment \"Investigating CI failures\" | sh\n\n# Retest failing PRs.\nautoprat -r myorg/myrepo --failing-ci --retest | sh\n\n# Override specific failing check across multiple PRs.\nautoprat -r myorg/myrepo --failing-check \"ci/test-flaky\" \\\n  --comment \"/override ci/test-flaky\" | sh\n\n# Close stale PRs with failing CI, excluding specific ones.\nautoprat -r myorg/myrepo --failing-ci --author \"external-contributor\" \\\n  --exclude 123,456 --close | sh\n```\n\n### Advanced Filtering\n```bash\n# PRs from specific author that need LGTM.\nautoprat -r myorg/myrepo --needs-lgtm --author \"dependabot\"\n\n# High priority bugs without holds.\nautoprat -r myorg/myrepo --label \"priority/high\" --label \"kind/bug\" --label \"-do-not-merge/hold\"\n\n# PRs missing approval from specific author, excluding some.\nautoprat -r myorg/myrepo --author \"trusted-contributor\" --needs-approve --exclude 789\n\n# Raw GitHub search queries for complex filtering.\n# Note: 'is:pr' and 'is:open' are automatically added if not present\nautoprat --query \"repo:myorg/myrepo author:dependabot created:\u003e2024-01-01\"\nautoprat --query \"repo:myorg/myrepo status:failure comments:\u003e5\"\nautoprat --query \"repo:myorg/myrepo label:bug -label:wontfix updated:\u003e2024-01-01\"\n```\n\n### Multi-Repository Workflows\n```bash\n# Monitor related PRs across multiple repositories.\nautoprat --detailed \\\n  https://github.com/myorg/backend/pull/123 \\\n  https://github.com/myorg/frontend/pull/456\n\n# Apply filters across multiple repositories.\nautoprat --author dependabot --approve \\\n  https://github.com/myorg/repo1/pull/123 \\\n  https://github.com/myorg/repo2/pull/456\n\n# Bulk approve Dependabot PRs across an organization.\nautoprat --author \"dependabot\" --approve \\\n  https://github.com/myorg/backend/pull/789 \\\n  https://github.com/myorg/frontend/pull/101 \\\n  https://github.com/myorg/docs/pull/202\n```\n\n## How It Works\n\n**Workflow:** specify repository → apply filters → choose actions → select output format\n\n1. **Parallel API calls** fetch all open PRs from specified repositories with labels, CI status, and recent comments\n2. **Filter in memory** using your criteria (author, labels, CI status, etc.) applied globally across all repositories\n3. **Generate standard gh commands** that you can review before executing\n4. **Execute selectively** by piping to shell or running commands individually\n\nautoprat never executes commands itself - it only generates `gh pr comment` commands for you to review and run.\n\n## Smart Features\n\n### Idempotent Actions\nBuilt-in actions are smart and safe to run repeatedly:\n```bash\n# Safe to run multiple times - only acts when needed.\nautoprat -r myorg/myrepo --approve | sh\n```\n\nThe conditional actions (`--approve`, `--lgtm`, `--ok-to-test`) check existing labels and only generate commands when appropriate, whilst `--close` and `--retest` always execute when specified. Perfect for automation - no duplicate comments, no spam.\n\n### Comment Throttling\nPrevent spam when running in loops:\n```bash\n# Only post if same comment wasn't posted in last 30 minutes.\nautoprat -r myorg/myrepo --failing-ci \\\n  --comment \"Restarting CI\" --throttle 30m | sh\n\n# Post multiple comments to each matching PR.\nautoprat -r myorg/myrepo --failing-ci \\\n  --comment \"Investigating failures\" \\\n  --comment \"/retest\" | sh\n```\n\n### Intelligent Detailed Output\nTwo levels of detail for different needs:\n\n**Basic detailed (`-d`)** - Detailed PR tree view with URLs:\n```bash\n# See PR status, labels, and CI check results.\nautoprat -r myorg/myrepo --detailed\n\n# Focus on failing PRs with full status tree.\nautoprat -r myorg/myrepo --failing-ci --detailed\n```\n\n**Detailed with logs (`-D`)** - Same as `-d` plus automatic error log extraction:\n```bash\n# See WHY CI checks are failing without clicking URLs.\nautoprat -r myorg/myrepo --failing-ci --detailed-with-logs\n\n# Get immediate failure insights for triage.\nautoprat -r myorg/myrepo --detailed-with-logs\n```\n\n\n### Safety First\nAlways review before executing:\n```bash\n# 1. See what would happen.\nautoprat -r myorg/myrepo --needs-approve --approve\n\n# 2. Execute if satisfied.\nautoprat -r myorg/myrepo --needs-approve --approve | sh\n```\n\n## All Options\n\n### Repository\n- `-r, --repo \u003cREPO\u003e` - GitHub repository in format 'owner/repo' (required when using numeric PR arguments or no PR arguments)\n\n### Positional Arguments\n- `[PRS]...` - Focus on specific PRs by number or URL (can specify multiple)\n  - Numbers: `123 456` (requires `--repo`)\n  - URLs: `https://github.com/owner/repo/pull/123`\n  - Mixed: `123 https://github.com/owner/repo/pull/456` (requires `--repo` for numeric args)\n  - Multi-repo: `https://github.com/org/repo1/pull/123 https://github.com/org/repo2/pull/456`\n\n### Exclusions\n- `-E, --exclude \u003cPR\u003e` - Exclude specific PRs from processing (can specify multiple or comma-separated)\n  - Numbers: `--exclude 123,456` (requires `--repo`)\n  - URLs: `--exclude https://github.com/owner/repo/pull/123`\n  - Mixed: `--exclude 123 --exclude https://github.com/owner/repo/pull/456`\n  - Spaces friendly: `--exclude \"123, 456\"` (automatically trimmed)\n  - Empty values ignored: `--exclude \"\"` or `--exclude \"123,,\"` (trailing commas OK)\n\n### Filters (combine with AND logic)\n- `-a, --author \u003cAUTHOR\u003e` - Exact author match\n- `--label \u003cLABEL\u003e` - Has label (prefix `-` to negate, can specify multiple)\n- `--failing-ci` - Has failing CI checks\n- `--failing-check \u003cFAILING_CHECK\u003e` - Specific CI check is failing (exact match)\n- `--needs-approve` - Missing 'approved' label\n- `--needs-lgtm` - Missing 'lgtm' label\n- `--needs-ok-to-test` - Has 'needs-ok-to-test' label\n- `--query \u003cQUERY\u003e` - Raw GitHub search query (automatically adds `is:pr` and `is:open` if not present, mutually exclusive with all other filters and repository specification)\n\n### Actions\n- `--approve` - Generate `/approve` comments\n- `--lgtm` - Generate `/lgtm` comments\n- `--ok-to-test` - Generate `/ok-to-test` comments\n- `--close` - Close PRs\n- `--retest` - Generate `/retest` comments\n- `--comment \u003cCOMMENT\u003e` - Generate custom comment commands (can specify multiple)\n- `--throttle \u003cTHROTTLE\u003e` - Skip if same comment posted recently (e.g. `5m`, `1h`)\n\n### Output\n- `-d, --detailed` - Show detailed PR information\n- `-D, --detailed-with-logs` - Show detailed PR information with error logs from failing checks\n- `-q, --quiet` - Print PR numbers only\n- `-L, --limit \u003cLIMIT\u003e` - Limit the number of PRs to process [default: 30]\n\n### Debugging\nUse the `RUST_LOG` environment variable for granular tracing:\n```bash\n# GitHub API operations only\nRUST_LOG=autoprat::github=debug autoprat -r repo\n\n# Error pattern matching and log analysis only\nRUST_LOG=autoprat::log_fetcher=debug autoprat -r repo -D\n\n# Rate limiting and API quota tracking only\nRUST_LOG=autoprat::rate_limit=debug autoprat -r repo\n\n# All autoprat debugging\nRUST_LOG=autoprat=debug autoprat -r repo -D\n\n# Multiple categories\nRUST_LOG=autoprat::github=debug,autoprat::rate_limit=debug autoprat -r repo\n```\n\n### Other\n- `-h, --help` - Print help\n- `-V, --version` - Print version\n\n## Installation\n\n### Prerequisites\n- [GitHub CLI (`gh`)](https://cli.github.com/) installed and authenticated\n- Rust 1.76+ (if building from source)\n- Rust 1.89+ (if running clippy locally to match CI)\n\n### Install\n```bash\n# Install directly from Git (like go install).\ncargo install --git https://github.com/frobware/autoprat.git\n\n# Or build from source.\ngit clone https://github.com/frobware/autoprat.git\ncd autoprat\ncargo build --release\n\n# The binary will be at target/release/autoprat\n# You can copy it to your PATH:\ncp target/release/autoprat ~/.local/bin/autoprat\n```\n\n## Tips\n\n1. **Start with filters** - Run without action flags to see which PRs match\n2. **Review before executing** - Always check generated commands first\n3. **Focus on specific PRs** - Add PR numbers or URLs as arguments: `autoprat -r repo -d 123 456` or `autoprat -d https://github.com/owner/repo/pull/123`\n   **Multi-repository** - Monitor PRs across repositories: `autoprat -d https://github.com/org/repo1/pull/123 https://github.com/org/repo2/pull/456`\n4. **Exclude problematic PRs** - Use `--exclude` to skip specific PRs: `autoprat -r repo --approve --exclude 123,456`\n5. **Use throttling** - Prevent spam with `--throttle` in automated workflows\n6. **Combine filters** - Multiple filters use AND logic for precise targeting\n7. **Exact check names** - Use `--failing-check` with exact CI check names for safety\n8. **Script the common cases** - Save frequent filter combinations as shell aliases\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fautoprat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrobware%2Fautoprat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fautoprat/lists"}