Pre-install security interceptor for package managers. Scans every package against the OSV vulnerability database before it hits your system.
Shims sit ahead of your package managers in $PATH. Every install is scanned before execution.
Run primer scan <pkg> --ecosystem <eco> to check any package on demand without installing it.
Results cached locally for 24 hours. Repeat installs are instant with stale-on-error fallback.
Local SLM generates plain-English CVE summaries. No cloud dependency, no account required.
Pre-commit hook blocks commits that add vulnerable packages to manifests.
Covers Python, Node.js, Go, and Rust out of the box — one tool across your entire stack.
Diffs the lockfile after install to scan the full dependency tree — not just the package you named. Opt out per-command with --direct-only.
primer watch monitors manifests for changes and auto-scans on save. Debounced, cross-platform, and exits cleanly on Ctrl+C.
primer sbom emits a CycloneDX or SPDX Software Bill of Materials enriched with OSV vulnerability data.
primer mcp exposes a scan_package tool via the Model Context Protocol so AI coding agents (Claude Code, Cursor, Cline) can query vulnerability data before installing packages.
primer scan --file audits existing packages and prints a ready-to-run fix command (npm install pkg@fixed, pip install "pkg>=fixed") for every patched vulnerability.
Run primer <command> --help for full flag details.
| Command | Description |
|---|---|
primer scan <pkg> --ecosystem <eco> |
Scan a package for known vulnerabilities. Shows "Fixed in:" and a ready-to-run fix command when OSV provides a patched version. Flags: --version, --force, --verbose, --ai |
primer scan --file <manifest|lockfile> |
Audit all packages in an existing manifest or lockfile. Each vulnerable package shows its fix command (npm install pkg@fixed, pip install "pkg>=fixed", etc.). Use --direct-only to skip transitive deps |
primer scan --file <path> |
Scan all packages in a manifest or lockfile. Manifests: requirements.txt, pyproject.toml, package.json, go.mod, Cargo.toml. Lockfiles: package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, go.sum, uv.lock, poetry.lock. Add --direct-only to skip transitive packages. |
primer init |
Generate shims in ~/.primer/bin and prepend to $PATH |
primer info |
Show PATH order, shim health, cache stats, and active model (alias for doctor) |
| Command | Description |
|---|---|
primer allow add <pkg> [--ecosystem] |
Add a package to .primer-ignore — scanned but never blocked |
primer allow remove <pkg> [--ecosystem] |
Remove a package from the allow-list |
primer allow list |
Print all entries in .primer-ignore |
primer cache clear |
Delete all cached vulnerability results |
primer cache stats |
Show entry count, total size on disk, and oldest/newest entry age |
primer config set <key> <value> |
Write a value to ~/.primer/config.toml. Keys: ai.backend, ai.model, ai.tokenizer, intercept-restore, direct-only, prompt-threshold |
primer config get <key> |
Read a single config value |
primer config list |
Print the full config |
primer model add |
Download the default SmolLM2 model from HuggingFace Hub |
primer model add --from <path> |
Import a local GGUF file (no network) |
primer model add --repo <repo> --file <file> |
Download a specific model from HuggingFace Hub |
primer model list |
List registered models with path and file size |
primer model set <target> |
Set the active inference target. Local: /path/to/model.gguf. Ollama: ollama:llama3.2 |
primer model remove |
Interactive select list of all managed models — choose one or "Remove all" |
primer model remove <name>... |
Remove one or more named models without a prompt. Names: filename (smollm2.gguf) or Ollama target (ollama:llama3.2) |
primer model remove --all |
Remove all managed model files and clear config (non-interactive) |
primer hook install |
Write .git/hooks/pre-commit to block vulnerable package additions |
primer hook check |
Scan staged manifest changes manually (also called by the hook itself) |
primer watch [--directory <path>] [--scan] |
Watch manifest files and auto-scan on change. --scan runs an immediate scan on startup. Debounced at 500 ms; exit with Ctrl+C |
primer sbom --file <path> |
Emit a Software Bill of Materials. --format cyclonedx (default) or --format spdx. --output <file> writes to disk. --no-scan skips OSV enrichment |
primer mcp |
Start an MCP server over stdio. Add to .mcp.json so AI agents can call scan_package before installing packages |
primer completions <shell> |
Emit a shell completion script. Shells: bash, zsh, fish, powershell |
primer uninit [--purge] |
Remove shims and $PATH entry. --purge also deletes cache and model files |
| Ecosystem | Intercepted commands |
|---|---|
| Python | pip, uv, poetry |
| Node.js | npm, yarn, pnpm |
| Go | go get, go mod |
| Rust | cargo add, cargo build, cargo fetch, cargo check |