Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DevDonzo/warden/llms.txt

Use this file to discover all available pages before exploring further.

The doctor command performs a systematic diagnostic of your local environment and reports the health of every component that Warden depends on. Unlike warden validate, which focuses on whether a scan can start, doctor is oriented toward troubleshooting — it checks exact version requirements, tool availability, and token presence, then gives you a clear pass/fail count so you know exactly what needs attention.
Run warden doctor whenever a scan fails unexpectedly, after upgrading Node.js, or when setting up Warden on a new machine. The output pinpoints the root cause faster than reading raw error logs.

Synopsis

warden doctor

Flags

doctor takes no flags.

What it checks

Node.js

Warden reads process.version and extracts the major version number. Node.js v18 or later is required.
ResultOutput
v18+ detected✓ Node v20.14.0 ✓ (example)
Below v18✗ Node v16.20.0 (requires v18+) — counted as an issue
Detection failed✗ Could not detect Node version — counted as an issue

Git

Warden runs git --version and captures the output.
ResultOutput
Git found✓ git version 2.45.1 ✓ (example)
Not found✗ Git not found — counted as an issue

npm

Warden runs npm --version and captures the output.
ResultOutput
npm found✓ npm v10.8.1 ✓ (example)
Not found✗ npm not found — counted as an issue

Snyk CLI

Warden runs snyk --version to check for the optional Snyk CLI. A missing Snyk CLI does not count as a blocking issue — Warden will fall back to npm audit automatically. It is reported as a warning only.
ResultOutput
Snyk found✓ Snyk CLI installed ✓
Not found⚠ Snyk CLI not found (optional, will use npm audit)

Tokens

Warden checks for two environment variables. Missing tokens are reported as warnings (not blocking issues) but will cause failures at the point where they are actually needed.
VariableSetNot set
GITHUB_TOKEN✓ GITHUB_TOKEN set ✓⚠ GITHUB_TOKEN not set (required for PR creation)
SNYK_TOKEN✓ SNYK_TOKEN set ✓⚠ SNYK_TOKEN not set (required for Snyk scanner)

Project

Warden checks that a package.json file exists in the current working directory.
ResultOutput
Found✓ package.json found ✓
Missing✗ No package.json found — counted as an issue

Summary

After all checks complete, Warden prints a summary line:
  • All clear✓ All checks passed! Warden is ready to use.
  • Issues found✗ Found N issue(s) that need attention.
Only hard failures — Node.js version below v18, missing Git, missing npm, missing package.json — increment the issue counter. Token warnings and the optional Snyk CLI check do not contribute to the issue count.

Example output

Fully healthy environment

🩺 Warden Doctor

─── Node.js ────────────────────────────────────────────────
  ✓ Node v20.14.0 ✓

─── Git ────────────────────────────────────────────────────
  ✓ git version 2.45.1 ✓

─── npm ────────────────────────────────────────────────────
  ✓ npm v10.8.1 ✓

─── Snyk CLI ───────────────────────────────────────────────
  ✓ Snyk CLI installed ✓

─── Tokens ─────────────────────────────────────────────────
  ✓ GITHUB_TOKEN set ✓
  ✓ SNYK_TOKEN set ✓

─── Project ────────────────────────────────────────────────
  ✓ package.json found ✓

─── Summary ────────────────────────────────────────────────
  ✓ All checks passed! Warden is ready to use.

Environment with issues

🩺 Warden Doctor

─── Node.js ────────────────────────────────────────────────
  ✗ Node v16.20.0 (requires v18+)

─── Git ────────────────────────────────────────────────────
  ✓ git version 2.45.1 ✓

─── npm ────────────────────────────────────────────────────
  ✓ npm v10.8.1 ✓

─── Snyk CLI ───────────────────────────────────────────────
  ⚠ Snyk CLI not found (optional, will use npm audit)

─── Tokens ─────────────────────────────────────────────────
  ⚠ GITHUB_TOKEN not set (required for PR creation)
  ⚠ SNYK_TOKEN not set (required for Snyk scanner)

─── Project ────────────────────────────────────────────────
  ✗ No package.json found

─── Summary ────────────────────────────────────────────────
  ✗ Found 2 issue(s) that need attention.
In this example, Node.js version and a missing package.json are the two counted issues. The token warnings and missing Snyk CLI are noted but do not increment the counter.

Resolving common issues

IssueFix
Node version below v18Install Node.js v18 or later from nodejs.org or via a version manager such as nvm or fnm.
Git not foundInstall Git from git-scm.com and ensure it is on your PATH.
npm not foundnpm ships with Node.js. Reinstalling Node.js via the official installer typically resolves this.
No package.json foundRun doctor from your project root, or run npm init to create a package.json.
GITHUB_TOKEN not setExport the token in your shell: export GITHUB_TOKEN=ghp_... or add it to your .env file.
SNYK_TOKEN not setExport the token: export SNYK_TOKEN=... or use --scanner npm-audit to avoid Snyk entirely.
Snyk CLI not foundInstall it with npm install -g snyk and authenticate with snyk auth.

Build docs developers (and LLMs) love