CLI overview
i18nprune is a Node 18+ ESM CLI built with Commander. The entry point is packages/cli/bin/cli.ts, compiled to dist/cli.js.
Global behaviour
- Argv is passed through
preprocessArgv(packages/cli/src/argv/index.ts) before Commander parses it. preActionon the root command:- Resolves
setConfigPath,ensureConfigPathResolved(duplicate config files),setRunOptions,setCliGlobalOverrides, clears context cache. - Does not create a config file: use
i18nprune initwheni18nprune.project.config_file_missingapplies.
- Resolves
RunOptions(json,quiet,silent) is the process-wide verbosity contract; commands read it viagetRunOptions()orresolveContext().run. There is no separate JSON envelope flag: when JSON is emitted, it always uses the envelope shape documented under JSON output (--json).
Subcommands
Use the canonical command name (e.g. generate, validate, languages). There are no short Commander aliases (gen, val, …).
The languages command accepts the positional alias langs (i18nprune langs). It does not load project config.
Global flags (short)
| Flag | Long | Role |
|---|---|---|
-V | — | Run version subcommand |
-v | --verbose | Command-scoped verbose mode (currently share view) |
-q | --quiet | Less noise (see verbosity) |
-s | --silent | Stricter suppression |
| — | --no-color | Plain text (also when NO_COLOR is set) |
| — | --no-log-channel | Omit [info] / [warn] tags on human lines |
| — | --no-log-prefix | Omit [i18nprune] prefix on human lines |
-h | --help | Help (Commander default) |
-c | --config | Path to a single i18nprune config file |
Other global options use --long only (--json, --yes, --source, …) besides -c / --config and -V.
Global --json
Full behavior, envelope shape, supported commands, and edge cases: JSON output (--json).