Skip to main content

The official Netskope CLI — manage your Netskope tenant from the command line

Project description

Netskope CLI

The official command-line interface for the Netskope platform. Manage your tenant, query events, investigate alerts, configure policies, and more — all from your terminal.

Available as both netskope and the shorter alias nsk.


Installation

pip (all platforms)

pip install netskope

pipx (recommended — isolated install)

pipx installs the CLI in its own virtual environment so it won't conflict with other Python packages.

# Install pipx if you don't have it
# macOS
brew install pipx && pipx ensurepath

# Linux
python3 -m pip install --user pipx && pipx ensurepath

# Windows
py -m pip install --user pipx && pipx ensurepath

# Then install Netskope CLI
pipx install netskope

Homebrew (macOS / Linux)

brew install netskope

Note: The Homebrew formula may lag behind the latest PyPI release.

Windows

# Using pip (requires Python 3.11+)
py -m pip install netskope

# Or using pipx
py -m pipx install netskope

From source

git clone https://github.com/netSkopeoss/netksope-cli.git
cd netksope-cli
pip install .

Verify installation

netskope --version
nsk --help

Quick Start

1. Configure your tenant

netskope config set-tenant mytenant.goskope.com

2. Authenticate

Option A — API token:

export NETSKOPE_API_TOKEN="your-token"

Option B — Browser SSO login:

netskope auth login

3. Start using the CLI

# Check tenant connectivity and status
nsk status

# List recent alerts
nsk alerts list --limit 10

# Search events
nsk events list --query 'alert_type eq "DLP"' --limit 20

# List users
nsk users list

# Export incidents as CSV
nsk incidents list -o csv > incidents.csv

# View policies
nsk policy list -o table

Output Formats

Every command supports multiple output formats via the -o / --output flag:

Format Flag Description
Table -o table Human-friendly table (default in TTY)
JSON -o json Pretty-printed JSON
JSONL -o jsonl One JSON object per line
CSV -o csv Comma-separated values
YAML -o yaml YAML output
# Pipe JSON output to jq
nsk alerts list -o json | jq '.[] | .alert_name'

# Export users to CSV
nsk users list -o csv > users.csv

Commands

Category Commands
Events events list
Alerts alerts list
Incidents incidents list, incidents show
Users users list
Policy policy list
Devices devices list
Status status
Auth auth login, auth logout, auth status
Config config set-tenant, config show
Publishers publishers list
Steering steering list
IPSec ipsec list
Services services list
DNS dns list
Docs docs

Run nsk --help or nsk <command> --help for full details.


Environment Variables

Variable Description
NETSKOPE_API_TOKEN API v2 token for authentication
NETSKOPE_TENANT Tenant hostname (overrides config file)
NETSKOPE_PROFILE Configuration profile to use
# Check which values are active and their sources
netskope config show

Shell Completion

# Bash
netskope --install-completion bash

# Zsh
netskope --install-completion zsh

# Fish
netskope --install-completion fish

# PowerShell
netskope --install-completion powershell

Requirements

  • Python 3.11 or later
  • A Netskope tenant with API access

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netskope-0.2.1.tar.gz (103.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netskope-0.2.1-py3-none-any.whl (132.9 kB view details)

Uploaded Python 3

File details

Details for the file netskope-0.2.1.tar.gz.

File metadata

  • Download URL: netskope-0.2.1.tar.gz
  • Upload date:
  • Size: 103.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.14.0-1018-aws

File hashes

Hashes for netskope-0.2.1.tar.gz
Algorithm Hash digest
SHA256 04bac47f2673f772f540bf03ebfc89138dd4707af2d2a9e41186937c5b55d13f
MD5 b586196f32a9cbe8412553a4bccf833a
BLAKE2b-256 7974cd898c4f8c91616e7c2885fa813be20b27f5448bdea17d5de96e316c464f

See more details on using hashes here.

File details

Details for the file netskope-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: netskope-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 132.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.14.0-1018-aws

File hashes

Hashes for netskope-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f580c251221a0b3623a1a36eb2ae559a9dcffb12068acf2a6bc85e814fc8fbb4
MD5 373e3afa714942b1ec0e60e94bbd7951
BLAKE2b-256 c077cc1b0eb83d65d6188fbd6fbc28cd3212779806109d795300a2b1b6328949

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page