CLI Overview
nvflare is the single command-line entry point for NVIDIA FLARE. It covers local POC deployments, provisioning, job submission and monitoring, system operations, multi-study management, startup-kit registration, example downloads, and deployment preparation. This page explains the global options, output formats, exit codes, how commands choose a startup kit, and lists every command group.
Command Groups
| Command | Purpose | Page |
|---|---|---|
nvflare poc |
Prepare, start, stop, and clean a local proof-of-concept deployment. | poc |
nvflare job |
Submit, wait for, monitor, list, inspect, download, abort, and delete jobs. | job |
nvflare provision |
Centralized provisioning from a project.yml. |
Provisioning |
nvflare cert, nvflare package |
Distributed provisioning (requests, approvals, kit assembly). | Provisioning |
nvflare system |
Status, resources, shutdown, restart, client access, versions, logging. | Operations |
nvflare study |
Multi-study registry management. | Operations |
nvflare config |
Local CLI settings and startup-kit registry. | Operations |
nvflare recipe |
List and inspect built-in recipes. | Operations |
nvflare examples |
Download version-matched examples from GitHub. | Operations |
nvflare resources |
Show recorded resources for a job or study. | Operations |
nvflare agent |
Agent-facing helpers (command metadata, static inspection). | Operations |
nvflare deploy |
Prepare startup kits for Docker, Kubernetes, or Slurm. | Deployment |
nvflare preflight-check |
Validate a startup kit before deployment (aliases preflight, preflight_check). |
Deployment |
nvflare dashboard |
Start or stop the Dashboard web service. | Deployment |
nvflare simulator |
Deprecated: run a job folder in the simulator. | Deployment |
nvflare authz-preview |
Deprecated: preview an authorization policy (alias authz_preview). |
Deployment |
A second console script, nvflare-cvmctl, belongs to the confidential-computing image builder.
Global Options
| Option | Default | Description |
|---|---|---|
--version, -V |
— | Print NVFlare version is <version> and exit. |
--format {txt,json,jsonl} |
txt |
txt is human-readable. json prints exactly one JSON envelope on stdout. jsonl streams JSON lines and is accepted only by nvflare job monitor. |
--connect-timeout SECONDS |
5.0 |
Seconds to wait for a server connection in remote commands. Must be a finite positive number. |
Global options may appear before or after the subcommand: nvflare --format json job list and nvflare job list --format json are equivalent. The CLI moves them ahead of the subcommand before parsing. The exception is --version/-V: after a subcommand it is left in place for that subcommand.
Using --format jsonl with any other command fails with:
--format jsonl is only supported by streaming commands: nvflare job monitor
JSON Envelopes
In JSON mode stdout contains only the envelope; progress and diagnostics go to stderr. A success looks like:
{"schema_version": "1", "status": "ok", "exit_code": 0, "data": {"job_id": "abc123"}}
An error includes a code, message, and hint:
{
"schema_version": "1",
"status": "error",
"exit_code": 4,
"error_code": "INVALID_ARGS",
"message": "...",
"hint": "Run with --help to see usage.",
"data": {"usage": "usage: nvflare job ...", "choices": []}
}
In human mode, an argument error prints the full command help first, then the message and hint, so you always see the complete syntax.
--schema
Almost every command accepts --schema, which prints a machine-readable description of the command's arguments and behavior (for example mutating, idempotent, retry_token) as JSON and exits, regardless of --format. When --schema is present the CLI bypasses normal argument validation, so nvflare job submit --schema works without a job folder. Deprecated commands report themselves as deprecated in their schema.
Exit Codes
| Code | error_code examples |
Meaning |
|---|---|---|
0 |
— | Success. |
1 |
CLI_ERROR, job terminal failure |
The command ran but failed, or (for job wait/job monitor) the job ended in FAILED, FINISHED_EXCEPTION, ABORTED, or ABANDONED. |
2 |
CONNECTION_FAILED, AUTH_FAILED |
Connection, authentication, or authorization failure. |
3 |
TIMEOUT |
A wait or operation timed out. |
4 |
INVALID_ARGS, STARTUP_KIT_MISSING |
Invalid arguments, unknown command, or no usable startup kit. |
5 |
INTERNAL_ERROR |
Unexpected exception. Add -debug (on commands that support it) to print the traceback. |
Authentication failures carry a hint tailored to the cause, for example Add this user to the study's admins list with 'nvflare study add-user', then try again. or Check that the startup kit certificate, key, and root CA match the server trust chain.
Startup Kit Resolution
Server-connected commands (job, system, study, resources) need an admin startup kit. They resolve it in this order:
--kit-id <id>: a kit registered withnvflare config add, for this command only.--startup-kit <path>: an explicit admin kit directory, for this command only.- The
NVFLARE_STARTUP_KIT_DIRenvironment variable. startup_kits.activein~/.nvflare/config.json(set bynvflare config useornvflare poc prepare).- Otherwise the command fails before connecting (
STARTUP_KIT_MISSINGorSTARTUP_KIT_NOT_CONFIGURED, exit 4).
The per-command selectors never change the active kit, which makes them the right choice for scripts and parallel workflows. A kit path must point to the admin kit directory itself (for example .../prod_00/[email protected]), not to prod_00.
Local Configuration File
CLI settings live in ~/.nvflare/config.json, normalized to format version 2. It stores the POC workspace (poc.workspace) and the startup-kit registry (startup_kits.entries and startup_kits.active). Manage it with nvflare config and nvflare poc config rather than by hand.
Environment Variables
| Variable | Used by | Effect |
|---|---|---|
NVFLARE_STARTUP_KIT_DIR |
server-connected commands | Startup kit, below --kit-id/--startup-kit. |
NVFLARE_POC_WORKSPACE |
poc, PocEnv |
POC workspace, above the config file. |
NVFLARE_SIMULATOR_WORKSPACE_ROOT |
SimEnv |
Overrides workspace_root. |
FL_LOG_LEVEL |
recipes, simulator | Log configuration fallback. |
GITHUB_TOKEN, GH_TOKEN |
examples get |
Authenticated GitHub API requests; GITHUB_TOKEN wins. |
KUBECTL |
deploy k8s stage/unstage |
Alternative kubectl binary such as oc. |