# `VulnCheck.CLI`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck/cli.ex#L1)

Command line interface shared by the `vulncheck` escript and the Mix tasks.

    vulncheck [scan] [flags]          audit the project (default command)
    vulncheck init [--force]          write a commented .vulncheck.exs
    vulncheck explain <ID> [flags]    describe an advisory and its local status
    vulncheck feeds sync|status       refresh or inspect the advisory cache
    vulncheck feeds bundle -o FILE    export the cache for offline runners
    vulncheck feeds import FILE       select a bundle for later offline runs
    vulncheck feeds prune             remove unused snapshots and module caches

Exit codes: `0` clean, `1` policy violation (actionable findings, retired
releases, expired or forbidden suppressions), `2` execution error.

# `exit_code`

```elixir
@type exit_code() :: 0 | 1 | 2
```

# `describe_error`

```elixir
@spec describe_error(term()) :: String.t()
```

Human-readable description of a scan or command error.

# `init_template`

```elixir
@spec init_template(Path.t()) :: String.t()
```

Contents of a generated `.vulncheck.exs` for the project in `dir`.

# `main`

```elixir
@spec main([String.t()]) :: no_return()
```

Escript entry point.

# `render`

```elixir
@spec render(
  VulnCheck.Types.ScanReport.t(),
  VulnCheck.Config.t(),
  VulnCheck.Config.format()
) ::
  String.t()
```

Renders a report in the given format.

# `run`

```elixir
@spec run([String.t()], keyword()) :: exit_code()
```

Runs a command and returns its exit code without halting the VM.

Options:

  * `:stdout` / `:stderr` — IO devices (default `:stdio` / `:stderr`)
  * `:cwd` — working directory used to resolve relative paths
  * `:scan_opts` — options forwarded to `VulnCheck.Scanner.run/2`
    (feed URLs, HTTP client, `:today`)

# `usage`

```elixir
@spec usage() :: String.t()
```

Usage text.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
