Skip to content

Configuration Reference

NDCLI uses a YAML configuration file and supports environment variable overrides. This reference covers all configuration options.

Configuration File Location

~/Library/Application Support/ndcli/config.yaml

Use --conf to specify a custom config file path:

Terminal window
ndcli --conf /path/to/config.yaml device list

Configuration File Structure

oauth2:
provider: auth0
domain: auth.netdefense.io
client_id: your-client-id
audience: authcli
scopes: openid profile email offline_access
controlplane:
host: https://control.netdefense.io
ssl_verify: true
organization:
name: my-organization
output:
format: detailed
auth:
storage: keyring
account: user@example.com
path: ""

Configuration Options

OAuth2 Settings

Settings for OAuth2 authentication provider.

KeyTypeDefaultDescription
oauth2.providerstringauth0OAuth2 provider type
oauth2.domainstringauth-dev.netdefense.ioOAuth2 domain
oauth2.client_idstring(built-in)OAuth2 client ID
oauth2.audiencestringauthcliOAuth2 audience
oauth2.scopesstringopenid profile email offline_accessOAuth2 scopes

Control Plane Settings

Settings for the NetDefense API connection.

KeyTypeDefaultDescription
controlplane.hoststringhttps://dev-control.netdefense.ioAPI host URL
controlplane.ssl_verifybooltrueVerify SSL certificates

Custom API Host

To use a different API host (e.g., self-hosted or staging):

controlplane:
host: https://control.example.com
ssl_verify: true

Organization Settings

Default organization for commands.

KeyTypeDefaultDescription
organization.namestring""Default organization name

Set via command:

Terminal window
ndcli config set org my-organization

Override per-command:

Terminal window
ndcli device list --org other-organization

Output Settings

Output formatting preferences.

KeyTypeDefaultDescription
output.formatstringdetailedDefault output format

Valid formats:

FormatDescription
tableTabular format, good for lists
simpleCompact bullet-point format
detailedRich Unicode box drawing
jsonMachine-readable JSON

Set via command:

Terminal window
ndcli config set output json

Override per-command:

Terminal window
ndcli device list -f table

Authentication Storage

Settings for credential storage.

KeyTypeDefaultDescription
auth.storagestringkeyringStorage backend: keyring or file
auth.accountstring""Account email for keyring lookup
auth.pathstring""Custom path for file storage

Keyring Storage (Default)

Credentials are stored in the system keyring:

  • macOS: Keychain
  • Linux: Secret Service (GNOME Keyring, KWallet)
  • Windows: Credential Manager
auth:
storage: keyring
account: user@example.com

File Storage

If keyring is unavailable, credentials are stored in a file:

auth:
storage: file
path: /custom/path/auth.json

Default file locations:

  • macOS: ~/Library/Application Support/ndcli/auth.json
  • Linux: ~/.config/ndcli/auth.json
  • Windows: %APPDATA%\ndcli\auth.json

Environment Variables

All configuration options can be set via environment variables with the NDCLI_ prefix:

Environment VariableConfig Key
NDCLI_OAUTH2_PROVIDERoauth2.provider
NDCLI_OAUTH2_DOMAINoauth2.domain
NDCLI_OAUTH2_CLIENT_IDoauth2.client_id
NDCLI_OAUTH2_AUDIENCEoauth2.audience
NDCLI_OAUTH2_SCOPESoauth2.scopes
NDCLI_CONTROLPLANE_HOSTcontrolplane.host
NDCLI_CONTROLPLANE_SSL_VERIFYcontrolplane.ssl_verify
NDCLI_ORGANIZATION_NAMEorganization.name
NDCLI_OUTPUT_FORMAToutput.format

Examples

Terminal window
export NDCLI_ORGANIZATION_NAME=production
export NDCLI_OUTPUT_FORMAT=json
export NDCLI_CONTROLPLANE_HOST=https://api.example.com

Precedence

Configuration values are resolved in this order (highest to lowest priority):

  1. Command-line flags (--org, -f)
  2. Environment variables (NDCLI_*)
  3. Config file (config.yaml)
  4. Built-in defaults

Example Configurations

Development Setup

controlplane:
host: https://dev-control.netdefense.io
ssl_verify: true
organization:
name: dev-environment
output:
format: detailed
auth:
storage: keyring

CI/CD Pipeline

controlplane:
host: https://control.netdefense.io
ssl_verify: true
organization:
name: production
output:
format: json
auth:
storage: file
path: /secrets/ndcli-auth.json

Multi-Organization User

controlplane:
host: https://control.netdefense.io
organization:
name: ""
output:
format: table

Managing Configuration

View Current Configuration

Terminal window
ndcli config show

Reset to Defaults

Terminal window
ndcli config reset

Manually Edit

Open the config file directly:

Terminal window
$EDITOR ~/.config/ndcli/config.yaml
code ~/Library/Application\ Support/ndcli/config.yaml