What is Netpicker CLI?
The Netpicker CLI is a powerful command-line tool designed to interact with the Netpicker API. It bridges the gap between the web-based UI and your local terminal.
Key Features
- Backups: Manually trigger or schedule configuration backups.
- Device Management: List, add, or update devices in your inventory.
- Compliance: Run policies and retrieve instant pass/fail results.
- Automation: Execute jobs, manage queues, and monitor logs.
Installation
Requirement: Python 3.11+
Option A: Global Installation
# Install the CLI
pip install netpicker-cli
Option B: Virtual Environment (Recommended)
To avoid conflicts with other Python packages, it is best practice to install it in a virtual environment:
python -m venv netpicker-env
# Activate on Linux/macOS:
source netpicker-env/bin/activate
# Activate on Windows:
netpicker-env\Scripts\activate
pip install netpicker-cli
Verify installation
netpicker --help
Authentication & Security
To use the CLI, you must authenticate with your Netpicker instance. You can either save your credentials locally or use environment variables for temporary sessions.
Option 1: Save Credentials (Local Use)
Use the auth login command with the required flags. This saves your details to the OS keyring so you don’t have to re-enter them.
netpicker auth login --base-url "https://app.netpicker.io" --tenant "default" --token "your-api-token"
Option 2: Environment Variables (CI/CD)
For automation or temporary terminal sessions, export these variables. The CLI will prioritize these over saved credentials.
export NETPICKER_BASE_URL="https://app.netpicker.io"
export NETPICKER_TENANT="default"
export NETPICKER_TOKEN="your-api-token"
CLI Structure & Command Modules
The general syntax for any command follows this hierarchy:
netpicker [global-options] [module] [action] [arguments]
Core Modules
| Module | Purpose |
| devices | List and manage your network inventory. |
| backups | Configuration triggers and version history. |
| compliance | Run checks and generate pass/fail reports. |
| policy | Manage compliance rules and policies. |
| automation | Trigger specific automation workflows. |
Diagnostics
Use these tools to verify your setup:
| Option/Command | Description |
| health | Verifies the CLI can reach the Netpicker API |
| whoami | Displays which user and tenant you are currently logged in as. |
How to explore subcommands
Each module has its own set of specific actions. You can “drill down” into any module by adding --help after the module name to see what is possible.
# See all device-related actions
netpicker devices --help
# See all backup-related actions
netpicker backups --help
Resources
For advanced examples and source code, visit the official Netpicker GitHub Repository.
PyPI Package: netpicker-cli
