Commit 43c15be
committed
feat: interactive field editor, document name resolution, and REPL enhancements
Major improvements to the interactive mutation workflow and overall CLI usability:
**Field-by-field mutation editor** (field_editor.rs):
- Replaces raw JSON input with per-field prompts using live __type introspection
- Pre-populates current document values as defaults via stateJSON
- Supports nested objects, enums (select picker), arrays (add/remove/replace), booleans
- Schema-aware GraphQL serialization (unquoted enum values)
- Confirmation preview showing only changed fields before executing
**Document name resolution**:
- docs get, delete, mutate, and ops now accept document names (not just UUIDs)
- New resolve_doc() helper searches all drives for matching name or UUID
- Case-insensitive name matching with fallback per-drive queries
**Drive auto-detection and selection**:
- --drive is now optional in docs list, docs get, docs tree, docs create, mutate, and ops
- Interactive drive picker (select_drive helper) when --drive is omitted
- docs list without --drive aggregates documents across all drives with Drive column
**Drives improvements**:
- drives list shows Editor column (preferredEditor metadata)
- drives get shows Editor field in detail view
- drives create uses a drive type picker queried from existing drives
**Operations (ops) improvements**:
- Shows operation input data (action.input or inputText) instead of hash
- Tries multiple query formats: paginated with action, flat with action, flat basic
- Auto-detects drive from document name/UUID
**REPL enhancements** (interactive.rs):
- Tab completion for document names/IDs, profile names, drive slugs, model types
- Animated loading spinner during API queries with immediate first-frame display
- Cursor visibility fix after dialoguer widgets hide it
- Visual command separators (dimmed header lines) before each command's output
- Guide topics work as bare commands (e.g., "overview" instead of "guide overview")
- Profile switching via config use rebuilds client and refreshes all completions
- Auto-refresh document completions after doc-modifying commands (create/delete/mutate)
- Circular tab completion mode for cycling through matches
**Config**:
- Added profile_names() helper for tab completion1 parent ce4ba65 commit 43c15be
11 files changed
Lines changed: 1644 additions & 231 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
340 | 344 | | |
341 | 345 | | |
342 | | - | |
343 | | - | |
344 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
345 | 349 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
449 | 453 | | |
450 | 454 | | |
451 | 455 | | |
452 | | - | |
| 456 | + | |
453 | 457 | | |
454 | | - | |
455 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
| |||
0 commit comments