Skip to main content

cli-anything-sumologic

CLI harness for the Sumo Logic Search Job API. Run Sumo Logic log searches from the command line or from AI agents.

Prerequisites

A Sumo Logic account with API access. No additional software installation required — the CLI calls the Sumo Logic REST API directly over HTTPS.

You will need:

  • Access ID and Access Key from your Sumo Logic account (Preferences → Access Keys)
  • API endpoint for your deployment (e.g. https://api.us2.sumologic.com/api/v1)

Installation

cd agent-harness
pip install -e .

Verify:

which cli-anything-sumologic
cli-anything-sumologic --help

Configuration

export SUMO_ENDPOINT="https://api.us2.sumologic.com/api/v1"
export SUMO_ACCESS_ID="your-access-id"
export SUMO_ACCESS_KEY="your-access-key"

Option 2: Interactive configure

cli-anything-sumologic auth configure

Credentials are stored in ~/.cli-anything-sumologic/session.json.

Usage

Interactive REPL

cli-anything-sumologic

One-shot commands

# Run a search (last 15 minutes) — TOON output by default
cli-anything-sumologic search run "error | count by _sourceCategory"

# Search with explicit time range
cli-anything-sumologic search run "exception" --from "-1h" --to "now"

# Full indented JSON output (no truncation)
cli-anything-sumologic --format json search run "* | limit 10" --from "-5m"

# Human-readable text
cli-anything-sumologic --format text search run "* | limit 10" --from "-5m"

# Save a query for reuse
cli-anything-sumologic search save my-errors "error | count" --from "-1h"

# Replay a saved query
cli-anything-sumologic search replay my-errors

# Show credential status
cli-anything-sumologic auth status

# Test credentials
cli-anything-sumologic auth test

Command Groups

Group Commands Description
auth configure, status, test Manage credentials
search run, history, saved, save, delete-saved, replay Log searches
job status, messages, records, delete Manage search jobs
session info, clear-history Session state

Output Formats

Flag Description
(no flag) TOON — Token-Oriented Object Notation (default, token-efficient)
--format toon Same as default
--format json Full indented JSON
--format text Human-readable tables (always used inside the REPL)
--no-truncation Disable field truncation entirely

TOON uses YAML-like key-value pairs for objects and tabular CSV rows for uniform arrays (field names declared once per array). Field truncation is applied before encoding to both toon and json formats.

Default truncation limits (overridable via env vars):

Env var Default Controls
SUMO_TRUNCATE_STR 2000 Max string length in chars
SUMO_TRUNCATE_LIST 20 Max items kept from any list
SUMO_TRUNCATE_DICT 30 Max keys kept from any dict

--json is a hidden alias for --format json kept for backward compatibility.

Agent Usage (TOON mode — default)

# Credentials check
cli-anything-sumologic auth status

# Run search, parse results — output is compact JSON with truncation
cli-anything-sumologic search run "error | count by _host" --from "-1h"
# {"job_id":"...","is_aggregate":true,"record_count":5,"fields":[...],"records":[{"_host":"web-01","_count":"42"},...]}

# Full JSON when you need untruncated data
cli-anything-sumologic --format json search run "error | count by _host" --from "-1h"

# Dry-run to preview query params
cli-anything-sumologic search run "error" --dry-run --from "-1h"

Running Tests

Unit tests (no credentials needed)

cd agent-harness
pip install -e .
pytest cli_anything/sumologic/tests/test_core.py -v

E2E tests (requires live Sumo Logic credentials)

export SUMO_ENDPOINT="https://api.us2.sumologic.com/api/v1"
export SUMO_ACCESS_ID="your-id"
export SUMO_ACCESS_KEY="your-key"

CLI_ANYTHING_FORCE_INSTALLED=1 pytest cli_anything/sumologic/tests/test_full_e2e.py -v -s

Deployment Endpoints

Region Endpoint
US1 https://api.sumologic.com/api/v1
US2 https://api.us2.sumologic.com/api/v1
EU https://api.eu.sumologic.com/api/v1
AU https://api.au.sumologic.com/api/v1
IN https://api.in.sumologic.com/api/v1
JP https://api.jp.sumologic.com/api/v1
CA https://api.ca.sumologic.com/api/v1
FED https://api.fed.sumologic.com/api/v1

Metadata

Release files for cli-anything-sumologic 1.2.0

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

Source distribution (sdist)

Source distribution for cli-anything-sumologic 1.2.0
File Size Uploaded Provenance Actions
cli_anything_sumologic-1.2.0.tar.gz 33.2 kB Without provenance Details for cli_anything_sumologic-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cli-anything-sumologic 1.2.0
File Interpreter ABI Platform Actions
cli_anything_sumologic-1.2.0-py3-none-any.whl Python 3 none any Details for cli_anything_sumologic-1.2.0-py3-none-any.whl

Total release size: 71.4 kB

Release files / cli_anything_sumologic-1.2.0.tar.gz

Download URL cli_anything_sumologic-1.2.0.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9d2c69c9bac60b0448ddd5df7bc4550d06267af04f369d96f202270558a83f7b
BLAKE2b-256 checksum
How to use checksums
a8115cc8cef5e126a512674a0b26683518ca700e7dac220aad0246a9725ed1b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Release files / cli_anything_sumologic-1.2.0-py3-none-any.whl

Download URL cli_anything_sumologic-1.2.0-py3-none-any.whl
Size 38.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed308b9bb98724aca7ec6969bd9fe6860b99ffa2f7aed0095d6b04840892a7f1
BLAKE2b-256 checksum
How to use checksums
c9c920533434ec1ab5decd1d94ecea45e5c5fc63579690d88f63cfa456b72b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Security for cli-anything-sumologic 1.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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