|
1 | 1 | --- |
2 | | -name: hotdata-cli |
3 | | -description: Use this skill when the user wants to run hotdata CLI commands, query the Hotdata API, list workspaces, list connections, create connections, list tables, manage datasets, execute SQL queries, manage saved queries, search tables, manage indexes, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "create a connection", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", "search a table", "list indexes", "create an index", "list saved queries", "run a saved query", or asks you to use the hotdata CLI. |
| 2 | +name: hotdata |
| 3 | +description: Use this skill when the user wants to run hotdata CLI commands, query the Hotdata API, list workspaces, list connections, create connections, list tables, manage datasets, execute SQL queries, manage saved queries, search tables, manage indexes, manage sessions, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "create a connection", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", "search a table", "list indexes", "create an index", "list saved queries", "run a saved query", "list sessions", "create a session", "run a session", or asks you to use the hotdata CLI. |
4 | 4 | version: 0.1.8 |
5 | 5 | --- |
6 | 6 |
|
@@ -276,6 +276,69 @@ hotdata auth status # Check current auth status |
276 | 276 | hotdata auth logout # Remove saved auth for the default profile |
277 | 277 | ``` |
278 | 278 |
|
| 279 | +### Sessions |
| 280 | + |
| 281 | +Sessions are for **ad-hoc, exploratory work** that does not need to be long-lived. They group related CLI activity (queries, dataset operations, etc.) under a single context so it can be tracked and cleaned up together. **Datasets created inside a session are tied to that session and will be removed when the session ends.** If you need data to persist beyond the session, create datasets outside of a session context. |
| 282 | + |
| 283 | +> **IMPORTANT: If `HOTDATA_SESSION` is set in the environment, you are inside an active session. NEVER attempt to unset, override, or work around this variable. Do not clear it, do not start a new session, do not run `sessions run` or `sessions new` or `sessions set`. All your work should be attributed to the current session. Attempting to nest or escape a session will fail with an error.** |
| 284 | +
|
| 285 | +``` |
| 286 | +hotdata sessions list [-w <workspace_id>] [-o table|json|yaml] |
| 287 | +hotdata sessions <session_id> [-w <workspace_id>] [-o table|json|yaml] |
| 288 | +hotdata sessions new [--name "Session Name"] [-o table|json|yaml] |
| 289 | +hotdata sessions set [<session_id>] |
| 290 | +hotdata sessions read |
| 291 | +hotdata sessions update [<session_id>] [--name "New Name"] [--markdown "..."] [-o table|json|yaml] |
| 292 | +hotdata sessions run <cmd> [args...] |
| 293 | +hotdata sessions <session_id> run <cmd> [args...] |
| 294 | +``` |
| 295 | + |
| 296 | +- `list` shows all sessions with a `*` marker on the active one. |
| 297 | +- `new` creates a session and sets it as active. Blocked inside an existing session. |
| 298 | +- `set` switches the active session. Omit the ID to clear. Blocked inside an existing session. |
| 299 | +- `read` prints the markdown content of the current session. Use this to retrieve session state at the start of work or between steps. |
| 300 | +- `update` modifies a session's name or markdown. Defaults to the active session if no ID is given. The `--markdown` field is for writing details about the work being done in the session — observations, intermediate findings, next steps, etc. This state persists for the life of the session and is the primary way to record context that should survive across commands or agent invocations within the session. |
| 301 | +- `run` launches a command with `HOTDATA_SESSION` and `HOTDATA_WORKSPACE` set in the child process environment. Creates a new session unless a session ID is provided before `run`. Blocked inside an existing session. |
| 302 | +- When inside a session (HOTDATA_SESSION is set), all API requests automatically include the session ID — no extra flags needed. |
| 303 | + |
| 304 | +#### Example: Building a data model in a session |
| 305 | + |
| 306 | +Use a session to explore tables and iteratively build a model description in the session markdown. |
| 307 | + |
| 308 | +1. Start a session: |
| 309 | + ``` |
| 310 | + hotdata sessions new --name "Model: sales pipeline" |
| 311 | + ``` |
| 312 | +2. Inspect tables and columns: |
| 313 | + ``` |
| 314 | + hotdata tables list --connection-id <connection_id> |
| 315 | + ``` |
| 316 | +3. Run exploratory queries to understand relationships, cardinality, and key columns: |
| 317 | + ``` |
| 318 | + hotdata query "SELECT DISTINCT status FROM sales.public.deals LIMIT 20" |
| 319 | + hotdata query "SELECT count(*), count(DISTINCT account_id) FROM sales.public.deals" |
| 320 | + ``` |
| 321 | +4. Write findings into the session markdown as you go: |
| 322 | + ``` |
| 323 | + hotdata sessions update --markdown "## sales pipeline model |
| 324 | + |
| 325 | + ### deals (sales.public.deals) |
| 326 | + - PK: id |
| 327 | + - FK: account_id -> accounts.id |
| 328 | + - status: open | won | lost |
| 329 | + - ~50k rows, one row per deal |
| 330 | + |
| 331 | + ### accounts (sales.public.accounts) |
| 332 | + - PK: id |
| 333 | + - name, industry, created_at |
| 334 | + - ~12k rows, one row per company |
| 335 | + |
| 336 | + ### TODO |
| 337 | + - check how line_items joins to deals |
| 338 | + - confirm revenue column semantics" |
| 339 | + ``` |
| 340 | +5. Continue exploring and update the markdown as the model takes shape. The markdown is the living artifact — when the session ends, its content captures what was learned. |
| 341 | + |
279 | 342 | Other commands (not covered in detail above): `hotdata connections new` (interactive connection wizard), `hotdata skills install|status`, `hotdata completions <bash|zsh|fish>`. |
280 | 343 |
|
281 | 344 | ## Workflow: Running a Query |
|
0 commit comments