Skip to content

CLI Reference

Commands, flags, and exit codes for the docker-doctor CLI.

On this page

Default scan command

npx @docker-doctor/cli@latest [dir]

[dir] is the directory to scan and defaults to ..

FlagAliasDescription
--verbose-vShow the affected file, line, an explanation, and a Help: fix hint for every diagnostic
--score-sPrint only the numeric health score
--json-jOutput the full report as JSON
--config <path>-cUse a custom config file path
--version-VPrint the CLI version

Piped / CI output

--score and --json both suppress the interactive spinner and prompts, so they're safe to pipe or run in CI:

npx @docker-doctor/cli@latest . --score
npx @docker-doctor/cli@latest . --json > report.json

Exit codes

ModeExit code
Default scanNon-zero if any error-severity diagnostic is present
--scoreNon-zero if the score is below 50
--jsonNon-zero if any error-severity diagnostic is present

Install for agents

Install the Docker Doctor agent skill for your coding agents (interactive multi-select in a TTY):

npx @docker-doctor/cli@latest install

Non-interactive runs must name the agents:

npx @docker-doctor/cli@latest install --agent claude-code cursor

See the Coding Agents guide for details.

Rules subcommands

List every built-in rule, its category, default severity, and description:

npx @docker-doctor/cli@latest rules list

Explain a single rule and its fix in detail (requires the full rule key):

npx @docker-doctor/cli@latest rules explain docker-doctor/no-root-user

Interactive mode

When run in a TTY without --score or --json, docker-doctor shows a spinner while scanning and, after printing results, offers to scaffold a .github/workflows/docker-doctor.yml CI workflow for you.

If the scan found issues, it then offers to hand them to a coding agent detected on your machine — launching the agent with the issues as its prompt — or to copy that prompt to your clipboard. See the Coding Agents guide.