# netskope-cli

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

## Installation

```bash
pip install netskope-cli
```

## Quick Start

The CLI is available as both `netskope` and the shorter `nsk` alias:

```bash
# Configure your tenant
netskope config set-tenant sedemo.goskope.com

# Authenticate with API token
export NETSKOPE_API_TOKEN="your-token"

# Or login via browser (SSO)
netskope auth login

# Search events
netskope events alerts --query 'alert_type eq "DLP"' --limit 10

# List users (using the short alias)
nsk users list

# Get help
nsk --help
```

## Environment Variables

The CLI supports the following environment variables, which override config file values:

| Variable | Description | Example |
|---|---|---|
| `NETSKOPE_API_TOKEN` | API v2 token for authentication | `export NETSKOPE_API_TOKEN="your-token-here"` |
| `NETSKOPE_TENANT` | Tenant hostname (overrides configured tenant) | `export NETSKOPE_TENANT="mytenant.goskope.com"` |
| `NETSKOPE_PROFILE` | Configuration profile to use | `export NETSKOPE_PROFILE="staging"` |

You can verify which values are active and their sources with:

```bash
netskope config show
```

## Shell Completion

Install tab completion for your shell:

```bash
# Bash
netskope --install-completion bash

# Zsh
netskope --install-completion zsh

# Fish
netskope --install-completion fish
```
