Skip to main content

Cato Networks GraphQL API CLI

catocli is a command-line client for the Cato Networks GraphQL API. It supports interactive use and automation for querying, reporting, and managing Cato account configuration.

Use it to:

  • Query network, security, user, and application data
  • Manage supported Cato configuration through GraphQL mutations
  • Export results as JSON or CSV
  • Automate workflows with profiles, files, and command-line overrides

Requirements

  • Python 3.10 or newer (tested with Python 3.10 through 3.14)
  • A Cato API token and account ID

See Generating API Keys for the Cato API for token setup.

Installation

python3 -m pip install --upgrade catocli
catocli --version

Quick start

Configure the default profile:

# Interactive setup
catocli configure set

# Or non-interactive setup
catocli configure set --cato-token "your-api-token" --account-id "12345"

Run a query:

catocli query entityLookup '{"type":"country"}'

Inspect available commands and operation-specific arguments:

catocli --help
catocli query --help
catocli query entityLookup --help

Credentials are stored in the local profile configuration. Do not place API tokens in source files, shell history, or committed scripts. See Profile Management for named profiles and environment selection.

Configuration

# List profiles
catocli configure list

# Show the active profile
catocli configure show

# Select a profile
catocli configure use prod

# Override the configured account for one operation
catocli query entityLookup -accountID 12345 '{"type":"country"}'

For shell completion setup, see Tab Completion.

JSON input

Pass variables inline or load them from a file:

catocli query site networkRangeList \
  '{"networkRangeListInput":{"site":{"by":"ID","input":"527548"}}}'

catocli query site networkRangeList \
  --json-file query.site.networkRangeList.json

Operation help includes a generated input example:

catocli query site networkRangeList --help

Run from source

git clone https://github.com/Cato-Networks/cato-cli.git
cd cato-cli
python3 -m catocli --help

Guides

Reporting guides

Examples

Account metrics

catocli query accountMetrics '{"timeFrame":"last.PT1H"}'

User activity CSV

catocli query appStats '{
    "appStatsFilter": [],
    "appStatsSort": [],
    "dimension": [ { "fieldName": "user_name" }, { "fieldName": "domain" } ],
    "measure": [
        { "aggType": "sum", "fieldName": "upstream" },
        { "aggType": "sum", "fieldName": "downstream" },
        { "aggType": "sum", "fieldName": "traffic" },
        { "aggType": "sum", "fieldName": "flows_created" }
    ],
    "timeFrame": "last.P1D"
}' -f csv --csv-filename appStats_daily_user_activity_report.csv

Security event analysis

catocli query eventsTimeSeries '{
    "buckets": 7,
    "eventsFilter": [{"fieldName": "event_type", "operator": "is", "values": ["Security"]}],
    "eventsMeasure": [{"aggType": "sum", "fieldName": "event_count"}],
    "perSecond": false,
    "timeFrame": "last.P7D"
}' -f csv --csv-filename eventsTimeSeries_weekly_security_events_report.csv

Output formats

Reporting operations support:

  • Enhanced JSON output by default
  • Original API JSON with --raw
  • CSV output with -f csv
  • Custom filenames with --csv-filename
  • Timestamped filenames with --append-timestamp

Check operation help before using format-specific options:

catocli query appStats --help

Time frames

Common time frame patterns:

  • last.PT1H: last hour
  • last.P1D: last day
  • last.P7D: last seven days
  • last.P1M: last month
  • utc.2026-08-{01/00:00:00--01/23:59:59}: custom UTC range

Getting Help

  • Add -h or --help to any command
  • Read the Cato API documentation
  • Verify installed versions with catocli --version and python3 --version
  • Download Python from python.org

License

See LICENSE.

Release files for catocli 3.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for catocli 3.1.2
File Size Uploaded
catocli-3.1.2.tar.gz 19.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for catocli 3.1.2
File Interpreter ABI Platform
catocli-3.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.5 MB

Release files / catocli-3.1.2.tar.gz

Download URL catocli-3.1.2.tar.gz
Size 19.3 MB
Tags Source
SHA-256 checksum
How to use checksums
6c43593a3a821b9e0703e32be88eff9ef276a101cd81ed7e706adc6ebe439329
BLAKE2b-256 checksum
How to use checksums
52c31ddeff087d49da33df17a2ef491d6b3d70bbba4b35d35b0df1aa53a9d98f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / catocli-3.1.2-py3-none-any.whl

Download URL catocli-3.1.2-py3-none-any.whl
Size 21.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ef03e2dda42c10729e7ede55414bc301f0ba4d47cd5f2186db700701e53ff9fd
BLAKE2b-256 checksum
How to use checksums
064e7e2d7d3730fd62295bdd14b9263e54c03c5877a833d25e1034daf7ed4cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release history Release notifications | RSS feed

3.1.3

2 release files

This release

3.1.2 This release

2 release files

3.1.1

2 release files

3.0.70

2 release files

3.0.69

2 release files

3.0.68

2 release files

3.0.66

2 release files

3.0.64

2 release files

3.0.63

2 release files

3.0.61

2 release files

3.0.59

2 release files

3.0.57

2 release files

3.0.56

2 release files

3.0.55

2 release files

3.0.54

2 release files

3.0.53

2 release files

3.0.52

2 release files

3.0.51

2 release files

3.0.47

2 release files

3.0.44

2 release files

3.0.42

2 release files

3.0.41

2 release files

3.0.36

2 release files

3.0.31

2 release files

3.0.30

2 release files

3.0.29

2 release files

3.0.26

2 release files

3.0.25

2 release files

3.0.24

2 release files

3.0.22

2 release files

3.0.18

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.1.8

2 release files

2.1.6

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.21

1 release file

1.0.18

2 release files

1.0.15

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page