Trino
Generic Trino JSON CLI. Read commands use guarded SQL; exec runs one statement allowed by the configured Trino account.
Local .env
The CLI automatically loads a private .env beside this SKILL.md through pass-cli. Copy .env.example to .env and replace placeholders with environment values or secret-manager pointers.
| Variable | Flag | Default |
|---|---|---|
TRINO_HOST |
--host |
none |
TRINO_PORT |
--port |
443 for HTTPS, otherwise 8080 |
TRINO_USER |
--user |
none |
TRINO_CATALOG |
--catalog |
none |
TRINO_SCHEMA |
--schema |
none |
TRINO_HTTP_SCHEME |
--http-scheme |
https |
TRINO_PASSWORD |
none | empty |
TRINO_ACCESS_TOKEN |
none | empty |
TRINO_CERT / TRINO_KEY |
none | empty |
TRINO_VERIFY |
--verify / --no-verify |
true |
Never pass secrets as CLI arguments or commit a real .env.
Read
uv run --python 3.13 --with trino python scripts/tr.py query --sql "SELECT current_catalog, current_schema"
uv run --python 3.13 --with trino python scripts/tr.py list-catalogs
uv run --python 3.13 --with trino python scripts/tr.py list-schemas --catalog iceberg
uv run --python 3.13 --with trino python scripts/tr.py list-tables --catalog iceberg --schema analytics
uv run --python 3.13 --with trino python scripts/tr.py describe-table --catalog iceberg --schema analytics --table events
Read commands reject obvious mutations, enforce one statement, cap rows, and use request timeouts.
Execute
Use exec only after the user approves the exact operation and target:
uv run --python 3.13 --with trino python scripts/tr.py \
--catalog iceberg --schema analytics \
exec --sql "ALTER TABLE events ADD COLUMN source varchar"
exec accepts one DDL, DML, or administrative statement. It rejects empty and multi-statement SQL. There is no local write authorization gate: Trino account and catalog grants are the authorization boundary.
Safety contract
- Obtain fresh user approval before each mutation scope.
- Read commands retain local SQL guards, timeouts, TLS verification, and result limits.
execrejects empty and multi-statement SQL; the configured account decides what is allowed.- Do not print secrets, tokens, certificates,
.envcontents, or environment variables. - Ask before touching sensitive data.
Output
{
"rows": [{"catalog": "iceberg"}],
"row_count": 1
}
Execution returns {"ok": true} and returned rows when available.
Tests
uv run --python 3.13 --with trino python tests/test_tr.py