Operations Commands

This page documents the commands used to operate a running federation and to manage local CLI state: nvflare system, nvflare study, nvflare config, nvflare recipe, nvflare examples, nvflare resources, and nvflare agent. Server-connected commands resolve the admin startup kit as described in CLI Overview and accept --kit-id, --startup-kit, --format json, and --schema.

nvflare system

Subcommand Arguments Description
status [server|client] [client_names...] Connectivity of the server and clients.
resources [server|client] [client_names...] Resource usage.
shutdown {server,client,all} [client_names...] [--force] [--no-wait] [--timeout S] Stop processes.
restart same as shutdown Restart processes.
disable-client client_name [--force] Block a client from rejoining.
enable-client client_name [--force] Allow it again.
version [--site server|<name>|all] NVFLARE versions on remote sites and mismatches.
log-config level [--site ...] Change runtime logging.
nvflare system status
nvflare system status client site-1 site-2
nvflare system shutdown client site-1 --force
nvflare system restart all --force --timeout 120
nvflare system version --site server
nvflare system log-config --site site-1 DEBUG

Shutdown and restart

--force skips confirmation and is required in non-interactive contexts. By default, shutdown waits for the target to stop and restart waits for it to be reachable again (for restart all, until previously connected clients reconnect). --timeout defaults to 30 seconds and must be positive; use --no-wait for fire-and-forget rather than --timeout 0. A timeout returns TIMEOUT with exit code 3. Targeting server or all closes the admin session after the request.

Client access control

disable-client removes the client from the registry and rejects its registrations and heartbeats until re-enabled. It does not revoke the certificate or delete the kit. The policy is stored on the server in <server_workspace>/disabled_clients.json, written atomically and loaded at startup; if the file exists but cannot be read, the server refuses to start rather than admitting disabled clients. JSON output includes already_disabled.

Logging levels

log-config (and nvflare job log-config) accept DEBUG, INFO, WARNING, ERROR, CRITICAL, or the modes concise, progress, msg_only, full, verbose, and reload. The level argument is optional for argparse but required at runtime: omitting it returns an error.

nvflare study

Manages studies on a server provisioned with api_version: 4 and multi-study support.

Subcommand Usage
register register <name> --site-org org:site ... (project_admin) or --sites s1 s2 (org_admin)
show show <name>: sites and admins.
list Studies visible to the caller.
remove remove <name>; rejected while a job runs in the study.
add-site / remove-site Same site arguments as register.
add-user / remove-user add-user <study> <user>
nvflare study register cancer-research --site-org org_a:hospital-1 --site-org org_b:clinic-1
nvflare study register cancer-research --sites hospital-1 hospital-2     # as org_admin
nvflare study add-user cancer-research trainer@org_a.com
nvflare study list --format json

Role rules: a project_admin must use --site-org (--sites is rejected); an org_admin must use --sites for sites of their own organization (--site-org is rejected); using both is always rejected. --sites also accepts comma-separated values. list shows all studies to project admins, studies with own-org sites to org admins, and explicitly mapped studies to leads and members. In JSON mode it also reports can_submit_job per study, evaluated against the server's authorization policy (a preflight only).

Error code Exit Meaning
STUDY_NOT_FOUND 1 Unknown or invisible study.
STUDY_ALREADY_EXISTS 1 Name already registered.
STUDY_HAS_JOBS 1 Cannot remove a study with associated jobs.
USER_ALREADY_IN_STUDY / USER_NOT_IN_STUDY 1 Membership errors.
NOT_AUTHORIZED 1 Role insufficient.
INVALID_SITE, INVALID_STUDY_NAME, INVALID_ARGS 4 Bad input.
LOCK_TIMEOUT 3 Another registry change is in progress.
CONNECTION_FAILED 2 Cannot connect or authenticate.

nvflare config

Manages ~/.nvflare/config.json.

Subcommand Usage Description
add add <kit_id> <startup_kit_dir> [--force] Register an admin/user kit. --force replaces an existing ID.
use use <kit_id> Make it the active kit (global state).
inspect inspect Show the active kit.
list list All registered kits.
remove remove <kit_id> Remove a local registration (does not delete files).
nvflare config add project_admin /tmp/nvflare/poc/example_project/prod_00/[email protected]
nvflare config use project_admin
nvflare config list --format json

nvflare config with no subcommand prints the config file path, the POC workspace, and the active kit. inspect and list in JSON mode include best-effort identity, certificate expiration, and stale-path findings. Automation should prefer --kit-id/--startup-kit over config use, which changes global state.

Deprecated forms: nvflare config -d <dir> registers and activates a kit (use add + use), and nvflare config -pw <dir> sets the POC workspace (use nvflare poc config --pw). Both print warnings. Spellings such as --poc.workspace are not supported.

nvflare recipe

Local discovery of built-in recipes; it does not connect to a server.

nvflare recipe list
nvflare recipe list --framework pytorch
nvflare recipe list --filter framework=pytorch --filter algorithm=fedavg
nvflare recipe show fedavg-pt --format json

list is also the default subcommand. --framework is shorthand for --filter framework=<value> with values core, numpy, pytorch, tensorflow, sklearn, xgboost. --filter keys are framework, privacy, algorithm, aggregation, and state_exchange; different keys combine with AND, repeated keys with OR, and hyphens and underscores are interchangeable in values. Valid filters that match nothing return an empty list.

Algorithm values include cyclic, fedavg, fedavg_logistic_regression, fedce, fedeval, fedopt, fedprox, fedstats, kmeans, scaffold, svm, swarm, xgboost_bagging, xgboost_horizontal, and xgboost_vertical. The only privacy value today is homomorphic_encryption; the absence of a privacy value does not mean a recipe is incompatible with privacy techniques.

The list includes recipes whose optional dependencies are not installed (their optional_dependencies field says what to install). show adds client requirements, constructor parameters (derived from signatures or static parsing, without instantiating), and framework support.

nvflare examples

Downloads examples from the NVIDIA/NVFlare GitHub repository at the source revision recorded in your installed package; for example, a 2.10.0 release package fetches examples from the commit recorded in that package.

nvflare examples list
nvflare examples get hello-pt
nvflare examples get hello-numpy --dest ./numpy-demo
nvflare examples revision --dir ./hello-pt
Subcommand Options Description
list — Catalog grouped by category (hello-world, agent-skills, advanced, deployment). Offline.
get NAME --dest DIR (default ./NAME) Download one example (and the catalog examples it requires).
revision --dir DIR (default .) Print the revision recorded in a downloaded example's .nvflare-example.json.

Rules: the destination's parent must exist; a standalone example is created exclusively and never merged into or overwrites an existing path; for examples with dependencies the destination is a download root and existing components are reused only when their provenance matches exactly. get makes one GitHub REST API request per missing component, then fetches files from raw.githubusercontent.com. Requests are anonymous unless GITHUB_TOKEN or GH_TOKEN is set (GITHUB_TOKEN wins). Anonymous GitHub API traffic is limited to 60 requests per hour per IP, so in CI download once and reuse. Error codes include EXAMPLE_DESTINATION_EXISTS, EXAMPLE_DESTINATION_INVALID, and EXAMPLE_IO_ERROR.

The command never rewrites requirement files; skip any line that installs nvflare or nvflare-nightly.

nvflare resources

nvflare resources --job <job_id>
nvflare resources --study cancer-research
nvflare resources --job <job_id> --site site-1

Shows recorded resources for a job (in the default study unless --study is set) or summarizes a study's accessible jobs; --site shows one participant's measurements and startup capacity.

nvflare agent

Agent-facing helpers for coding assistants and automation:

  • nvflare agent info: command-surface metadata.
  • nvflare agent inspect ...: static inspection of local Python source, job artifacts, or data directories. Inspection redacts secret-like literals and sensitive absolute paths by default and limits its directory walk (default 250 entries).

See Also