AI Code Scanner

🛡️ AI Code Scanner

Scan GitHub repositories for package vulnerabilities using native security tools combined with AI-powered analysis. Supports auto-fix with automatic PR creation.

Installation

Install the AI CLI globally:
npm install -g @nayan-ui/ai
Or use directly with npx:
npx @nayan-ui/ai scan <repo-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

Basic scan — detect and analyze all projects in the repo:
nayan-ai scan https://github.com/owner/repo --token ghp_xxx
Scan specific paths in the repo:
nayan-ai scan https://github.com/owner/repo --token ghp_xxx --paths packages/api,packages/web
Auto-fix vulnerabilities and create a PR:
nayan-ai scan https://github.com/owner/repo --token ghp_xxx --fix
Auto-fix with custom branch name:
nayan-ai scan https://github.com/owner/repo --token ghp_xxx --fix --branch nayan-ai/security-updates
Use Claude Code instead of Codex:
nayan-ai scan https://github.com/owner/repo --token ghp_xxx --llm claude

Options

OptionDescription
-t, --tokenGitHub personal access token (required)
-l, --llmLLM provider: codex (default) or claude
-p, --pathsComma-separated list of paths to scan for projects
-f, --fixAuto-fix vulnerabilities and create a PR
-b, --branchBranch name for fix PR (default: nayan-ai/security-fixes-<timestamp>)

Supported Project Types

TypeManifestNative Scanner
npmpackage.jsonnpm audit
Pythonrequirements.txtpip-audit
Gogo.modgovulncheck
RustCargo.tomlcargo audit
RubyGemfilebundle audit
PHPcomposer.jsoncomposer audit
Javapom.xmlmvn dependency-check
.NET*.csprojdotnet list --vulnerable

Auto-Fix Workflow

When using --fix, Nayan AI will:

1. Analyze

Analyze vulnerabilities and generate fixes using AI

2. Create Branch

Create a new branch with the security fixes

3. Update Files

Update manifest files (package.json, requirements.txt, etc.)

4. Create PR

Commit, push, and create a Pull Request with detailed description