Trino query monitoring: CLI, TUI dashboard, and progress library
Project description
trinops
Trino query monitoring from the terminal. CLI commands for listing and inspecting queries, a live TUI dashboard, and a progress-tracking library for use in Python scripts.
Installation
Try it without installing:
uvx trinops top
Or install permanently:
pip install trinops
For tqdm progress bars in library usage:
pip install trinops[tqdm]
Quick Start
Point at a cluster and go:
trinops top --server trino.example.com --user myuser
Or configure once and skip the flags:
trinops config init --server trino.example.com --user myuser --auth none --yes
trinops top
Environment variables work too:
export TRINOPS_SERVER=trino.example.com
export TRINOPS_USER=myuser
trinops top
CLI Usage
List queries
# Your recent queries
trinops queries
# All users' queries
trinops queries --query-user all
# Filter by state
trinops queries --state RUNNING
# JSON output (pipe to jq, etc.)
trinops queries --json
# Select specific fields
trinops queries --select query_id,state,user,elapsed_time
Inspect a single query
# Rich formatted detail
trinops query <query-id>
# Full REST API response as JSON
trinops query <query-id> --json
# Select specific fields from the raw response
trinops query <query-id> --select queryId,state,queryStats.elapsedTime,queryStats.peakUserMemoryReservation
Schema search
Cache catalog metadata locally and search across tables and columns:
# Cache a specific catalog
trinops schema refresh --catalog tpch
# Cache all discoverable catalogs
trinops schema refresh --all
# Search for tables
trinops schema search "lineitem"
trinops schema search "order*"
# Search for columns
trinops schema search --columns "customer_id"
# Show table details
trinops schema show tpch.sf1.lineitem
# List cached catalogs
trinops schema list
All schema commands support --json output and --profile for multi-cluster setups.
TUI dashboard
trinops tui
trinops top # alias
The dashboard shows a live-updating table of queries with sorting, a tabbed detail pane, and configurable refresh interval.
Keybindings:
| Key | Action |
|---|---|
r |
Force refresh |
u |
Toggle user filter |
a |
Show all users |
- / + |
Adjust refresh interval |
Enter |
Open detail pane for selected query |
Escape |
Close detail pane |
k |
Kill selected query (when enabled) |
Tab / Shift+Tab |
Cycle focus between table and detail pane |
q |
Quit |
When the detail pane is open:
| Key | Action |
|---|---|
Up / Down |
Scroll tab content |
Left / Right |
Switch between tabs |
PgUp / PgDn |
Page scroll |
Home / End |
Jump to top/bottom |
c |
Copy current tab content to clipboard |
Click column headers to sort; click again to reverse. Default sort is by Elapsed time, descending.
Configuration
Config file lives at ~/.config/trinops/config.toml:
[default]
server = "trino.example.com"
scheme = "https"
user = "myuser"
auth = "none"
query_limit = 50
[profiles.prod]
server = "trino-prod.example.com:443"
auth = "oauth2"
Manage config from the CLI:
# Set individual values
trinops config set server trino.example.com
trinops config set user myuser
trinops config set query_limit 100
# Configure a named profile
trinops config set server trino-prod:443 --profile prod
trinops config set auth oauth2 --profile prod
# View current config
trinops config show
trinops config show --profile prod
Authentication
Supported methods: none, basic, jwt, oauth2, kerberos.
# Check auth status
trinops auth status
# Run OAuth2 flow
trinops auth login
For basic auth, use password_cmd to fetch credentials from a secret manager (e.g., pass, 1password-cli) rather than storing passwords in the config file. For oauth2, install keyring to cache tokens across sessions.
Library Usage
Wrap a trino cursor or connection to get live progress display during query execution:
import trino
from trinops import TrinoProgress
conn = trino.dbapi.connect(host="trino.example.com", port=443, user="myuser")
cursor = conn.cursor()
with TrinoProgress(cursor) as tp:
tp.execute("SELECT * FROM catalog.schema.table")
rows = tp.fetchall()
You can also monitor an already-running query by passing a connection and query ID:
with TrinoProgress(conn, query_id="20260310_143549_08022_abc") as tp:
tp.start()
tp.wait()
Claude Code Integration
trinops ships with a Claude Code skill that teaches Claude how to query and inspect Trino cluster activity. If you have trinops installed in a project, Claude can use trinops queries --select and trinops query <id> --select to investigate query performance, find long-running queries, and diagnose failures with minimal context usage.
A Claude Code plugin is also included for marketplace discoverability.
Roadmap
Completed:
Kill query support— cancel running queries from CLI and TUI (#1)Enriched TUI detail— tabbed detail view with overview, stats, tables, and errors (#2)Schema cache and search— cache catalog metadata locally, search tables/columns (#3)
Planned:
- Query plan visualization — render the stage tree from the REST API in both CLI and TUI (#5)
- MCP server — Model Context Protocol server for AI assistant integration (#4)
- Multi-cluster support — switch between profiles in the TUI, unified multi-cluster view (#6)
- Notifications and alerts — desktop notifications and webhooks for long-running queries and failures (#7)
- Worker/node health — cluster node monitoring via
/v1/node(#8)
Requirements
- Python 3.10+
- A running Trino cluster with the REST API accessible
License
Project details
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 trinops-0.4.0.tar.gz.
File metadata
- Download URL: trinops-0.4.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e531acef69b0300daf5783fd41203ff581a42c01a043d5a02848b61ecff07eb4
|
|
| MD5 |
b11544fabbd4cd56da2fd7a3c6ba3bcd
|
|
| BLAKE2b-256 |
8db2667f8d393638c714c4456a0308483f62265a5637b53486d0463ac42da174
|
Provenance
The following attestation bundles were made for trinops-0.4.0.tar.gz:
Publisher:
publish.yml on lokkju/trinops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trinops-0.4.0.tar.gz -
Subject digest:
e531acef69b0300daf5783fd41203ff581a42c01a043d5a02848b61ecff07eb4 - Sigstore transparency entry: 1123328509
- Sigstore integration time:
-
Permalink:
lokkju/trinops@9b53d641d93e8bcbee8d6166cd5b513d1170da42 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/lokkju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b53d641d93e8bcbee8d6166cd5b513d1170da42 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trinops-0.4.0-py3-none-any.whl.
File metadata
- Download URL: trinops-0.4.0-py3-none-any.whl
- Upload date:
- Size: 47.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f21d78e3380a9f427092547f465a0ed2bf6d2375b3567df7ae36528f1698d8cd
|
|
| MD5 |
30a7c74a537362eed0d0403b546feb36
|
|
| BLAKE2b-256 |
277456b535902fcc1e605564dcdc0ab0a5a2aa5f02b7091ea0ab270d123dc66d
|
Provenance
The following attestation bundles were made for trinops-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on lokkju/trinops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trinops-0.4.0-py3-none-any.whl -
Subject digest:
f21d78e3380a9f427092547f465a0ed2bf6d2375b3567df7ae36528f1698d8cd - Sigstore transparency entry: 1123328586
- Sigstore integration time:
-
Permalink:
lokkju/trinops@9b53d641d93e8bcbee8d6166cd5b513d1170da42 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/lokkju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b53d641d93e8bcbee8d6166cd5b513d1170da42 -
Trigger Event:
push
-
Statement type: