Skip to content

owlsight review

Run AI-powered code review on changes between the current branch and a base branch.

bash
owlsight review --base <branch> [options]

Options

OptionAliasRequiredDefaultDescription
--base-bYesBase branch to diff against
--base-urlNohttps://api.openai.com/v1LLM API base URL
--api-keyNoLLM API key (or set OWLSIGHT_API_KEY)
--model-mNogpt-4oLLM model name
--output-oNoJSON output file path
--min-severityNoInfoMinimum severity: Critical, Warning, Info, Nitpick
--max-files-per-batchNo10Maximum files per review batch
--max-tool-roundtripsNo15Maximum tool-calling iterations
--working-dir-dNoCurrent directoryWorking directory

Examples

Basic Review

bash
$ owlsight review --base main --api-key sk-...

Review with Local LLM

bash
$ owlsight review -b main \
    --base-url http://localhost:11434/v1 \
    --model llama3 \
    --api-key ollama

Review with JSON Report

bash
$ owlsight review -b origin/develop \
    --api-key sk-... \
    --output review-report.json

Only Show Warnings and Above

bash
$ owlsight review -b main \
    --api-key sk-... \
    --min-severity Warning

Review a Different Directory

bash
$ owlsight review -b main \
    --api-key sk-... \
    -d /path/to/repo

Console Output

Findings are grouped by file, colored by severity:

  src/UserService.cs
  CRITICAL  SQL injection vulnerability (src/UserService.cs:42-45)
    User input is interpolated directly into SQL query.
    Suggestion: Use parameterized queries instead.
    Rule: sql-injection

  WARNING   Missing null check (src/UserService.cs:28)
    GetUser() may return null but caller does not check.
    Suggestion: Add null check or use the null-conditional operator.

  src/Controllers/UserController.cs
  INFO      Consider using async/await (src/Controllers/UserController.cs:15)
    Synchronous database call in controller action.
    Suggestion: Use the async version of the database method.

  ╭──────────────────────────────╮
  │ Review Summary               │
  ├──────────────┬───────────────┤
  │ Files        │ 4             │
  │ Findings     │ 3             │
  │ Critical     │ 1             │
  │ Warning      │ 1             │
  │ Info         │ 1             │
  ╰──────────────┴───────────────╯

  Review FAILED — critical issues found.

JSON Output

When --output is specified, a JSON report is written with this schema:

json
{
  "version": "1.0.0",
  "timestamp": "2026-02-09T15:30:00+00:00",
  "summary": {
    "totalFindings": 3,
    "bySeverity": {
      "Critical": 1,
      "Warning": 1,
      "Info": 1
    },
    "reviewedFilesCount": 4,
    "batchCount": 1
  },
  "findings": [
    {
      "file": "src/UserService.cs",
      "line": 42,
      "endLine": 45,
      "severity": "Critical",
      "title": "SQL injection vulnerability",
      "description": "User input is interpolated directly into SQL query.",
      "suggestion": "Use parameterized queries instead.",
      "ruleId": "sql-injection"
    }
  ]
}

Finding Fields

FieldTypeDescription
filestringRelative path to the file
lineint?Start line number
endLineint?End line number
severitystringCritical, Warning, Info, or Nitpick
titlestringShort description of the issue
descriptionstringDetailed explanation
suggestionstring?How to fix the issue
ruleIdstring?ID of the matched custom rule

Exit Codes

CodeMeaning
0Review passed — no critical findings
1Review failed — one or more critical findings
2Error — missing API key, LLM failure, git error, etc.

Use exit code 1 as a CI/CD gate:

bash
owlsight review --base main --api-key $KEY || echo "Review failed"

How It Works

  1. Diff — runs git diff <base-branch> to get changed files
  2. Filter — excludes files matching patterns in review.excludePatterns
  3. Batch — groups files into batches of maxFilesPerBatch
  4. Review — for each batch, runs the agentic loop:
    • Sends diff + rules to the LLM
    • LLM uses tools to investigate code context
    • LLM returns structured findings
  5. Aggregate — collects findings from all batches
  6. Filter — removes findings below minSeverity
  7. Output — writes console and/or JSON output