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:
bash
npm install -g @nayan-ui/ai
Or use directly with npx:
bash
npx @nayan-ui/ai review <pr-url> --token ghp_xxx

Prerequisites

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

Usage

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

Tags