composer-cli — User Guide
composer-cli is a command-line tool for controlling a running Vindral Composer Runtime
over its HTTP Runtime API. It runs on Windows and Linux, issues one command per invocation
(so it scripts cleanly), and authenticates with the Runtime's existing API-key mechanism.
The Runtime API is only served by the headless Composer Runtime, not Composer Desktop, and requires the Runtime to be started with
--runtime-api-port(e.g.9101).
Installation
Copy the published composer-cli binary somewhere on your PATH:
- Windows:
composer-cli.exe - Linux:
composer-cli(chmod +x composer-cli)
Quick start
# Talk to a Runtime on this machine (default http://localhost:9101)
composer-cli status
# Talk to a specific instance
composer-cli status --url http://encoder1.example.com:9101
# Load a project, start it, check it, stop it
composer-cli load MorningShow.prj
composer-cli status
composer-cli stop
Choosing which Runtime to talk to
Resolution order (highest priority first):
--url http://host:port--host <host> --port <port>--context <name>(a saved alias — see below)- the default context
http://localhost:9101
Named contexts (instance aliases)
If you manage several Runtimes, save them as named contexts (the kubectl / aws --profile
model) so you don't retype URLs and keys:
composer-cli context-add dc1-enc2 --url https://enc2.dc1.example.com:9101 --apikey <KEY>
composer-cli context-add dc2-enc1 --url https://enc1.dc2.example.com:9101 --apikey <KEY>
composer-cli context-list # show all; the default is marked with *
composer-cli context-use dc1-enc2 # set the default
composer-cli status # uses the default context
composer-cli status --context dc2-enc1 # one-off override
Contexts are stored in:
- Windows:
%APPDATA%\composer-cli\config.json - Linux:
~/.config/composer-cli/config.json(createdchmod 600)
Authentication
The Runtime validates an apikey against its apikeys.json. If that file is empty, the API
is open and no key is needed. Otherwise provide a key (sent as the apikey HTTP header, never
in the URL):
Key resolution order:
--apikey <KEY>COMPOSER_API_KEYenvironment variable- the selected context's stored key
If you target a non-loopback host without a key, the tool prints a warning to stderr before proceeding.
Commands
Status & inventory
| Command | Description |
|---|---|
status |
Runtime state, loaded project, statistics |
capabilities (caps) |
GPU, NVENC/NVDEC, FFmpeg, etc. |
projects [--header-peek] |
List project files in the ProjectsDirectory |
errors [--count N] |
Recent error log entries |
warnings [--seconds N] |
Recent warning log entries |
Health probes
Check the Runtime's container/orchestrator health probes. These are served by a separate,
unauthenticated listener on the Runtime's health port — so pass --health-port (or set
COMPOSER_HEALTH_PORT); it must match the port the Runtime was started with (--health-port).
The host comes from normal target resolution (--url / --host / --context); only the port is
swapped to the health port.
| Command | Description |
|---|---|
health [--probe ready\|live\|startup] [--health-port N] |
Query one probe. Exit 0 if it passes (HTTP 200), 1 if not ready/alive (HTTP 503). Default probe: ready. |
composer-cli health --host enc1 --health-port 8088 # readiness (default)
composer-cli health --host enc1 --probe startup --health-port 8088
COMPOSER_HEALTH_PORT=8088 composer-cli health --host enc1 --probe live
Probes: startup (boot complete) → /startup, live (main loop ticking) → /health,
ready (startup done and Idle/Running) → /ready. Use it in scripts the same way as status:
if composer-cli health --host enc1 --health-port 8088 >/dev/null; then echo "ready"; fi
Lifecycle
| Command | Description |
|---|---|
load <file> [--decrypt-key K] |
Load a project and start it |
start [--decrypt-key K] |
Start the last-loaded project (from Idle) |
stop |
Stop the running project (to Idle) |
reload [--decrypt-key K] |
Stop, reload from disk, restart |
exit |
Gracefully shut down the Runtime process |
Project files
| Command | Description |
|---|---|
validate <file> |
Parse a project without loading it |
assets <file> |
Check that a project's referenced assets resolve |
project-upload <localPath> [--name N] |
Upload a .prj/.prjp to the server |
project-download [--out PATH] |
Download the currently-loaded project |
Contexts (local config only — no network)
| Command | Description |
|---|---|
context-add <name> --url U [--apikey K] [--default] |
Save an alias |
context-remove <name> |
Delete an alias |
context-list |
List aliases (default marked *) |
context-use <name> |
Set the default alias |
Global options
| Option | Description |
|---|---|
--context <name> |
Target a saved context |
--url <url> |
Full base URL |
--host <host> / --port <n> |
Host/port (ignored if --url is set) |
--apikey <key> |
API key |
--json |
Emit the raw JSON response instead of a summary |
-v, --verbose |
Write request/response detail to stderr |
--timeout <seconds> |
HTTP timeout (default 35; server actions cap at 30s) |
--logpath <dir> |
Override the CLI log directory |
Output, scripting & exit codes
- Command results go to stdout; warnings/errors go to stderr — so you can pipe stdout
safely. Use
--jsonto get machine-readable output. - Exit codes:
| Code | Meaning |
|---|---|
0 |
Success (HTTP 2xx) |
1 |
The Runtime returned an error (HTTP 4xx/5xx), or the command line could not be parsed (unknown verb / bad flag — usage is printed to stderr) |
2 |
An argument to a recognized verb was invalid (e.g. an unknown --probe value, context-add without --url, or an unknown context) |
3 |
Could not connect |
4 |
Request timed out |
5 |
Unexpected error |
Note: a mistyped or unknown verb exits
1(the parser rejects it before any verb runs), while a recognized verb given a bad argument exits2.
Example:
if composer-cli status --context dc1-enc2 >/dev/null; then
echo "encoder is up"
fi
Logging
The CLI keeps its own dated log (separate from the Runtime's logs) recording each invocation — target, HTTP status, outcome, and duration. API keys are redacted. Default location:
- Windows:
%LOCALAPPDATA%\composer-cli\logs\ - Linux:
~/.local/share/composer-cli/logs/
Override with --logpath. Add -v for live request/response detail on the console.
Troubleshooting
| Symptom | Likely cause |
|---|---|
Exit 3, "Connection failed" |
Wrong host/port, Runtime not started with --runtime-api-port, or firewall |
HTTP 401: Invalid API key |
Missing/wrong key — set --apikey / COMPOSER_API_KEY / context key |
HTTP 409 on start/stop/reload |
Runtime is in the wrong state for that action (check status) |
| Works locally, not remotely | The Runtime binds RuntimeApiHostName (default +); confirm the host is reachable and TLS/proxy is correct |