@trel-to/cli
v0.1.0
Published
Trel CLI for AI agents - query logs, traces, exceptions with MCP keys
Maintainers
Readme
@trel-to/cli
CLI for AI agents to query Trel observability data (logs, traces, exceptions) using MCP keys.
Setup
Create an MCP key in Settings → AI Agents & MCP in your Trel dashboard. Use that key with the CLI.
Usage
# Install globally or use npx
npm install -g @trel-to/cli
# or
npx @trel-to/cli <command> [options]Commands
| Command | Description |
|---------|-------------|
| logs | Fetch logs with optional filters |
| exceptions | List exception groups |
| exception <id> | Get exception group details |
| trace <traceId> | Get full trace (spans, logs, exceptions) |
| performance | List performance endpoints |
| overview | Analytics overview |
Options
-k, --key <key>— API key (or setTREL_KEY/TREL_MCP_KEYenv)-e, --environment <env>— production, staging, development (default: production)--from <ts>— Start: Unix seconds or1h,6h,24h,7d--to <ts>— End time (Unix seconds)
Examples
# Via env (recommended for AI agents)
export TREL_KEY=trel_mcp_xxx
trel logs --search error
trel logs --from 1h --severity error
trel exceptions --limit 20
trel trace abc123def456
# Via flag
trel logs --key trel_mcp_xxx --search "timeout"
trel performance --environment staging
trel overview --window 24hOutput
- Default: JSON (easy for AI agents to parse)
- Logs: use
-o textfor human-readable one-line format
