GitHub PR-based code review workflow for AI-assisted development.
ghreview bridges the gap between AI-assisted coding and GitHub's superior code review interface. It allows you to review AI-generated code changes using GitHub's familiar PR review tools while keeping your local repository pristine.
ghreview init pushes your current state to a dedicated review repository without affecting your local git stateghreview collect gathers your feedback in a format optimized for AI consumption# Create review PR
npx ghreview init
# Collect feedback after reviewing on GitHub
npx ghreview collect <PR-number>
# Install globally
npm install -g ghreview
# Use commands
ghreview init
ghreview collect <PR-number>
repo scope - this grants full control of private repositories
Create a configuration file at ~/.ghreview/config.json:
{
"reviewRepo": "yourusername/ai-code-reviews",
"githubToken": "ghp_xxxxxxxxxxxxxxxxxxxx"
}
Replace yourusername with your GitHub username and paste your token in place of ghp_xxxxxxxxxxxxxxxxxxxx.
Security Note: Keep your token secure! The config file contains sensitive credentials. You may want to:
chmod 600 ~/.ghreview/config.jsonThe review repository will be created automatically as a private repo if it doesn't exist.
{
"reviewRepo": "yourusername/ai-code-reviews",
"githubToken": "ghp_xxxxxxxxxxxxxxxxxxxx"
}
{
"reviewRepo": "yourusername/ai-code-reviews",
"githubToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"author": {
"name": "AI Assistant",
"email": "ai@example.com"
}
}
The author configuration makes commits appear as if they were created by the AI, making it clearer that you're reviewing the AI's proposed changes.
Make changes to your code (but don't commit them)
Create a review PR:
npx ghreview init
This will:
Review on GitHub:
Collect feedback:
# Using PR number (defaults to review repo)
npx ghreview collect 42
# Using full PR URL (works with any GitHub repo)
npx ghreview collect https://github.com/owner/repo/pull/123
This outputs formatted feedback that you can copy and paste into your AI assistant.
Iterate: Your local changes remain uncommitted, so you can continue working and create new review PRs as needed.
## Code Review Feedback
### File: src/auth/login.js
#### Line 45
Variable 'username' could be undefined here. Add null check.
#### Lines 67-70
Use consistent async/await instead of mixing with .then()
### File: src/utils/validation.js
#### Line 12
Regex for email validation is too permissive
#### Lines 23-28
**Comment 1:** This validation logic is duplicated in register.js
**Comment 2:** Consider extracting to a shared validation utility
### General Comments
---
Consider adding rate limiting to login attempts
---
The session token storage in localStorage is insecure
# Install dependencies
npm install
# Run linter
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Run tests
npm test
~/.ghreview/config.json)git@github.com: URLs for pushing)Apache-2.0