maybeai-sheet-cli 0.13.0__tar.gz → 0.13.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/.gitignore +1 -0
  2. maybeai_sheet_cli-0.13.2/PKG-INFO +593 -0
  3. maybeai_sheet_cli-0.13.2/README.md +569 -0
  4. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/pyproject.toml +10 -2
  5. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/__init__.py +1 -1
  6. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/chart_config.py +59 -0
  7. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/chart_style_summary.py +461 -0
  8. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/cli.py +32 -0
  9. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/client.py +54 -4
  10. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/_phase2.py +331 -0
  11. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/cell.py +45 -0
  12. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/chart.py +317 -0
  13. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/column.py +221 -0
  14. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/dashboard.py +678 -0
  15. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/db_table.py +997 -0
  16. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/excel_table.py +391 -0
  17. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/excel_worksheet.py +655 -0
  18. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/file.py +135 -0
  19. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/formula.py +216 -0
  20. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/history.py +104 -0
  21. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/image.py +505 -0
  22. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/range.py +301 -0
  23. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/row.py +170 -0
  24. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/share.py +344 -0
  25. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/commands/sheet.py +208 -6
  26. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/style.py +587 -0
  27. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/table.py +112 -0
  28. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/workbook.py +608 -0
  29. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/commands/worksheet.py +255 -0
  30. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/dashboard_interactions.py +98 -0
  31. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/dashboard_plan.py +398 -0
  32. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/endpoints.py +207 -0
  33. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/errors.py +2 -0
  34. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/formatters.py +12 -1
  35. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/models/share.py +47 -0
  36. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/protocol.py +23 -0
  37. maybeai_sheet_cli-0.13.2/src/maybeai_sheet/table_resolver.py +572 -0
  38. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/update.py +2 -2
  39. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/build_fixtures.py +213 -0
  40. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/flat-records.xlsx +0 -0
  41. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/mixed-engine.xlsx +0 -0
  42. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/multi-table-layout.xlsx +0 -0
  43. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/rows.json +12 -0
  44. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/simple-grid.xlsx +0 -0
  45. maybeai_sheet_cli-0.13.2/tests/fixtures/benchmarks/simple-values.json +17 -0
  46. maybeai_sheet_cli-0.13.2/tests/test_benchmark_runner.py +154 -0
  47. maybeai_sheet_cli-0.13.2/tests/test_cli.py +1294 -0
  48. maybeai_sheet_cli-0.13.2/tests/test_dashboard_plan.py +558 -0
  49. maybeai_sheet_cli-0.13.2/tests/test_endpoints.py +150 -0
  50. maybeai_sheet_cli-0.13.2/tests/test_phase2_cli.py +2778 -0
  51. maybeai_sheet_cli-0.13.2/tests/test_two_engine_cli.py +1320 -0
  52. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/tests/test_update.py +2 -1
  53. maybeai_sheet_cli-0.13.0/CLAUDE.md +0 -46
  54. maybeai_sheet_cli-0.13.0/PKG-INFO +0 -171
  55. maybeai_sheet_cli-0.13.0/README.md +0 -147
  56. maybeai_sheet_cli-0.13.0/cli-packaging-plan.md +0 -279
  57. maybeai_sheet_cli-0.13.0/cli-plan.md +0 -389
  58. maybeai_sheet_cli-0.13.0/docs/verification-matrix-fallback.md +0 -35
  59. maybeai_sheet_cli-0.13.0/src/maybeai_sheet/commands/workbook.py +0 -223
  60. maybeai_sheet_cli-0.13.0/tests/test_cli.py +0 -543
  61. maybeai_sheet_cli-0.13.0/uv.lock +0 -416
  62. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/commands/__init__.py +0 -0
  63. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/commands/raw.py +0 -0
  64. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/config.py +0 -0
  65. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/models/__init__.py +0 -0
  66. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/models/sheet.py +0 -0
  67. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/models/workbook.py +0 -0
  68. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/options.py +0 -0
  69. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/src/maybeai_sheet/resolver.py +0 -0
  70. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/tests/test_formatters.py +0 -0
  71. {maybeai_sheet_cli-0.13.0 → maybeai_sheet_cli-0.13.2}/tests/test_resolver.py +0 -0
@@ -23,3 +23,4 @@ temp
23
23
  .clauderc.json
24
24
  docs_requirement
25
25
  artifacts/
26
+ .worktrees/
@@ -0,0 +1,593 @@
1
+ Metadata-Version: 2.4
2
+ Name: maybeai-sheet-cli
3
+ Version: 0.13.2
4
+ Summary: CLI for common MaybeAI spreadsheet operations
5
+ Project-URL: Homepage, https://github.com/OmniMCP-AI/maybeai-sheet-cli
6
+ Project-URL: Repository, https://github.com/OmniMCP-AI/maybeai-sheet-cli
7
+ Project-URL: Issues, https://github.com/OmniMCP-AI/maybeai-sheet-cli/issues
8
+ Author: OmniMCP-AI
9
+ License: Proprietary
10
+ Keywords: cli,excel,maybeai,spreadsheet
11
+ Classifier: Environment :: Console
12
+ Classifier: License :: Other/Proprietary License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: httpx<1,>=0.27
19
+ Requires-Dist: pydantic<3,>=2.7
20
+ Requires-Dist: pyyaml<7,>=6
21
+ Requires-Dist: rich<14,>=13.7
22
+ Requires-Dist: typer<1,>=0.12
23
+ Description-Content-Type: text/markdown
24
+
25
+ # maybeai-sheet-cli
26
+
27
+ CLI for MaybeAI spreadsheet operations.
28
+
29
+ `mbs` wraps the MaybeAI spreadsheet HTTP APIs behind a stable command-line interface for humans, CI jobs, and agents.
30
+
31
+ ## Install
32
+
33
+ On Debian/Ubuntu and other **PEP 668** systems, do **not** use bare `pip install` on system Python. Use **pipx** (recommended for CLIs):
34
+
35
+ ```bash
36
+ sudo apt install -y pipx python3-venv
37
+ pipx ensurepath
38
+ # re-login or: source ~/.bashrc
39
+
40
+ pipx install maybeai-sheet-cli
41
+ mbs --version
42
+ ```
43
+
44
+ For local venvs or macOS/dev machines, plain pip is fine:
45
+
46
+ ```bash
47
+ pip install maybeai-sheet-cli
48
+ ```
49
+
50
+ Upgrade to the latest release:
51
+
52
+ ```bash
53
+ mbs update # when installed via pip or pipx
54
+ pipx upgrade maybeai-sheet-cli # alternative on pipx installs
55
+ ```
56
+
57
+ Install a specific version:
58
+
59
+ ```bash
60
+ mbs update --version 0.3.2
61
+ pipx install maybeai-sheet-cli==0.3.2 --force # pipx reinstall pin
62
+ ```
63
+
64
+ Uninstall:
65
+
66
+ ```bash
67
+ pipx uninstall maybeai-sheet-cli
68
+ # not: pip uninstall -U (-U is invalid for uninstall)
69
+ ```
70
+
71
+ ## Requirements
72
+
73
+ - Python 3.10+
74
+ - `MAYBEAI_API_TOKEN`
75
+
76
+ ## Configure
77
+
78
+ Set your API token:
79
+
80
+ ```bash
81
+ export MAYBEAI_API_TOKEN="YOUR_TOKEN"
82
+ ```
83
+
84
+ Optional global flags:
85
+
86
+ - `--base-url` to point at a different MaybeAI API host
87
+ - `--output json|table|yaml`
88
+ - `--timeout <seconds>`
89
+ - `--verbose`
90
+
91
+ Alias note:
92
+
93
+ - Prefer nested worksheet media/layout commands such as `mbs excel-worksheet style ...`
94
+ - The CLI also exposes compatibility shortcuts `mbs style ...`, `mbs image ...`,
95
+ `mbs chart ...`, and `mbs dashboard ...` for the same command groups
96
+
97
+ ## Quick Start
98
+
99
+ The examples below follow the target protocol names.
100
+
101
+ List user-visible workbooks:
102
+
103
+ ```bash
104
+ mbs workbook list-user-workbooks --limit 20
105
+ ```
106
+
107
+ Read a worksheet:
108
+
109
+ ```bash
110
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Sheet1
111
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Sheet1 --range A1:H1
112
+ ```
113
+
114
+ List worksheets:
115
+
116
+ ```bash
117
+ mbs workbook list-worksheets --doc-id abc123
118
+ ```
119
+
120
+ Inspect the first worksheet-backed table:
121
+
122
+ ```bash
123
+ mbs excel-table metadata --doc-id abc123 --worksheet-name Sheet1 --table-id 1
124
+ ```
125
+
126
+ Create a workbook:
127
+
128
+ ```bash
129
+ mbs workbook create --title "Board Pack"
130
+ ```
131
+
132
+ Import a workbook-style `.xlsx` through the default Excelize path:
133
+
134
+ ```bash
135
+ mbs workbook import ./report.xlsx
136
+ ```
137
+
138
+ Import a large table-like `.xlsx` into SheetTable/PG:
139
+
140
+ ```bash
141
+ mbs workbook import ./large-table.xlsx --engine postgres
142
+ ```
143
+
144
+ Import a mixed workbook and let the backend select engines per worksheet:
145
+
146
+ ```bash
147
+ mbs workbook import ./mixed-workbook.xlsx --engine auto
148
+ mbs workbook import ./mixed-workbook.xlsx --engine "postgres,excel,excel,postgres"
149
+ ```
150
+
151
+ Append rows and verify:
152
+
153
+ ```bash
154
+ mbs excel-table insert --doc-id abc123 --worksheet-name Sheet1 --table-id 1 --rows rows.json --verify
155
+ ```
156
+
157
+ Grant workbook access:
158
+
159
+ ```bash
160
+ mbs share create --doc-id abc123 --email teammate@example.com --role viewer
161
+ ```
162
+
163
+ Rename a worksheet and inspect a destructive row delete before sending it:
164
+
165
+ ```bash
166
+ mbs excel-worksheet rename --doc-id abc123 --worksheet-name Old --new-name New
167
+ mbs excel-worksheet row delete --doc-id abc123 --worksheet-name Sheet1 --row 10 --dry-run
168
+ mbs excel-worksheet row delete --doc-id abc123 --worksheet-name Sheet1 --row 10 --yes
169
+ ```
170
+
171
+ Search, style, inspect history, and export:
172
+
173
+ ```bash
174
+ mbs excel-worksheet range search --doc-id abc123 --worksheet-name Sheet1 --query revenue --max-results 20
175
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Sheet1 --range B14:D14 --format tree
176
+ mbs excel-worksheet style freeze-panes --doc-id abc123 --worksheet-name Sheet1 --cell B2
177
+ mbs excel-worksheet style worksheet plan --doc-id abc123 --worksheet-name Sheet1 --mode auto_detect --spec worksheet_style.json
178
+ mbs excel-worksheet style worksheet apply --doc-id abc123 --worksheet-name Sheet1 --mode auto_detect --spec worksheet_style.json
179
+ mbs excel-worksheet image list --doc-id abc123 --worksheet-name Dashboard
180
+ mbs excel-worksheet chart list --doc-id abc123 --worksheet-name Dashboard
181
+ mbs excel-worksheet dashboard manifest --doc-id abc123 --worksheet-name Dashboard
182
+ mbs workbook calculate --doc-id abc123
183
+ mbs excel-worksheet calculate --doc-id abc123 --worksheet-name Sheet1
184
+ mbs excel-worksheet range calculate --doc-id abc123 --worksheet-name Sheet1 --cell E2 --formula "=SUM(B2:D2)"
185
+ mbs version list --doc-id abc123 --limit 10
186
+ mbs workbook export --doc-id abc123 --out workbook.xlsx
187
+ ```
188
+
189
+ The worksheet media/layout groups are available in both forms:
190
+
191
+ ```bash
192
+ mbs excel-worksheet chart list --doc-id abc123 --worksheet-name Dashboard
193
+ mbs chart list --doc-id abc123 --worksheet-name Dashboard
194
+ ```
195
+
196
+ Prefer the nested `excel-worksheet ...` form in docs and agent prompts when you
197
+ want the object model to stay explicit.
198
+
199
+ For chart specs authored as `type: "json"`, keep metadata `title` when the chart
200
+ needs an internal or custom-rendered title, and hide the visible container title
201
+ with `hide_title: true` or `spec.style.showContainerTitle: false` rather than
202
+ deleting `title`.
203
+
204
+ ## Relationship
205
+ 1 workbok
206
+ | \
207
+ N db_worksheet(PG) N excel_worksheets
208
+ | \
209
+ M(N>1) db_worksheet(db_table) J(<N) excel_table
210
+
211
+ CLI command names normalize these relationship labels to hyphenated groups:
212
+ `excel_worksheet` becomes `excel-worksheet`, `excel_table` becomes
213
+ `excel-table`, and `db_worksheet(db_table)` becomes `db-table`.
214
+
215
+
216
+ ## Full Command Tree
217
+
218
+ The reviewed tree below is the source of truth for the protocol shape. Product
219
+ model labels in this block use underscores; CLI names in examples and future
220
+ router code should normalize them to hyphenated command groups such as
221
+ `excel-worksheet`, `excel-table`, and `db-table`. This tree includes
222
+ implemented, planned, deferred, and not-recommended command surfaces.
223
+
224
+ Status legend for the full tree:
225
+
226
+ - `NOW`: released in the current CLI under this command shape.
227
+ - `API`: route exists or is expected, but the target command wrapper/refactor is
228
+ not released under this shape yet.
229
+ - `PG`: SheetTable/PG-specific; defer until exposed through the public API.
230
+ - `PLAN`: needs a backend/product contract before implementation.
231
+ - `DEFER`: intentionally not part of the clean agent-first surface yet.
232
+ - `SKIP`: not recommended for this CLI.
233
+
234
+ ```text
235
+ mbs
236
+ ├── update
237
+ │ └── Update maybeai-sheet-cli from PyPI.
238
+
239
+ ├── workbook
240
+ │ ├── metadata API Inspect workbook profile and routing metadata.(workshets)
241
+ │ ├── source PLAN Similar to NotebookLM source (menu on the left).
242
+ │ ├── create NOW Create a new workbook.
243
+ │ ├── create-from-file NOW Import an .xlsx file.
244
+ │ ├── import NOW Preferred alias for create-from-file.
245
+ │ ├── list-user-workbooks API List user workbooks with bounded output.
246
+ │ ├── list-worksheets API List worksheets, including engine.
247
+ │ ├── search NOW Search user workbooks with bounded output.
248
+ │ ├── calculate NOW Recalculate formulas across the workbook.
249
+ │ ├── export API Export workbook bytes.
250
+ │ ├── copy API Copy a workbook.
251
+ │ ├── upload API Upload a file through workbook import flow.
252
+ │ ├── update API Update a stored workbook file not change doc_id
253
+ │ ├── export API Export workbook bytes to --out.
254
+ │ ├── delete API Delete a stored file.
255
+ │ └── rename API Rename a stored file.
256
+
257
+ ├── excel_worksheet
258
+ │ ├── read API Read the full range of the worksheet.
259
+ │ ├── check-error API Read worksheet cells and scan for formula-style errors.
260
+ │ ├── calculate NOW Recalculate formulas in one worksheet.
261
+ │ ├── list-table API Detect content-backed tables in a worksheet.
262
+ │ ├── create API Create a worksheet, optionally with starter values.
263
+ │ ├── update API Update worksheet metadata.
264
+ │ ├── sample PLAN Return bounded worksheet/range sample rows.
265
+ │ ├── delete API Delete a worksheet; requires --yes unless --dry-run.
266
+ │ ├── rename API Rename a worksheet.
267
+ │ ├── move API Move a worksheet to a zero-based index.
268
+ │ ├── copy API Copy a worksheet.
269
+ │ └── metadata API Include table meta: range, header, table id, data summary.
270
+
271
+ ├── excel_table
272
+ │ ├── create PLAN Create a table view from a worksheet range.
273
+ │ ├── update PLAN Update table view metadata or range.
274
+ │ ├── delete PLAN Delete a table view; requires --yes unless --dry-run.
275
+ │ ├── schema API Infer table schema from a resolved table range.
276
+ │ ├── sample API Return bounded table sample rows.
277
+ │ ├── read API Read header-aware table rows.
278
+ │ ├── insert API Insert table rows.
279
+ │ └── metadata API Include table meta: range, header, table id, data summary.
280
+
281
+ ├── excel_worksheet range
282
+ │ ├── read API Read a bounded A1 range.
283
+ │ ├── write API Write a JSON matrix into an A1 range.
284
+ │ ├── clear API Clear an A1 range.
285
+ │ ├── read-many DEFER Legacy alias only until a real batch API exists.
286
+ │ ├── copy API Copy a range.
287
+ │ ├── search API Search a worksheet with bounded results.
288
+ │ ├── used-range PLAN Return worksheet used range after a routed contract exists.
289
+ │ ├── set-formula API Set one formula cell.
290
+ │ ├── calculate API Calculate one formula cell.
291
+ │ └── lineage API Trace cell/range lineage.
292
+
293
+ ├── db_worksheet(AKA db_table)
294
+ │ ├── create API Create a PG-backed table from JSON row data.
295
+ │ ├── create-from-query API Calculate SQL and create a PG-backed table from tabular results.
296
+ │ ├── update PLAN Update PG-backed rows from JSON row data.
297
+ │ ├── delete PLAN Delete PG-backed rows/table; requires --yes unless --dry-run.
298
+ │ ├── schema API Infer table schema from a bounded PG read.
299
+ │ ├── sample API Return bounded table sample rows.
300
+ │ ├── read API Read PG-backed table rows.
301
+ │ ├── insert API Insert PG-backed table rows.
302
+ │ └── metadata API Include table meta, backend id, schema, and data summary.
303
+
304
+ ├── excel_worksheet row
305
+ │ ├── insert API Insert rows.
306
+ │ ├── delete API Delete rows; requires --yes unless --dry-run.
307
+ │ └── move API Move rows.
308
+
309
+ ├── excel_worksheet column
310
+ │ ├── insert API Insert columns.
311
+ │ ├── delete API Delete columns; requires --yes unless --dry-run.
312
+ │ ├── move API Move columns.
313
+ │ ├── width API Set column width.
314
+ │ └── append API Append columns.
315
+
316
+ ├── excel_worksheet chart
317
+ │ ├── list NOW List charts in one worksheet.
318
+ │ ├── get NOW Read one chart spec and source binding.
319
+ │ ├── preview PLAN Preview one chart from its spec/source binding.
320
+ │ ├── create-config NOW Create one chart from a chart spec.
321
+ │ ├── update NOW Update one chart from a chart spec.
322
+ │ ├── refresh PLAN Refresh one chart from its current source binding.
323
+ │ └── delete NOW Delete one chart.
324
+
325
+ ├── excel_worksheet dashboard
326
+ │ ├── manifest NOW Aggregate worksheet metadata and chart inventory for one dashboard sheet.
327
+ │ ├── create-config NOW Create a dashboard worksheet and compose charts from one spec.
328
+ │ ├── validate NOW Validate dashboard layout, worksheet target, and chart source fields locally.
329
+ │ └── refresh NOW Upsert dashboard charts from one spec and re-verify chart inventory.
330
+
331
+
332
+ ├── excel-worksheet style
333
+ │ ├── cell batch-set NOW Apply cell style batches from JSON.
334
+ │ ├── columns-width NOW Set column widths.
335
+ │ ├── rows-height NOW Set row heights.
336
+ │ ├── freeze-panes NOW Freeze rows/columns using an A1 boundary.
337
+ │ ├── gridlines toggle NOW Toggle worksheet gridlines.
338
+ │ ├── auto-filter set NOW Set worksheet auto-filter range.
339
+ │ ├── auto-filter remove NOW Remove worksheet auto-filter.
340
+ │ ├── filter-values NOW Apply filter values.
341
+ │ ├── conditional-formats set NOW Set conditional formatting rules.
342
+ │ ├── worksheet plan NOW Generate a worksheet styling plan.
343
+ │ └── worksheet apply NOW Apply a worksheet styling plan.
344
+
345
+ ├── excel_worksheet image
346
+ │ ├── list NOW List worksheet images from worksheet formatting metadata.
347
+ │ ├── read NOW Read one worksheet image by cell or picture id.
348
+ │ ├── replace NOW Replace one worksheet image in place.
349
+ │ ├── insert NOW Add an image file.
350
+ │ └── delete NOW Delete an image.
351
+
352
+ ├── version
353
+ │ ├── list API List workbook history with bounded output.
354
+ │ └── restore PLAN Restore a workbook history version after a routed contract exists.
355
+
356
+
357
+ ├── share
358
+ │ ├── create API Create or grant sharing access.
359
+ │ ├── remove API Remove a user's access.
360
+ │ └── modify API Modify sharing access.
361
+ ```
362
+
363
+ Full tree examples:
364
+
365
+ These examples cover every top-level category. Commands marked `API`, `PLAN`,
366
+ `PG`, or `DEFER` show the intended CLI shape, but are not guaranteed to be
367
+ available until their status moves to `NOW`. They use hyphenated CLI command
368
+ names even when the reviewed protocol tree uses underscore model labels.
369
+
370
+ ```bash
371
+ # update
372
+ mbs update --check
373
+
374
+ # workbook
375
+ mbs workbook metadata --doc-id abc123 # API
376
+ mbs workbook list-user-workbooks --limit 20 # API
377
+ mbs workbook list-worksheets --doc-id abc123 # API
378
+ mbs workbook export --doc-id abc123 --out workbook.xlsx # API
379
+ mbs workbook copy --doc-id abc123 --name "Budget Copy" # API
380
+ mbs workbook delete --doc-id abc123 --dry-run # API
381
+
382
+ # excel-worksheet
383
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Actuals # API
384
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Actuals --range A1:D20 # API
385
+ mbs excel-worksheet check-error --doc-id abc123 --worksheet-name Model --range B2:H80 # API
386
+ mbs excel-worksheet create --doc-id abc123 --name Actuals # API
387
+ mbs excel-worksheet update --doc-id abc123 --worksheet-name Actuals --title "Actuals FY26" # API
388
+ mbs excel-worksheet metadata --doc-id abc123 --worksheet-name Actuals # API
389
+ mbs excel-worksheet list-table --doc-id abc123 --gid 3 # API
390
+ mbs excel-worksheet sample --doc-id abc123 --worksheet-name Actuals --range A1:Z5000 --limit 50 # PLAN
391
+
392
+ # excel-worksheet range
393
+ mbs excel-worksheet range read --doc-id abc123 --worksheet-name Actuals --range A1:D20 # API, advanced structured alias
394
+ mbs excel-worksheet range used-range --doc-id abc123 --worksheet-name Actuals # PLAN
395
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Model --range B14:D14 --format tree # API
396
+
397
+ # excel-table
398
+ mbs excel-table metadata --doc-id abc123 --worksheet-name Orders --table-id 1 # API
399
+ mbs excel-table schema --doc-id abc123 --worksheet-name Orders --table-id 1 # API
400
+ mbs excel-table sample --doc-id abc123 --worksheet-name Orders --table-id 1 --limit 50 # API
401
+ mbs excel-table read --doc-id abc123 --worksheet-name Orders --table-id 1 --limit 50 # API
402
+ mbs excel-table insert --doc-id abc123 --worksheet-name Orders --table-id 1 --rows rows.json # API
403
+ mbs excel-table style columns-width --doc-id abc123 --worksheet-name Orders --table-id 1 --column B --width 120 # API
404
+
405
+ # db-table
406
+ mbs db-table metadata --doc-id abc123 --name orders-large # API
407
+ mbs db-table schema --doc-id abc123 --name orders-large # API
408
+ mbs db-table sample --doc-id abc123 --name orders-large --limit 50 # API
409
+ mbs db-table read --doc-id abc123 --name orders-large --limit 100 --offset 200 # API
410
+ mbs db-table insert --doc-id abc123 --name orders-large --rows rows.json # API
411
+ mbs db-table create --doc-id abc123 --name Orders --rows orders.json # API
412
+ mbs db-table create-from-query --doc-id abc123 --name OrderSummary --sql-file order_summary.sql # API
413
+ mbs db-table update --doc-id abc123 --name Orders --key order_id --rows orders_patch.json # PLAN
414
+ mbs db-table update --doc-id abc123 --name Orders --row-index 42 --rows row_patch.json # PLAN
415
+ mbs db-table update --doc-id abc123 --name Orders --where '{"status":"open"}' --rows status_patch.json # PLAN
416
+ mbs db-table update --doc-id abc123 --name Orders --column-index 3 --column-name status # PLAN
417
+ mbs db-table delete --doc-id abc123 --name Orders --where '{"order_id":"A1"}' --yes # PLAN
418
+ mbs db-table delete --doc-id abc123 --name Orders --row-index 42 --count 10 --yes # PLAN
419
+ mbs db-table delete --doc-id abc123 --name Orders --column-index 3 --yes # PLAN
420
+ mbs db-table delete --doc-id abc123 --name Orders --column-name status --yes # PLAN
421
+
422
+ # row
423
+ mbs excel-worksheet row insert --doc-id abc123 --worksheet-name Actuals --row 10 --count 2 # API
424
+
425
+ # column
426
+ mbs excel-worksheet column width --doc-id abc123 --worksheet-name Actuals --column B --width 120 # API
427
+ mbs excel-worksheet column append --doc-id abc123 --worksheet-name Actuals --values columns.json # API
428
+
429
+ # cell
430
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Model --range B14:D14 --format tree # API
431
+
432
+ # formula
433
+ mbs workbook calculate --doc-id abc123 # API
434
+ mbs excel-worksheet calculate --doc-id abc123 --worksheet-name Model # API
435
+ mbs excel-worksheet range calculate --doc-id abc123 --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)" # API
436
+ mbs excel-worksheet range set-formula --doc-id abc123 --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)" # API
437
+
438
+ # chart
439
+ mbs excel-worksheet chart list --doc-id abc123 --worksheet-name Dashboard # NOW
440
+ mbs excel-worksheet chart get --doc-id abc123 --worksheet-name Dashboard --cell J2 # NOW
441
+ mbs excel-worksheet chart create-config --doc-id abc123 --worksheet-name Dashboard --cell J2 --spec chart.json # NOW
442
+ mbs excel-worksheet chart update --doc-id abc123 --worksheet-name Dashboard --cell J2 --chart-id rId1 --spec chart.json # NOW
443
+ mbs excel-worksheet chart delete --doc-id abc123 --worksheet-name Dashboard --chart-id rId1 # NOW
444
+
445
+ # recommended chart.json shape
446
+ # prefer top-level `"type": "json"` and put the renderer in `html`
447
+ # do not treat `"type": "line"` / `"bar"` / `"pie"` as the default authored form
448
+ # {
449
+ # "type": "json",
450
+ # "sql": "select Month, Revenue from Sheet1",
451
+ # "title": "Monthly Revenue",
452
+ # "legend": "bottom",
453
+ # "html": "{ library: 'echarts', handler: (data) => ({ xAxis: { type: 'category', data: data.map(r => r.Month) }, yAxis: { type: 'value' }, series: [{ type: 'line', data: data.map(r => Number(r.Revenue) || 0) }] }) }",
454
+ # "spec": { "style": { "title": "Monthly Revenue" } }
455
+ # }
456
+
457
+ # dashboard
458
+ mbs excel-worksheet dashboard validate --spec dashboard.json # NOW
459
+ mbs excel-worksheet dashboard manifest --doc-id abc123 --worksheet-name Dashboard # NOW
460
+ mbs excel-worksheet dashboard create-config --doc-id abc123 --spec dashboard.json --create-worksheet # NOW
461
+ mbs excel-worksheet dashboard refresh --doc-id abc123 --spec dashboard.json # NOW
462
+
463
+ # recommended dashboard.json chart entries
464
+ # {
465
+ # "worksheet_name": "Dashboard",
466
+ # "charts": [
467
+ # {
468
+ # "cell": "J2",
469
+ # "chart": {
470
+ # "type": "json",
471
+ # "sql": "select Month, Revenue from Sheet1",
472
+ # "title": "Monthly Revenue",
473
+ # "legend": "bottom",
474
+ # "html": "{ library: 'echarts', handler: (data) => ({ xAxis: { type: 'category', data: data.map(r => r.Month) }, yAxis: { type: 'value' }, series: [{ type: 'line', data: data.map(r => Number(r.Revenue) || 0) }] }) }"
475
+ # }
476
+ # }
477
+ # ]
478
+ # }
479
+
480
+ # style
481
+ mbs excel-worksheet style freeze-panes --doc-id abc123 --worksheet-name Actuals --cell B2 # NOW
482
+ mbs excel-worksheet style cell batch-set --doc-id abc123 --worksheet-name Actuals --range A1:G1 --style header_style.json # NOW
483
+ mbs excel-worksheet style conditional-formats set --doc-id abc123 --worksheet-name Actuals --spec conditional_formats.json # NOW
484
+ mbs excel-worksheet style worksheet apply --doc-id abc123 --worksheet-name Actuals --mode auto_detect --spec worksheet_style.json # NOW
485
+
486
+ # image
487
+ mbs excel-worksheet image list --doc-id abc123 --worksheet-name Dashboard # NOW
488
+ mbs excel-worksheet image read --doc-id abc123 --worksheet-name Dashboard --cell A1 --out logo.png # NOW
489
+ mbs excel-worksheet image insert --doc-id abc123 --worksheet-name Dashboard --cell A1 --file logo.png # NOW
490
+ mbs excel-worksheet image replace --doc-id abc123 --worksheet-name Dashboard --cell A1 --file logo_v2.png # NOW
491
+ mbs excel-worksheet image delete --doc-id abc123 --worksheet-name Dashboard --cell A1 # NOW
492
+
493
+ # version
494
+ mbs version list --doc-id abc123 --limit 10 # API
495
+ mbs version restore --doc-id abc123 --version-id v42 --dry-run # PLAN
496
+
497
+ # share
498
+ mbs share create --doc-id abc123 --email teammate@example.com --role viewer # API
499
+ ```
500
+
501
+ `db-table read`, `schema`, and `sample` keep reads bounded. The default read
502
+ limit is 100 rows, and `--limit` / `--offset` are capped at 10,000 to avoid
503
+ accidental large PG scans. `db-table create-from-query` is CLI-composed: it
504
+ calculates a tabular `=SQL(...)` result through `calc-formula`, then creates a
505
+ PG/SheetTable-backed table through `db_table/create`. Use a keyset-style backend
506
+ contract for deeper pagination when it becomes available.
507
+
508
+ Refactor planning is tracked separately from this README:
509
+ `docs/superpowers/plans/2026-07-01-mbs-two-engine-command-refactor.md`.
510
+
511
+ Not recommended as first-class CLI commands:
512
+
513
+ ```text
514
+ validation create/update/delete PLAN
515
+ protection protect/unprotect PLAN
516
+ sort range/table PLAN
517
+ comment create/update/delete PLAN
518
+ named-range create/update/delete PLAN
519
+ macro/vba SKIP
520
+ power-query SKIP
521
+ power-pivot SKIP
522
+ workbook diff PLAN
523
+ dependency graph beyond cell lineage PLAN
524
+ ```
525
+
526
+ Relationship guide:
527
+
528
+ - Use `workbook` for file-level creation, upload/import, and manifest checks.
529
+ - Use `excel-worksheet read` for full worksheet used-range inspection.
530
+ - Use `excel-worksheet` for Excel tab lifecycle operations.
531
+ - Use `excel-worksheet range` for coordinate-based reads, writes, formulas, and
532
+ cell lineage.
533
+ - Use `excel-table` for worksheet-backed table views. One Excel worksheet can
534
+ contain multiple tables, so workbook metadata should expose simple ordinal
535
+ table ids such as `1`, `2`, `3`, and `4`, each mapped to the real worksheet
536
+ range behind the scenes. `excel-table` commands should accept optional
537
+ `--table-id`; when omitted, the CLI should default to `--table-id 1` only
538
+ inside an unambiguous worksheet target.
539
+ - Use `db-table` for PG/SheetTable-backed tables. These are not worksheet
540
+ ranges, so prefer human-readable `--name` or backend ids instead of worksheet
541
+ `--table-id`.
542
+ - Use `excel-worksheet row` and `excel-worksheet column` for structural
543
+ row/column changes.
544
+ - Use `excel-worksheet style` for worksheet layout operations like freeze
545
+ panes, filter ranges, widths, heights, gridlines, conditional formats, and
546
+ worksheet style planning/apply.
547
+ - Use `excel-worksheet chart` for list/get/create/update/delete of individual
548
+ source-backed visualizations.
549
+ - Use `excel-worksheet dashboard` for local validation and worksheet-level chart
550
+ orchestration such as manifest, create-config, and refresh.
551
+ - Use `excel-worksheet image` for list/read/insert/replace/delete image
552
+ workflows.
553
+ - Use `version` for workbook history inspection and restore.
554
+ - Use `share` for visibility and collaborator access.
555
+
556
+ Targeting notes:
557
+
558
+ - Most commands accept `--doc-id`, `--url`, or `--uri`.
559
+ - Prefer `--worksheet-name` when the backend route supports names.
560
+ - Use `--table-id` when operating on an `excel-table`. It is a simple ordinal
561
+ from workbook metadata, for example `--table-id 1`, and maps internally to
562
+ table metadata such as `worksheet_name` and `range`.
563
+ - Use `--name` or backend ids when operating on a `db-table`.
564
+ - Use `--gid` only when a route specifically requires gid targeting.
565
+
566
+ ## Input Rules
567
+
568
+ - Use `--doc-id`, `--url`, or `--uri` to identify a workbook.
569
+ - Use `--worksheet-name` when the endpoint supports it.
570
+ - Use `--table-id` when operating on an `excel-table`; default to `1` only when
571
+ the target worksheet is unambiguous.
572
+ - Use `--name` or backend ids when operating on a `db-table`.
573
+ - Use `--gid` for gid-specific sheet targeting.
574
+ - File inputs like `--rows`, `--values`, `--targets`, and `--operations` must be JSON.
575
+
576
+ ## Output
577
+
578
+ Default output is JSON. `table` is optimized for sheet-like payloads; `yaml` is also supported.
579
+
580
+ ## Development
581
+
582
+ ```bash
583
+ python3 -m venv .venv
584
+ . .venv/bin/activate
585
+ pip install -U pip
586
+ pip install -e .
587
+ ```
588
+
589
+ Run tests:
590
+
591
+ ```bash
592
+ python -m unittest discover -s tests -v
593
+ ```