Getting Started with Netpicker CLI

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

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

ModulePurpose
devicesList and manage your network inventory.
backupsConfiguration triggers and version history.
complianceRun checks and generate pass/fail reports.
policyManage compliance rules and policies.
automationTrigger specific automation workflows.

Diagnostics

Use these tools to verify your setup:

Option/CommandDescription
healthVerifies the CLI can reach the Netpicker API
whoamiDisplays 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

Would you like a hands-on session?

A couple times a week our in-house trainer is available for a private or group session. In this session we can cover our Slurp’it or Mock’it solution but also integrations with Netpicker, NetBox, Nautobot & Infrahub.

Yes, keep me informed

Connect with us on LinkedIn to stay updated on the latest happenings, news, and exciting developments at Slurp’it. Just click the button below to follow us and be a part of our professional network.

Newsletter