setup
The interactive setup guide walks you through initial NDCLI configuration.
ndcli setupOverview
Section titled “Overview”The setup guide provides a guided experience for configuring NDCLI, especially useful for first-time users. It handles:
- Authentication - Login and credential storage setup
- Organization - Create a new organization or select an existing one
- Preferences - Configure default output format
Automatic Invocation
Section titled “Automatic Invocation”The setup guide runs automatically when:
- You run NDCLI for the first time (no config file exists)
- You run any command that requires configuration
You can also run it manually at any time to reconfigure settings.
What the Guide Configures
Section titled “What the Guide Configures”Authentication
Section titled “Authentication”- Initiates OAuth2 device authorization flow
- Opens browser for authentication
- Stores tokens securely in system keyring (or file fallback)
Organization
Section titled “Organization”The guide offers three options:
- Create a new organization - For users starting fresh
- Select an existing organization - For users joining an existing org
- Accept a pending invitation - For users who received an invite
Output Format
Section titled “Output Format”Choose your preferred default output format:
| Format | Best For |
|---|---|
detailed | Interactive terminal use (default) |
table | Viewing lists and summaries |
simple | Quick, compact output |
json | Scripting and automation |
Examples
Section titled “Examples”ndcli setup
ndcli config showndcli auth showRe-running Setup
Section titled “Re-running Setup”You can run ndcli setup at any time to:
- Re-authenticate with a different account
- Change your default organization
- Update output preferences
The guide preserves existing settings where possible and only updates what you change.
Configuration Files Created
Section titled “Configuration Files Created”After setup completes, the following files are created:
| Platform | Config File | Auth Storage |
|---|---|---|
| macOS | ~/Library/Application Support/ndcli/config.yaml | Keychain |
| Linux | ~/.config/ndcli/config.yaml | Secret Service |
| Windows | %APPDATA%\ndcli\config.yaml | Credential Manager |
Manual Alternative
Section titled “Manual Alternative”If you prefer to configure NDCLI manually instead of using the guide:
ndcli auth login
ndcli config set org my-organization
ndcli config set output detailedTroubleshooting
Section titled “Troubleshooting”Browser Doesn’t Open
Section titled “Browser Doesn’t Open”If the browser doesn’t open automatically during authentication:
- Copy the URL displayed in the terminal
- Paste it into your browser manually
- Complete authentication
- Return to the terminal
Keyring Unavailable
Section titled “Keyring Unavailable”If the system keyring is unavailable, NDCLI falls back to file-based token storage at:
~/.config/ndcli/auth.json(Linux)~/Library/Application Support/ndcli/auth.json(macOS)
Organization Not Found
Section titled “Organization Not Found”If your organization isn’t listed:
- Ask an administrator to send you an invitation
- Accept the invitation:
ndcli org invite accept org-name - Re-run setup to select the organization