CLI Reference¶
Use this page when you need exact command syntax.
nomad¶
Serve SciFM-backed MCP tools, export self-contained deployment bundles, and run scripts through Nomad’s code-mode gateway.
Usage
nomad [OPTIONS] COMMAND [ARGS]...
Options
- --install-completion¶
Install completion for the current shell.
- --show-completion¶
Show completion for the current shell, to copy it or customize the installation.
Commands
- code-mode
Run the standalone code-mode gateway.
- code-mode-exec
Run a script within the code-mode sandbox. Alias: cmx
- export
Bundle models and rewrite a deployable config.
- serve
Serve Nomad tools over stdio or streamable HTTP.
nomad serve¶
Start a Nomad MCP server from a config file.
The config determines which MCP tools, model-backed tools, model cards, and optional search endpoints are registered. Use stdio for local clients and streamable-http when exposing Nomad over the network.
Usage
nomad serve [OPTIONS] CONFIG
Options
- --log-level <log_level>¶
Minimum log level written to stderr.
- Default:
'INFO'- Options:
DEBUG | INFO | WARNING | ERROR | CRITICAL
- -t, --transport <transport>¶
Server transport. Use stdio for local MCP clients or streamable-http for network clients.
- Default:
'stdio'- Options:
stdio | streamable-http
- --tool-manager, --no-tool-manager¶
Enable Nomad’s PyTorch tool manager for batching and shared accelerator scheduling.
- Default:
True
- --host <host>¶
Host interface for streamable-http. Ignored for stdio.
- Default:
'localhost'
- --port <port>¶
Port for streamable-http. Ignored for stdio.
- Default:
8000
- --log-file <log_file>¶
Optional JSONL file for structured append-only logs.
- --strict, --no-strict¶
Fail startup if any model fails to load or register.
- Default:
True
Arguments
- CONFIG¶
Required argument
Path to the Nomad server config file, usually nomad.yml.
Environment variables
- NOMAD_SERVE_CONFIG
Provide a default for
CONFIG
- NOMAD_SERVE_LOG_LEVEL
Provide a default for
--log-level
- NOMAD_SERVE_TRANSPORT
Provide a default for
--transport
- NOMAD_SERVE_HOST
Provide a default for
--host
- NOMAD_SERVE_PORT
Provide a default for
--port
- NOMAD_SERVE_LOG_FILE
Provide a default for
--log-file
- NOMAD_SERVE_STRICT
Provide a default for
--strict
nomad export¶
Create a deployment bundle from a Nomad config.
Nomad copies or downloads every configured model into <output>/models and writes a rewritten <output>/nomad.yml. Use –to https to keep remote models remote while rewriting git+ssh sources to git+https transport. Use –to oras –oras-registry REGISTRY/REPOSITORY to push models to ORAS and rewrite the config to pinned ORAS artifact URIs.
Usage
nomad export [OPTIONS] CONFIG OUTPUT
Options
- --log-level <log_level>¶
Minimum log level for export progress messages.
- Default:
'INFO'- Options:
DEBUG | INFO | WARNING | ERROR | CRITICAL
- --to <to>¶
Where exported model sources should point: disk copies all models into the bundle, while https keeps remote URI sources remote and rewrites git+ssh repos to git+https, and oras pushes models to an ORAS registry.
- Default:
<ExportTarget.DISK: 'disk'>- Options:
disk | https | oras
- --oras-registry <oras_registry>¶
Existing ORAS artifact repository for –to oras, such as registry.example.org/scifm.
- --pin, --no-pin¶
Pin exported sources to a resolved reference
- Default:
True
Arguments
- CONFIG¶
Required argument
Path to the Nomad server config file to export.
- OUTPUT¶
Required argument
Directory where Nomad should write bundled models and the rewritten nomad.yml.
nomad code-mode¶
Launch the Nomad MCP code-mode gateway.
Usage
nomad code-mode [OPTIONS]
Options
- -c, --config <config>¶
Required Path to the gateway configuration file (YAML, TOML, or JSON).
- --transport <transport>¶
Optional transport override passed to FastMCP.
- --host <host>¶
Optional host override when using network transports.
- --port <port>¶
Optional port override when using network transports.
- --log-level <log_level>¶
Logging level (default: INFO).
- Default:
'INFO'
- --log-file <log_file>¶
Optional append-only JSONL log file.
nomad code-mode-exec¶
Run a script within Nomad’s code-mode sandbox.
This is useful for validating a gateway config, testing tool access from a
script, or capturing a structured JSON result without starting a long-lived
gateway process. Arguments after -- are forwarded to the SCRIPT.
Usage
nomad code-mode-exec [OPTIONS] SCRIPT [-- SCRIPT_ARGS...]
Options
- -c, --config <config>¶
Required Path to the code-mode gateway config file.
- --directory <directory>¶
Workspace directory exposed to the sandbox.
- Default:
'current directory'
- -o, --output <output>¶
Optional destination for the JSON result payload. Omit to suppress output; use ‘-’ for stdout.
- --gateway-log-level <gateway_log_level>¶
Minimum log level emitted by the temporary gateway process.
- Default:
'WARNING'
Arguments
- SCRIPT¶
Required argument
Path to the Python script to execute inside the sandbox.