Repository navigation
Commit 0285a48
authored
refactor(cli)!: reorganize command surface (#263)
* refactor(cli)!: reorganize command surface
Collapse the top level from ~19 groups to 8 (auth, query, workspaces,
databases, jobs, ingest, search, manage) with a single canonical name
for every verb.
- Rename verbs: set→use, delete→remove, cancel→pause, runs→logs,
validate→test, create→add (sources), show→get (results).
- Fold `datasource` under `ingest sources`; absorb query/queries/results/
context/tables under `databases`; group usage/completions/upgrade/skills
under `manage`.
- Reshape search: `indexes` + the flag-based search + `embedding-providers`
become `search create|list|show|remove` + `search embeddings`, and the
action is `search "<text>" --index <name>` (index addressed by name via a
new `indexes::locate_by_name` resolver).
- Keep a top-level `query` shortcut into `databases query`.
- Remove `databases run`; delete the now-dead search-inference and
index-argument code and their tests.
BREAKING CHANGE: old command spellings are removed (no back-compat aliases).
Unit and integration tests updated for the new surface.
* docs: update README and agent skills for the reorganized CLI
Update every `hotdata …` command reference in the README and the bundled
agent skills to the new surface: the verb renames, the datasource→`ingest
sources` fold, the `search` reshape (indexes/flag-search/embedding-providers
→ `search …` + `search "<text>" --index`), and the `databases`/`manage`
re-parenting. Drop `databases run` references (command removed).
* fix(cli): restore dropped index/table capabilities; ID-based search db refs
Addresses review of #263.
Reintroduce capabilities the reshape had accidentally dropped (the shipped
skills still documented them):
- `search create --type sorted` — sorted indexes (mapped through in create()).
- `search create --dimensions/--output-column/--description` — the vector
auto-embed options (plumbed into indexes::create).
- `databases tables list --table/--limit/--cursor` and the no-active-database
workspace-wide listing (restores tables::list); the stale --cursor hint now
points at a flag that exists again.
Make search's by-name resolution reference the database by id, never a label
with fallback: locate_by_name requires a database (explicit --database, or the
active one) and carries the db's real default_connection_id (index API) and
default_catalog (search SQL). Fixes search remove/show/query failing with a
`__db_*` connection label when no active database is set. Adds --database/-d to
the search action, `search show`, and `search remove`.
Also fix stale --help/hint text: the context no-db hint now says
`databases context push`; drop the "also at top-level" parentheticals (only
`query` kept a shortcut); `--result-id` help says `hotdata databases results`;
README tables-list example.
* docs: document -d/--database on the search commands
* fix(search): scope index create to managed databases; guard sorted in run
Close the create/show/remove asymmetry the review flagged: `search create`
resolved any catalog `connections::resolve_connection_id` matched — including a
plain connection — while `search show`/`search remove` (via `locate_by_name`)
require a managed database. An index created on a connection was therefore
listable but neither showable nor removable, and top-level `indexes delete` is
gone in this PR, so it had no deletion path.
Indexes are a managed-database concept (connections are a legacy concept being
removed), so `create` now resolves `--from`'s catalog through
`databases::try_resolve_database` and uses the database's own
`default_connection_id`; a plain connection is rejected with a clear message.
create/show/remove now agree on managed databases.
Also guard `search run` against a `sorted` index (not a retrieval type) — it
previously fell into the vector branch and emitted an opaque `vector_distance`
error; it now points the user at `hotdata query`.
Docs: search SKILL notes indexes are managed-database only and adds the
`search show` command block.
* fix(search): use the active database directly for index create
`create` re-resolved `--from`'s catalog via `try_resolve_database` even for the
`schema.table` (active-database) path, where `parse_table` had already resolved
the database by id. After `hotdata databases fork`, the fork and its source
share a catalog alias, so that re-resolution returned "multiple databases have
catalog '<alias>' — use the database id instead", and the `unwrap_or_else(|_|
…)` masked it with a false "'<alias>' is not a managed database" message whose
suggested remedy (set an active database) was already done.
`parse_table` now returns the resolved database for the active-database path so
`create` uses it directly — no catalog re-resolution. Only an explicit
`catalog.schema.table` still resolves by catalog, and its own error (including
the ambiguous-fork-alias case) is surfaced as-is rather than replaced.
* fix(databases): restore -d/--database on context, queries, results
The reorg re-parented `context`/`queries`/`results` under `databases` but the
explicit database target regressed vs 0.26.0:
- `databases context {list,show,pull,push}` had no way to target a database —
active-database only.
- `databases queries list` / `databases results {get,list}` rejected `-d` after
the subcommand; the group-level `database` was only reachable before it
(`databases queries -d X list`), not the expected `... list -d X`.
Make the group `database` arg `global = true` on queries/results (the dispatch
already threads it), and add a `-d/--database` (global) to `context` wired into
its dispatch (explicit override, else the active database). Standardizes on
`--database` (the reorg's convention) rather than the old `--database-id`.
Verified: `context/queries/results list -d <db>` now byte-match the installed
0.26.0's `--database`/`--database-id` output.
* docs(skills): align context flag and index docs with the reorg
Follow-ups the review caught after the latest fixes:
- Context commands: docs said `--database-id`; the flag is now `--database`/`-d`
(SKILL.md, references/WORKFLOWS.md, references/DATA_MODEL.template.md). Left the
unrelated `ingest create --database-id` occurrences untouched.
- INDEXES.md / WORKFLOWS.md instructed creating a search index on a bare
catalog/connection, which `search create` now rejects (managed-database only);
point at attaching the catalog to a managed database first.
---------
Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>1 parent 51760b3 commit 0285a48
36 files changed
Lines changed: 1328 additions & 1414 deletions
File tree
- skills/hotdata
- references
- subskills
- analytics
- references
- geospatial
- search
- references
- src
- client
- commands
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
| 178 | + | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
| 196 | + | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
224 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
231 | 235 | | |
232 | | - | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
242 | | - | |
| 246 | + | |
243 | 247 | | |
244 | | - | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| |||
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
256 | | - | |
257 | | - | |
| 260 | + | |
| 261 | + | |
258 | 262 | | |
259 | | - | |
| 263 | + | |
260 | 264 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
266 | 270 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
270 | 274 | | |
271 | 275 | | |
272 | 276 | | |
| |||
0 commit comments