@authoritylog/cli
v0.1.1
Published
AuthorityLog CLI — verify AI-generated code against authoritative sources
Readme
@authoritylog/cli
Real-time hallucination guard for AI coding assistants — verify every import and API call against authoritative sources.
AuthorityLog catches the functions, packages, and exports that AI assistants fabricate. Run it in CI to fail PRs that contain hallucinated references before they ship.
Install
npm install -g @authoritylog/cli
# or use directly without installing:
npx @authoritylog/cli check src/Usage
# Check a file
npx @authoritylog/cli check src/api.ts
# Check an entire directory
npx @authoritylog/cli check src/
# Show only fabricated references (suppress verified/deprecated)
npx @authoritylog/cli check src/ --severity errors-only
# JSON output for CI pipelines
npx @authoritylog/cli check src/ --format json
# Exit code 1 if any fabricated references found (use in CI)
npx @authoritylog/cli check src/ --fail-on errors
# Offline mode — use only local node_modules, no npm registry calls
npx @authoritylog/cli check src/ --network offline-only
# Clear the local npm registry cache
npx @authoritylog/cli cache clearWhat it verifies
| Category | Example | What's checked |
|---|---|---|
| Package existence | import ... from 'axios' | Does axios exist on npm? |
| Named exports | import { fetchMagically } from 'axios' | Is fetchMagically exported by axios? |
| Function signatures | axios.get(url, extra, tooMany) | Does get accept 3 arguments? |
| Method chains | axios.create().intercept() | Does .intercept() exist on the return type? |
Output
✗ Line 3: 'fetchMagically' is not exported by axios
Source: node_modules/axios/index.d.ts
Did you mean: 'get'?
✓ Line 1: Package 'ts-morph' found in node_modules
Source: node_modules/ts-morph
Summary: 3 ✓ 1 ✗ 0 ⚠Exit codes: 0 = clean, 1 = fabricated references found (when --fail-on errors is set).
VS Code / Cursor extension
Install the companion extension for inline gutter decorations and hover explanations:
ext install authoritylog.authoritylog