PandaOps is a TypeScript-based CLI tool that automatically analyzes Pull Requests using heuristics and AI (via OpenAI models). It fetches PR diffs, runs intelligent reviews, and posts actionable feedback directly to GitHub, Bitbucket, or Azure DevOps.
- Multi-platform support β Works with GitHub, Bitbucket, and Azure DevOps.
- AI-driven code reviews β Uses OpenAI models (default:
gpt-5-mini) to produce clear, concise feedback. - Heuristic scanning β Detects common issues like TODOs,
console.log,debugger, or large diffs. - Inline and summary comments β Posts detailed code-level feedback directly to PRs.
- Dry-run & JSON output modes β Preview or integrate with other tools.
- Configurable behavior β Focus AI on errors, warnings, tips, notes, or grammar.
- Fail-on flags β Enforce stricter CI/CD pipelines with
--fail-on-commentsor--fail-on-warnings.
npm install -g @omnedia/panda-opsOr use locally:
npm install @omnedia/panda-ops --save-devBuild from source:
git clone https://github.com/omnedia/panda-ops.git
cd panda-ops
npm install
npm run buildpanda-ops \
--provider github \
--repository owner/repo \
--pull-request-id 123 \
--token $GITHUB_TOKEN \
--openai-api-key $OPENAI_API_KEYYou can run PandaOps automatically on pull requests using GitHub Actions.
name: AI PR Review
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: omnedia/panda-ops@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
fail_on_warnings: true| Input | Description | Default |
|---|---|---|
github_token |
GitHub token (required) | β |
openai_api_key |
OpenAI API key (required) | β |
provider |
VCS provider (github, bitbucket, azure) |
github |
repository |
Repository identifier (owner/name) |
${{ github.repository }} |
pull_request_id |
PR number | ${{ github.event.pull_request.number }} |
dry_run |
Log output only, no posting | false |
output_json |
Output machine-readable JSON | false |
fail_on_comments |
Exit with code 2 if comments found | false |
fail_on_warnings |
Request changes if warnings found | false |
ai_enabled |
Enable AI processing | true |
max_comments |
Max number of comments | 50 |
openai_model |
Model name | gpt-5-mini |
openai_temperature |
Sampling temperature | 1 |
ai_focus_errors |
Detect critical/breaking issues | true |
ai_focus_warn |
Detect risky logic | true |
ai_focus_tips |
Suggest maintainability improvements | true |
ai_focus_notes |
Add design/architecture notes | false |
ai_focus_grammar |
Grammar/naming checks | false |
| Option | Description |
|---|---|
--dry-run |
Console-only output. |
--output-json |
Emit JSON report. |
--fail-on-comments |
Exit code 2 if comments found. |
--fail-on-warnings |
Mark PR as Changes Requested. |
--openai-model <model> |
Specify model (default: gpt-5-mini). |
--max-comments <n> |
Limit total AI + heuristic comments. |
src/
βββ main.ts # CLI entrypoint
βββ config.ts # Configuration and schema validation
βββ core/
β βββ reviewEngine.ts # AI + heuristic analysis logic
β βββ diffFetcher.ts # Unified diff retrieval
β βββ commentPoster.ts # Review posting logic
β βββ logger.ts # Pino-based logging
βββ adapters/
β βββ github.ts # GitHub API integration
β βββ bitbucket.ts # Bitbucket API integration
β βββ azure.ts # Azure DevOps API integration
npm install
npm run devBuild:
npm run buildLint:
npm run lintPandaOps requires read access to PR diffs and write access to post review comments.
For GitHub, recommended scopes:
repopull_requests
| Code | Meaning |
|---|---|
0 |
Success / Approved |
1 |
Configuration or execution error |
2 |
Comments found (--fail-on-comments) |
[PandaOps] --- DRY RUN ---
Comments: 5 (Heuristic 2 + AI 3)
- src/app.ts:24 [ERROR] Missing null check for user input.
- src/utils/db.ts:10 [WARN] Missing transaction rollback on error.
- src/routes/api.ts:3 [TIP] Avoid using console.log in production.
β
Summary: 5 issues detected β review before merging.
MIT Β© 2025 Omnedia
Pull requests and suggestions are welcome!
- Fork the repo
- Create a feature branch (
git checkout -b feature-name) - Commit changes and open a PR
Automate code reviews. Catch bugs before they merge. Let the Panda do the work. πΌ