Skip to content
Projects

Ironankit525/nazar has 10 GitHub stars and 0 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-09 11:28 UTC. Last push 2026-10-29.

How these counts are measured

๐Ÿ‘๏ธ Free AI code review for every Indian developer. GitHub Action + CLI with two-pass review, one-click fixes and secret scanning, powered by BharatCode.

Measured star growth

in 24h
0
in 7 days
+1
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original
Nazar logo

BharatCode X Nazar ๐Ÿ‘๏ธ

Free AI code review for every Indian developer. One YAML file. Zero dollars. Powered by BharatCode.

CI Marketplace npm License: MIT Powered by BharatCode

๐Ÿ‘‰ See it live: demo pull requests in nazar-playground: SQL injection, a leaked key, a missing await, a Hinglish review, and a clean refactor that gets zero comments.

Nazar (เคจเคœเคผเคฐ) means "a watchful eye". It reads every pull request and push, catches real bugs and security holes, and suggests fixes you can apply in one click. It also stops you from leaking API keys.

AI code reviewers usually cost $15โ€“30 a month per developer, which leaves out most students and indie developers in India. Nazar runs on BharatCode's flat-rate API, which is free for students, and you can host it yourself as a GitHub Action. There's no server and no subscription, and your code only goes to BharatCode.

โœจ What it does

๐Ÿ› Finds real bugs Logic errors, missing await, null access, off-by-one, broken error handling: problems that hurt users. It doesn't nitpick style.
๐Ÿ” Catches security holes SQL/command injection, path traversal, XSS, auth mistakes, unsafe defaults.
๐Ÿ”‘ Stops leaked secrets A fast regex + entropy scanner (no AI, no hallucinations) for GitHub, OpenAI, Google, AWS, Razorpay, Stripe and Telegram keys, private keys, DB passwords and committed .env files. To silence a known false positive, add nazar:allow on that line.
โœ… One-click fixes Comments include GitHub suggestion blocks: click Commit suggestion and you're done.
๐Ÿง  Two-pass review A second "verifier" pass checks every finding and drops false positives before you see them. Flat-rate pricing is what makes the extra pass free.
๐Ÿ“ PR summary A short overview, a risk level, and a per-file walkthrough, kept in one comment that updates instead of spamming.
โšก Push mode Most students push straight to main. Nazar reviews those pushes too, with a commit comment and a job summary.
๐Ÿ‡ฎ๐Ÿ‡ณ Hinglish mode language: hinglish โ†’ "Yahan user input seedha SQL query mein ja raha hai, isse SQL injection ho sakta hai."
๐Ÿ’ฌ Ask it Comment @nazar explain on a PR for a plain-language walkthrough, or @nazar review to re-run.
๐Ÿ Build League ready Warns if BharatCode.txt is missing. npx nazar-review check tests whether your repo is ready to submit.

๐Ÿš€ Install in 2 minutes

1. Get a BharatCode API key. It's free for students: sign in at bharatcode.ai.

2. Add it as a repository secret named BHARATCODE_API_KEY:

gh secret set BHARATCODE_API_KEY        # or: Settings โ†’ Secrets and variables โ†’ Actions

3. Add the workflow. Either run npx nazar-review init in your repo, or create .github/workflows/nazar.yml:

name: Nazar Review

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
  push:
    branches: [main, master]
  issue_comment:
    types: [created]

permissions:
  contents: write # commit comments for push reviews
  pull-requests: write # PR review comments
  issues: write # replies to @nazar commands

concurrency:
  group: nazar-${{ github.event_name == 'issue_comment' && format('comment-{0}', github.event.comment.id) || github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

jobs:
  review:
    if: github.event_name != 'issue_comment' || (github.event.issue.pull_request && startsWith(github.event.comment.body, '@nazar'))
    runs-on: ubuntu-latest
    timeout-minutes: 12
    steps:
      - uses: Ironankit525/nazar@v1
        with:
          bharatcode-api-key: ${{ secrets.BHARATCODE_API_KEY }}

Commit, push, and open a pull request. ๐ŸŽ‰

No actions/checkout step is needed: Nazar reads everything through the GitHub API, which keeps it fast.

๐Ÿ’ป CLI: review before you push

export BHARATCODE_API_KEY=...            # same key
npx nazar-review                          # review uncommitted changes (or commits since main)
npx nazar-review --staged                 # only staged changes
npx nazar-review --base main --lang hinglish
npx nazar-review explain                  # plain-language walkthrough of your changes
npx nazar-review check --history          # Build League readiness + secrets in git history
npx nazar-review init --hook              # add the Action + a pre-push hook that blocks critical issues

review exits with code 1 when it finds critical issues (--fail-on high|medium|low|none to change), so it works as a git hook or in scripts. Add --json for machine-readable output.

โš™๏ธ Configuration

Optional. Create .github/nazar.yml:

language: en            # en | hinglish
max_comments: 10        # max inline comments per review
min_severity: medium    # low | medium | high | critical
focus: [security, bugs] # extra attention areas
ignore:                 # glob patterns to skip (lockfiles, dist/, *.min.js etc. are skipped already)
  - "docs/**"
instructions: |         # project context for the reviewer
  This is a Flask app using SQLAlchemy. Never use raw SQL strings.
verify: true            # second-pass verifier
summary: true           # PR summary + walkthrough
hackathon_checks: true  # BharatCode.txt / README checks
incremental: true       # on new commits, review only what changed since the last review
skip_drafts: true

Action inputs (language, max-comments, min-severity, verify, ignore, modelโ€ฆ) override the file. The full reference is in docs/configuration.md.

Action input Default
bharatcode-api-key โ€” Without it, only secret/repo checks run (useful for fork PRs)
fail-on none Fail the job at or above low/medium/high/critical
mode auto pr / push to force a mode
model qwen-3.8-27b Any model id from BharatCode's /models

Outputs: findings-count, critical-count, ai-status.

๐Ÿ—๏ธ How it works

 PR / push / @nazar โ”€โ”€โ–บ collect diff (GitHub API) โ”€โ”€โ–บ filter (lockfiles, generated, binaries, size caps)
                                                         โ”‚
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ–ผ                                                          โ–ผ
              Deterministic checks                                  AI review on BharatCode
              โ€ข secret scanner (regex+entropy)                      โ€ข number every diff line (L41 + code)
              โ€ข .env / node_modules committed                       โ€ข pack files into token-budgeted chunks
              โ€ข BharatCode.txt / README                             โ€ข pass 1: reviewer โ†’ JSON findings
                         โ”‚                                          โ€ข pass 2: verifier drops false positives
                         โ”‚                                          โ€ข summary + walkthrough
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                            โ–ผ
              validate (line really in the diff? suggestion sane?) โ†’ dedupe โ†’ rank โ†’ cap
                                            โ–ผ
              one PR review with inline comments + suggestion blocks, sticky summary comment,
              commit comment (push mode), job summary, outputs, optional fail-on

How a small, free model gets trustworthy reviews:

  • Numbered diff lines. The model cites L41, and Nazar throws away any finding on a line that isn't in the diff. Those are hallucinations, and GitHub would reject them anyway.
  • Strict JSON schema output, validated with zod and repaired with jsonrepair when needed.
  • A verifier pass that has to explicitly approve each finding.
  • No style nitpicks. The prompt only allows bugs, security, performance and error-handling issues, and the result is capped at max_comments.
  • It holds up when BharatCode is busy. 503 responses are retried with exponential backoff and jitter, there's a time budget, and partial failures still post what was found. If AI is unavailable, secret and repo checks still run and your CI never breaks because of Nazar.

The code is in src/core (pure logic, no GitHub dependency), src/action and src/cli. More detail: docs/architecture.md.

๐Ÿ“Š Accuracy

Nazar ships with an eval suite of realistic buggy and clean diffs (evals/cases): SQL and command injection, path traversal, missing await, off-by-one, null access, React state mutation, swallowed payment errors, plus clean code that should get zero comments.

BHARATCODE_API_KEY=... npm run eval            # precision / recall / noise on clean code
BHARATCODE_API_KEY=... npm run eval -- --no-verify

Latest run (qwen-3.8-27b on BharatCode, verifier on, 29 Oct 2026):

Planted bugs caught False positives Comments on clean code Extra real issues found
9 / 9 (100%), all on the right line 0 0 2

The 2 extras weren't in the answer key but are genuine: an unhandled rejection in an Express 4 async route, and a division by zero on an empty list. A typical review takes about 30โ€“90 seconds, depending on BharatCode's queue. This is a single run, so re-run it yourself to check.

๐Ÿ”’ Security & privacy

  • Diffs are sent only to BharatCode (https://bharatcode.ai/api/model/v1), using your key. Nazar has no server and collects no telemetry.
  • Nazar never checks out or runs PR code. Model output only ever becomes comment text, with @mentions, HTML and comment markers neutralised.
  • Detected secrets are always masked (ghp_โ€ฆ6789) in comments and logs, and the API key is masked in Action logs.
  • Fork PRs: on pull_request, secrets aren't available, so Nazar runs secret/repo checks only. See SECURITY.md before using pull_request_target.

๐Ÿ—บ๏ธ Roadmap

  • @nazar fix โ†’ push a commit applying a suggestion
  • GitLab / Bitbucket support
  • Review rules learned from ๐Ÿ‘/๐Ÿ‘Ž reactions
  • VS Code extension

๐Ÿค Contributing

PRs welcome! npm ci && npm run all runs typecheck, lint, tests and build. See CONTRIBUTING.md.


Built for the BharatCode Build League by Ankit Kumar. If Nazar caught something for you, please โญ the repo. It really helps.

Add the badge to your README: [![Reviewed by Nazar](https://img.shields.io/badge/reviewed%20by-Nazar%20๐Ÿ‘๏ธ-orange)](https://github.com/Ironankit525/nazar)

Explore related projects