# `NervesMCP.CLI`
[🔗](https://github.com/nerves-project/nerves_mcp/blob/v0.1.0/lib/nerves_mcp/cli.ex#L5)

CLI argument parsing and connection setup for NervesMCP.

CLI args override values from config/config.exs. If no args are provided
but config exists, the config values are used as-is.

Supports two connection modes:

**Serial (UART):**
    nerves_mcp /dev/ttyUSB0
    nerves_mcp --serial /dev/ttyUSB0 --speed 115200

**SSH:**
    nerves_mcp nerves.local
    nerves_mcp --ssh nerves.local --user root --ssh-port 22

Common options:
    --port PORT    MCP server port (default: 13000)
    --ip ADDRESS   Address to listen on (default: loopback), or "any"
    --log-file FILE  Append everything the device prints to FILE

# `parse`

```elixir
@spec parse([String.t()], keyword()) :: {:ok, keyword()} | {:error, String.t()}
```

Works out the server settings from command line arguments and the settings
already configured, which the arguments override.

# `repl`

```elixir
@spec repl() :: :ok
```

# `run`

```elixir
@spec run([String.t()]) :: :ok
```

Starts the default server from command line arguments, halting with a
message when they do not describe a usable connection.

---

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