Skip to main content

CLI Commands

prisma-airs-hooks CLI

After installing globally with npm install -g @cdot65/prisma-airs-cursor-hooks:

CommandDescription
prisma-airs-hooks install [--global]Register hooks in Cursor's hooks.json
prisma-airs-hooks uninstall [--global]Remove AIRS entries from hooks.json
prisma-airs-hooks verify [--global]Check hooks registration, config, and env vars (use --global for ~/.cursor)
prisma-airs-hooks validate-connectionTest AIRS API connectivity with your credentials
prisma-airs-hooks validate-detectionSend a test prompt injection and verify detection
prisma-airs-hooks stats [--since <duration>] [--json]Show scan statistics
prisma-airs-hooks logs [--n 10] [--json]Show the most recent scan log entries
prisma-airs-hooks rotate-logRotate the scan log immediately
prisma-airs-hooks validate-configValidate the AIRS configuration (no API calls)
prisma-airs-hooks doctorDiagnose the installation and apply safe repairs

Examples

# Install hooks for all workspaces
prisma-airs-hooks install --global

# Check everything is working (use --global if you installed with --global)
prisma-airs-hooks verify --global

# Stats for the last 7 days as JSON
prisma-airs-hooks stats --since 7d --json

# Review the last 20 scan log entries
prisma-airs-hooks logs --n 20

# Validate config and repair problems
prisma-airs-hooks validate-config
prisma-airs-hooks doctor

# Remove hooks
prisma-airs-hooks uninstall --global

npm run scripts (from source)

When working from a cloned repository:

Build & Test

CommandDescription
npm run buildCompile hooks to dist/
npm testRun all tests
npm run test:watchRun tests in watch mode
npm run typecheckTypeScript type checking (tsc --noEmit)

Hook Management

CommandDescription
npm run install-hooksInstall hooks to .cursor/hooks.json (project-level)
npm run install-hooks -- --globalInstall hooks to ~/.cursor/hooks.json (all workspaces)
npm run install-hooks -- --optional <names|all>Also register optional hooks (comma-separated names or all)
npm run uninstall-hooksRemove AIRS entries (core + optional) from project-level hooks.json
npm run uninstall-hooks -- --globalRemove AIRS entries from global hooks.json
npm run verify-hooksCheck project-level hooks registration, config, and env vars
npm run verify-hooks -- --globalCheck global (~/.cursor) hooks registration and config

Validation

CommandDescription
npm run validate-connectionTest AIRS API connectivity with your credentials
npm run validate-detectionSend a test prompt injection and verify detection
npm run validate-configValidate the AIRS configuration (no API calls)
npm run doctorDiagnose the installation and apply safe repairs

Statistics & Logs

CommandDescription
npm run statsShow scan statistics (all time)
npm run stats -- --since 7dStats for the last 7 days
npm run stats -- --since 1d --jsonStats as JSON output
npm run logsShow the most recent scan log entries
npm run logs -- --n 20Show the last 20 scan log entries
npm run rotate-logRotate the scan log immediately

stats and logs both read the scan log from your AIRS config (logging.path, default ~/.cursor/hooks/airs-scan.log), so they report on the same log your hooks actually write to — regardless of the directory you run them from.

Documentation

CommandDescription
npm run docs:serveLocal docs preview at http://localhost:3000
npm run docs:buildBuild static docs site to docs-site/build/