Global Flags
Global Flags
Section titled “Global Flags”These flags are available on all commands:
| Flag | Short | Description |
|---|---|---|
--conf | Custom config file path | |
--format | -f | Output format: table, simple, detailed, json |
--org | -o | Organization name (overrides config default) |
--help | -h | Help for the command |
Output Formats
Section titled “Output Formats”NDCLI supports four output formats that can be set globally or per-command:
Table (default for lists)
Section titled “Table (default for lists)”ndcli device list -f tableHuman-readable tabular format, ideal for terminal viewing.
Simple
Section titled “Simple”ndcli device list -f simpleCompact bullet-point format for quick scanning.
Detailed
Section titled “Detailed”ndcli device describe my-device -f detailedUnicode box drawing with the full set of fields for the resource. This is the default format.
ndcli device list -f jsonMachine-readable JSON output for scripting and automation.
Setting Default Format
Section titled “Setting Default Format”You can set your preferred default format in the configuration:
ndcli config set output detailedOr override per-command using the -f flag.
Errors
Section titled “Errors”A failed command exits non-zero and prints its error on standard error, so standard output stays free of it. When the server gave the failure a code, the code leads the message in square brackets:
Error: [SNIPPET_UUID_IN_USE] 'uuid' is already used by snippet 'web-servers' in this organization; omit it and NetDefense generates oneWith -f json (or json as your default format), the error is a JSON document on standard error instead. code is left out when the server sent none:
{ "error": { "code": "SNIPPET_UUID_IN_USE", "message": "'uuid' is already used by snippet 'web-servers' in this organization; omit it and NetDefense generates one" }}The per-device lines of sync apply and device approve-all carry the same [CODE] prefix. The MCP server reports the same code and message as error.code and error.message.