Skip to content

Global flags

These flags apply to all subcommands. They control output shape, logging, cache behavior, and destructive confirmation — not where nodehunter walks the tree (discovery flags do that).

Quick reference

FlagDescription
-j, --jsonMachine-readable JSON on stdout (one object per run)
-jp, --json-pretty [bool]Pretty-print JSON when --json is set (default true)
-q, --quietLess non-essential output (banner still shows)
-s, --silentSuppress log lines on stderr
-ncl, --no-colorPlain text (also when NO_COLOR is set)
-nch, --no-cacheSkip enrichment cache read/write
-f, --forceRecompute enrichment and refresh on-disk cache
-nlc, --no-log-channelOmit [info] / [warn] tags on log lines
-nlp, --no-log-prefixOmit [nodehunter] prefix on log lines
-y, --yesConfirm destructive operations (skips interactive prompt)
-d, --debugWalk skip reasons, perf timings, cache dispatch (human mode)

Output modes

Human (default) — Banners, progress, and guidance on stderr; primary results formatted for the terminal.

JSON — Exactly one JSON object on stdout. Human-oriented channels are suppressed with -j / --json or -s / --silent. Use exit codes and ok / summary.notes instead of parsing stderr.

bash
nodehunter size ~/work --json
nodehunter size ~/work --json --json-pretty false   # compact

Schema and field reference: JSON output.

Quiet and silent

FlagEffect
--quietReduces chatter; command banner may still appear
--silentNo log lines on stderr — pair with --json in automation

Color and log formatting

  • --no-color / NO_COLOR — disables ANSI styling.
  • --no-log-channel — drops level tags like [info].
  • --no-log-prefix — drops the [nodehunter] prefix.

Useful when piping logs into tools that do not expect ANSI or prefixes.

Enrichment cache

Workspace commands (list, find, why, inspect) can reuse cached package metadata between runs.

FlagEffect
--no-cacheBypass cache read and write
--forceRecompute and refresh cached entries

With --debug, cache bypass is visible on the [cache] channel.

Confirmation (--yes)

-y / --yes skips the interactive confirm prompt on delete. Default is to refuse in non-interactive environments without this flag.

Use --yes only in automation that has already reviewed a sized preview (for example from a prior --json run on the same path).

Debug (--debug)

Human mode only. Emits structured diagnostics to stderr:

  • [walk] — directories skipped during traversal and why
  • [perf] — phase timings (walk, sizeSpan, wall)
  • [cache] — cache hits, misses, bypass

Example perf line on sized runs:

txt
[perf] walk=143ms sizeSpan=609ms wall=634ms matched=8 …

When discovery and sizing run concurrently, wall may be less than walk + sizeSpan — that is expected for pipelined work.