CLI harness for Sumo Logic log search API — agent-friendly interface
Project description
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
Option 1: Environment variables (recommended for agents)
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)
cli-anything-sumologic search run "error | count by _sourceCategory"
# Search with explicit time range
cli-anything-sumologic search run "exception" --from "-1h" --to "now"
# Get results as JSON (for agents)
cli-anything-sumologic --json 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 |
Agent Usage (JSON mode)
All commands support --json for machine-readable output:
# Credentials check
cli-anything-sumologic --json auth status
# Run search, parse results
cli-anything-sumologic --json search run "error | count by _host" --from "-1h"
# Output:
# {
# "job_id": "...",
# "is_aggregate": true,
# "record_count": 5,
# "fields": [...],
# "records": [{"_host": "web-01", "_count": "42"}, ...]
# }
# Dry-run to preview query params
cli-anything-sumologic --json 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 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cli_anything_sumologic-1.0.0.tar.gz.
File metadata
- Download URL: cli_anything_sumologic-1.0.0.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a2a9af4030a96bdaa321028c2f885acfe8128bab7d3525a7c0c2736ac2edb98
|
|
| MD5 |
38857edf317037ede779238b5caee29e
|
|
| BLAKE2b-256 |
289ee7c9e58174390b433719ead32c156f5c63cfef54745946131b438e2df6b8
|
File details
Details for the file cli_anything_sumologic-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cli_anything_sumologic-1.0.0-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c02dcc4dd6af9b532743dcc49106892568fd51b19f8b92e25be19adc40b5738
|
|
| MD5 |
20e2f029da105af311b08d68813d851b
|
|
| BLAKE2b-256 |
86a02c235ddeae663fbedd8d8f63283aac5f8063cc378b1c240540dacaa43220
|