AI Code Reviewer

🤖 AI Code Reviewer

A CLI tool that uses Codex or Claude Code to review GitHub Pull Requests with AI-powered agentic analysis. It performs deep code review including bug detection, security analysis, performance checks, error handling, and test coverage.

Installation

Install the AI CLI globally:
npm install -g @nayan-ui/ai
Or use directly with npx:
npx @nayan-ui/ai review <pr-url> --token ghp_xxx

Prerequisites

Codex CLI (default LLM) — login first:
npx @openai/codex login
Claude Code CLI (optional) — if using --llm claude:
claude login

Usage

Review a GitHub Pull Request for code issues:
nayan-ai review https://github.com/owner/repo/pull/123 --token ghp_xxx
Dry run (analyze without posting comments):
nayan-ai review https://github.com/owner/repo/pull/123 --token ghp_xxx --dry
Post inline comments on files instead of summary:
nayan-ai review https://github.com/owner/repo/pull/123 --token ghp_xxx --inline
Use Claude Code instead of Codex:
nayan-ai review https://github.com/owner/repo/pull/123 --token ghp_xxx --llm claude

Options

OptionDescription
-t, --tokenGitHub personal access token (required)
-l, --llmLLM provider: codex (default) or claude
-d, --dryAnalyze without posting comments to GitHub
-i, --inlinePost inline comments on files instead of summary

What It Checks

🐛 Bug Detection

Logic errors, null pointer issues, race conditions, and edge cases

🔐 Security Analysis

SQL injection, XSS, hardcoded secrets, and auth issues

⚡ Performance Checks

Memory leaks, N+1 queries, and unnecessary computations

🛡️ Error Handling

Missing try/catch, unhandled promises, and silent failures

✅ Test Coverage

Checks if tests are added for new functionality

📊 Summary Report

Provides an overview of all issues found in the PR