Skip to content

Commit b7fcebf

Browse files
authored
Rename sandbox and queries commands
1 parent 1c8f860 commit b7fcebf

12 files changed

Lines changed: 328 additions & 547 deletions

File tree

README.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ API key priority (lowest to highest): config file → `HOTDATA_API_KEY` env var
6666
| `tables` | `list` | List tables and columns |
6767
| `datasets` | `list`, `create` | Manage uploaded datasets |
6868
| `query` | | Execute a SQL query |
69-
| `queries` | `list`, `create`, `update`, `run` | Manage saved queries |
69+
| `queries` | `list` | Inspect query run history |
7070
| `search` | | Full-text search across a table column |
7171
| `indexes` | `list`, `create` | Manage indexes on a table |
7272
| `results` | `list` | Retrieve stored query results |
7373
| `jobs` | `list` | Manage background jobs |
74-
| `sessions` | `list`, `new`, `set`, `read`, `update`, `run` | Manage work sessions |
74+
| `sandbox` | `list`, `new`, `set`, `read`, `update`, `run` | Manage sandboxes |
7575
| `skills` | `install`, `status` | Manage the hotdata agent skill |
7676

7777
## Global options
@@ -160,21 +160,17 @@ hotdata query status <query_run_id> [-o table|json|csv]
160160
- Use `hotdata query status <query_run_id>` to poll for results.
161161
- Exit codes for `query status`: `0` = succeeded, `1` = failed, `2` = still running (poll again).
162162

163-
## Saved Queries
163+
## Query Run History
164164

165165
```sh
166-
hotdata queries list [--limit <n>] [--offset <n>] [--format table|json|yaml]
167-
hotdata queries <query_id> [--format table|json|yaml]
168-
hotdata queries create --name "My Query" --sql "SELECT ..." [--description "..."] [--tags "tag1,tag2"]
169-
hotdata queries update <query_id> [--name "New Name"] [--sql "SELECT ..."] [--description "..."] [--tags "tag1,tag2"]
170-
hotdata queries run <query_id> [--format table|json|csv]
166+
hotdata queries list [--limit <n>] [--cursor <token>] [--status <csv>] [-o table|json|yaml]
167+
hotdata queries <query_run_id> [-o table|json|yaml]
171168
```
172169

173-
- `list` shows saved queries with name, description, tags, and version.
174-
- View a query by ID to see its formatted and syntax-highlighted SQL.
175-
- `create` requires `--name` and `--sql`. Tags are comma-separated.
176-
- `update` accepts any combination of fields to change.
177-
- `run` executes a saved query and displays results like the `query` command.
170+
- `list` shows past query executions with status, creation time, duration, row count, and a truncated SQL preview (default limit 20).
171+
- `--status` filters by run status (comma-separated, e.g. `--status running,failed`).
172+
- View a run by ID to see full metadata (timings, `result_id`, snapshot, hashes) and the formatted, syntax-highlighted SQL.
173+
- If a run has a `result_id`, fetch its rows with `hotdata results <result_id>`.
178174

179175
## Search
180176

@@ -226,27 +222,27 @@ hotdata jobs <job_id> [--workspace-id <id>] [--format table|json|yaml]
226222
- `--job-type` accepts: `data_refresh_table`, `data_refresh_connection`, `create_index`.
227223
- `--status` accepts: `pending`, `running`, `succeeded`, `partially_succeeded`, `failed`.
228224

229-
## Sessions
225+
## Sandboxes
230226

231-
Sessions group related CLI activity (queries, dataset operations, etc.) under a single context.
227+
Sandboxes group related CLI activity (queries, dataset operations, etc.) under a single context.
232228

233229
```sh
234-
hotdata sessions list [-w <id>] [-o table|json|yaml]
235-
hotdata sessions <session_id> [-w <id>] [-o table|json|yaml]
236-
hotdata sessions new [--name "My Session"] [-o table|json|yaml]
237-
hotdata sessions set [<session_id>]
238-
hotdata sessions read
239-
hotdata sessions update [<session_id>] [--name "New Name"] [--markdown "..."] [-o table|json|yaml]
240-
hotdata sessions run <cmd> [args...]
241-
hotdata sessions <session_id> run <cmd> [args...]
230+
hotdata sandbox list [-w <id>] [-o table|json|yaml]
231+
hotdata sandbox <sandbox_id> [-w <id>] [-o table|json|yaml]
232+
hotdata sandbox new [--name "My Sandbox"] [-o table|json|yaml]
233+
hotdata sandbox set [<sandbox_id>]
234+
hotdata sandbox read
235+
hotdata sandbox update [<sandbox_id>] [--name "New Name"] [--markdown "..."] [-o table|json|yaml]
236+
hotdata sandbox run <cmd> [args...]
237+
hotdata sandbox <sandbox_id> run <cmd> [args...]
242238
```
243239

244-
- `list` shows all sessions with a `*` marker on the active one.
245-
- `new` creates a session and sets it as active.
246-
- `set` switches the active session. Omit the ID to clear the active session.
247-
- `read` prints the markdown content of the current session.
248-
- `update` modifies the name or markdown of a session (defaults to the active session).
249-
- `run` runs a command with the hotdata CLI sandboxed in a session. Creates a new session unless a session ID is provided before `run`. Useful for launching an agent that can only access session data. Nesting sessions is not allowed.
240+
- `list` shows all sandboxes with a `*` marker on the active one.
241+
- `new` creates a sandbox and sets it as active.
242+
- `set` switches the active sandbox. Omit the ID to clear the active sandbox.
243+
- `read` prints the markdown content of the current sandbox.
244+
- `update` modifies the name or markdown of a sandbox (defaults to the active sandbox).
245+
- `run` runs a command with the hotdata CLI scoped to a sandbox. Creates a new sandbox unless a sandbox ID is provided before `run`. Useful for launching an agent that can only access sandbox data. Nesting sandboxes is not allowed.
250246

251247
## Configuration
252248

skills/hotdata/SKILL.md

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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.
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, inspect query run history, search tables, manage indexes, manage sandboxes, 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 query runs", "list past queries", "query history", "list sandboxes", "create a sandbox", "run a sandbox", or asks you to use the hotdata CLI.
44
version: 0.1.9
55
---
66

@@ -29,13 +29,12 @@ API URL defaults to `https://api.hotdata.dev/v1` or overridden via `HOTDATA_API_
2929

3030
All commands that accept `--workspace-id` are optional. If omitted, the active workspace is used. Use `hotdata workspaces set` to switch the active workspace interactively, or pass a workspace ID directly: `hotdata workspaces set <workspace_id>`. The active workspace is shown with a `*` marker in `hotdata workspaces list`. **Omit `--workspace-id` unless you need to target a specific workspace.**
3131

32-
## Multi-step workflows (Model, Library, History, Chain, Indexes)
32+
## Multi-step workflows (Model, History, Chain, Indexes)
3333

3434
These are **patterns** built from the commands below—not separate CLI subcommands:
3535

3636
- **Model** — Markdown semantic map of your workspace (entities, keys, joins). Refresh using `connections`, `connections refresh`, `tables list`, and `datasets list`. For a **deep** modeling pass (connector enrichment, indexes, per-table detail), see [references/MODEL_BUILD.md](references/MODEL_BUILD.md).
37-
- **Library** — Curated **`hotdata queries`** entries for repeatable SQL (`queries create`, `queries run`, …).
38-
- **History** — Find prior **`hotdata results`** and saved queries (`results list`, `results <id>`, `queries list`).
37+
- **History** — Inspect prior activity via `hotdata queries list` (query runs) and `hotdata results list` / `results <id>` (row data).
3938
- **Chain** — Follow-ups via **`datasets create`** then `query` against `datasets.main.<table>`.
4039
- **Indexes** — Review SQL and schema, compare to existing indexes, create **sorted**, **bm25**, or **vector** indexes when it clearly helps; see [references/WORKFLOWS.md](references/WORKFLOWS.md#indexes).
4140

@@ -215,21 +214,15 @@ hotdata results <result_id> [-w <workspace_id>] [-o table|json|csv]
215214
- Query output also includes a `result-id` in the footer (e.g. `[result-id: rslt...]`).
216215
- **Always use `results list` / `results <id>` to retrieve past query results rather than re-running the same query.** Re-running queries wastes resources and may return different results.
217216

218-
### Saved Queries
217+
### Query Run History
219218
```
220-
hotdata queries list [--limit <int>] [--offset <int>] [--format table|json|yaml]
221-
hotdata queries <query_id> [--format table|json|yaml]
222-
hotdata queries create --name "My Query" --sql "SELECT ..." [--description "..."] [--tags "tag1,tag2"] [--format table|json|yaml]
223-
hotdata queries update <query_id> [--name "New Name"] [--sql "SELECT ..."] [--description "..."] [--tags "tag1,tag2"] [--category "..."] [--table-size "..."] [--format table|json|yaml]
224-
hotdata queries run <query_id> [--format table|json|csv]
219+
hotdata queries list [--limit <int>] [--cursor <token>] [--status <csv>] [-o table|json|yaml]
220+
hotdata queries <query_run_id> [-o table|json|yaml]
225221
```
226-
- `list` shows saved queries with name, description, tags, and version.
227-
- View a query by ID to see its formatted and syntax-highlighted SQL.
228-
- `create` requires `--name` and `--sql`. Tags are comma-separated.
229-
- `update` accepts any combination of `--name`, `--sql`, `--description`, and `--tags` to change those fields.
230-
- `update` also supports `--category` and `--table-size` for metadata; pass an **empty string** for either flag to clear its value.
231-
- `run` executes a saved query and displays results like the `query` command.
232-
- **Use `queries run` instead of re-typing SQL when a saved query exists.**
222+
- `list` shows query runs with status, creation time, duration, row count, and a truncated SQL preview (default limit 20).
223+
- `--status` filters by run status (comma-separated, e.g. `--status running,failed`).
224+
- View a run by ID to see full metadata (timings, `result_id`, snapshot, hashes) and the formatted, syntax-highlighted SQL.
225+
- If a run has a `result_id`, fetch its rows with `hotdata results <result_id>`.
233226

234227
### Search
235228
```
@@ -276,38 +269,38 @@ hotdata auth status # Check current auth status
276269
hotdata auth logout # Remove saved auth for the default profile
277270
```
278271

279-
### Sessions
272+
### Sandboxes
280273

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.
274+
Sandboxes 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 sandbox are tied to that sandbox and will be removed when the sandbox ends.** If you need data to persist beyond the sandbox, create datasets outside of a sandbox context.
282275

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.**
276+
> **IMPORTANT: If `HOTDATA_SANDBOX` is set in the environment, you are inside an active sandbox. NEVER attempt to unset, override, or work around this variable. Do not clear it, do not start a new sandbox, do not run `sandbox run` or `sandbox new` or `sandbox set`. All your work should be attributed to the current sandbox. Attempting to nest or escape a sandbox will fail with an error.**
284277
285278
```
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...]
279+
hotdata sandbox list [-w <workspace_id>] [-o table|json|yaml]
280+
hotdata sandbox <sandbox_id> [-w <workspace_id>] [-o table|json|yaml]
281+
hotdata sandbox new [--name "Sandbox Name"] [-o table|json|yaml]
282+
hotdata sandbox set [<sandbox_id>]
283+
hotdata sandbox read
284+
hotdata sandbox update [<sandbox_id>] [--name "New Name"] [--markdown "..."] [-o table|json|yaml]
285+
hotdata sandbox run <cmd> [args...]
286+
hotdata sandbox <sandbox_id> run <cmd> [args...]
294287
```
295288

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.
289+
- `list` shows all sandboxes with a `*` marker on the active one.
290+
- `new` creates a sandbox and sets it as active. Blocked inside an existing sandbox.
291+
- `set` switches the active sandbox. Omit the ID to clear. Blocked inside an existing sandbox.
292+
- `read` prints the markdown content of the current sandbox. Use this to retrieve sandbox state at the start of work or between steps.
293+
- `update` modifies a sandbox's name or markdown. Defaults to the active sandbox if no ID is given. The `--markdown` field is for writing details about the work being done in the sandbox — observations, intermediate findings, next steps, etc. This state persists for the life of the sandbox and is the primary way to record context that should survive across commands or agent invocations within the sandbox.
294+
- `run` launches a command with `HOTDATA_SANDBOX` and `HOTDATA_WORKSPACE` set in the child process environment. Creates a new sandbox unless a sandbox ID is provided before `run`. Blocked inside an existing sandbox.
295+
- When inside a sandbox (HOTDATA_SANDBOX is set), all API requests automatically include the sandbox ID — no extra flags needed.
303296

304-
#### Example: Building a data model in a session
297+
#### Example: Building a data model in a sandbox
305298

306-
Use a session to explore tables and iteratively build a model description in the session markdown.
299+
Use a sandbox to explore tables and iteratively build a model description in the sandbox markdown.
307300

308-
1. Start a session:
301+
1. Start a sandbox:
309302
```
310-
hotdata sessions new --name "Model: sales pipeline"
303+
hotdata sandbox new --name "Model: sales pipeline"
311304
```
312305
2. Inspect tables and columns:
313306
```
@@ -318,9 +311,9 @@ Use a session to explore tables and iteratively build a model description in the
318311
hotdata query "SELECT DISTINCT status FROM sales.public.deals LIMIT 20"
319312
hotdata query "SELECT count(*), count(DISTINCT account_id) FROM sales.public.deals"
320313
```
321-
4. Write findings into the session markdown as you go:
314+
4. Write findings into the sandbox markdown as you go:
322315
```
323-
hotdata sessions update --markdown "## sales pipeline model
316+
hotdata sandbox update --markdown "## sales pipeline model
324317
325318
### deals (sales.public.deals)
326319
- PK: id
@@ -337,7 +330,7 @@ Use a session to explore tables and iteratively build a model description in the
337330
- check how line_items joins to deals
338331
- confirm revenue column semantics"
339332
```
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.
333+
5. Continue exploring and update the markdown as the model takes shape. The markdown is the living artifact — when the sandbox ends, its content captures what was learned.
341334

342335
Other commands (not covered in detail above): `hotdata connections new` (interactive connection wizard), `hotdata skills install|status`, `hotdata completions <bash|zsh|fish>`.
343336

skills/hotdata/references/DATA_MODEL.template.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ Stable `datasets.main.*` tables built for **Chain** workflows (not necessarily u
7676
|------------|------------|---------|-------------|
7777
| | | | |
7878

79-
## Saved query index (Library)
80-
81-
Link business questions to saved queries (ids/names from `hotdata queries list`):
82-
83-
| Question / report | Saved query name | ID (optional) |
84-
|-------------------|------------------|---------------|
85-
| | | |
86-
8779
## Notes
8880

8981
Assumptions, known gaps, and refresh checklist.

0 commit comments

Comments
 (0)