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.

Metadata

Release files for catocli 3.1.4

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.4
File Size Uploaded Provenance
catocli-3.1.4.tar.gz 19.2 MB With provenance Details

Built distribution (wheel)

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

Total release size: 40.4 MB

Release files / catocli-3.1.4.tar.gz

Download URL catocli-3.1.4.tar.gz
Size 19.2 MB
Tags Source
SHA-256 checksum
How to use checksums
d1a61ffd5b9c76966cdc19f04695f7c0e38cbfae0197e133d5379f9f5074810e
BLAKE2b-256 checksum
How to use checksums
3b8615f6cc3b97ea7c8386071e194b73c32ff386ef7f7a97864d2f5984ba24c8
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 Oct 1, 2026.

Transparency log

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

Download URL catocli-3.1.4-py3-none-any.whl
Size 21.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5839311fe5e25a3bdc7b217abf02935b65f538a9b2ca85872a7f2fd39fc2fb90
BLAKE2b-256 checksum
How to use checksums
172e5b589da8e5a3aac51f7517890dcfd968d4faf4fa4f064c7349ab25c26407
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 Oct 1, 2026.

Transparency log

Security for catocli 3.1.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for catocli-3.1.4.tar.gz

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 Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.1.4 This release

2 release files Full provenance

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