NervesMCP.CLI (NervesMCP v0.1.0)

Copy Markdown View Source

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

Summary

Functions

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

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

Functions

parse(args, config)

@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()

@spec repl() :: :ok

run(args)

@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.