# Flag conventions

The CLI aims to be predictable: once you know the conventions you can guess the
flag. Short flags are consistent across every command.

## Global flags (work on any command)

| Short | Long | Meaning |
| --- | --- | --- |
| `-c` | `--config` | Config file (YAML) |
| `-v` | `--verbose` | More log detail (`-v`, `-vv`, `-vvv`) |
| `-q` | `--quiet` | Errors only |
| | `--legacy` | Directory of legacy Python modules |
| | `--server` | Talk to a running `spiderfootplus serve` instead of scanning locally |
| | `--token` | API token for `--server` |

## Shared conventions

| Short | Long | Meaning |
| --- | --- | --- |
| `-o` | `--output` | Output **format** (`tab`, `json`, `csv`, `md`) |
| `-m` | `--modules` | Modules to run |
| `-u` | `--use-case` | Use case (`passive`, `footprint`, `investigate`, `all`) |
| `-t` | `--type(s)` | Filter by event type |
| `-x` | `--exclude` | Hide event types from the live stream |
| `-f` | `--targets-file` / `--format` | A file of inputs, or an export format |
| `-y` | `--yes` | Skip a confirmation prompt |
| | `--out` | Write to a **file** (path) |

Two rules worth remembering:

* **`-o` is always a format, `--out` is always a file.** `scan … -o json` prints
  JSON; `scan … --out run.json` writes an export file.
* **Reading is lowercase, destructive needs `-y`.** `delete` asks before removing
  a scan unless you pass `-y`.

## Colour and piping

Colour and the aligned layout appear only on a real terminal. When output is
redirected, piped, or `-o json|csv` is set (or `NO_COLOR` is in the environment),
the same command prints plain, parseable text. Logs always go to stderr, data to
stdout, so `spiderfootplus scan … -o json > out.json` is always clean.
