maybeai-sheet-cli 0.3.2__tar.gz → 0.4.1__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 (77) hide show
  1. maybeai_sheet_cli-0.4.1/PKG-INFO +629 -0
  2. maybeai_sheet_cli-0.4.1/README.md +605 -0
  3. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/docs/agent-friendly-command-tree.md +276 -97
  4. maybeai_sheet_cli-0.4.1/docs/operation-plan-cli-no-dsl-plan.md +459 -0
  5. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-phase-2-routes.md +23 -16
  6. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-phase-2.md +38 -43
  7. maybeai_sheet_cli-0.4.1/docs/superpowers/plans/2026-07-01-mbs-be-new-backend-contracts-plan.md +928 -0
  8. maybeai_sheet_cli-0.4.1/docs/superpowers/plans/2026-07-01-mbs-deferred-table-routing-plan.md +713 -0
  9. maybeai_sheet_cli-0.4.1/docs/superpowers/plans/2026-07-01-mbs-excel-worksheet-multi-table-plan.md +683 -0
  10. maybeai_sheet_cli-0.4.1/docs/superpowers/plans/2026-07-01-mbs-two-engine-command-refactor.md +139 -0
  11. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/2026-07-01-mbs-deferred-routing-e2e-report.html +239 -0
  12. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/2026-07-01-phase2-test-review.html +309 -0
  13. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/20260701-130317-excel-table-empty-range-e2e.html +99 -0
  14. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/20260701-130447-excel-table-empty-range-e2e.html +23 -0
  15. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/20260701-130556-excel-table-empty-range-e2e.html +204 -0
  16. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/20260701-230803-local-cli-endpoint-verification.html +52 -0
  17. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/20260701-232511-local7011-cli-table-metadata-verification.html +78 -0
  18. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/e2e-artifacts/e2e-payloads-20260701-130317.json +79 -0
  19. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/e2e-artifacts/e2e-payloads-20260701-130447.json +82 -0
  20. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/e2e-artifacts/e2e-payloads-20260701-130556.json +414 -0
  21. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/e2e-artifacts/multi-table-empty-range-20260701-130317.xlsx +0 -0
  22. maybeai_sheet_cli-0.4.1/docs/superpowers/reports/e2e-artifacts/openpyxl-multi-table-empty-range-20260701-130447.xlsx +0 -0
  23. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/pyproject.toml +1 -1
  24. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/__init__.py +1 -1
  25. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/cli.py +18 -2
  26. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/_phase2.py +140 -0
  27. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/cell.py +62 -0
  28. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/column.py +221 -0
  29. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/db_table.py +364 -0
  30. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/excel_table.py +391 -0
  31. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/excel_worksheet.py +111 -0
  32. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/file.py +135 -0
  33. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/formula.py +99 -0
  34. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/history.py +104 -0
  35. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/range.py +55 -0
  36. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/row.py +170 -0
  37. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/style.py +255 -0
  38. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/workbook.py +183 -11
  39. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/commands/worksheet.py +255 -0
  40. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/endpoints.py +143 -0
  41. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/formatters.py +6 -0
  42. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/protocol.py +23 -0
  43. maybeai_sheet_cli-0.4.1/src/maybeai_sheet/table_resolver.py +572 -0
  44. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/tests/test_cli.py +28 -77
  45. maybeai_sheet_cli-0.4.1/tests/test_endpoints.py +121 -0
  46. maybeai_sheet_cli-0.4.1/tests/test_phase2_cli.py +649 -0
  47. maybeai_sheet_cli-0.4.1/tests/test_two_engine_cli.py +573 -0
  48. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/tests/test_update.py +2 -1
  49. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/uv.lock +1 -1
  50. maybeai_sheet_cli-0.3.2/PKG-INFO +0 -248
  51. maybeai_sheet_cli-0.3.2/README.md +0 -224
  52. maybeai_sheet_cli-0.3.2/src/maybeai_sheet/commands/worksheet.py +0 -65
  53. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/.claude/settings.local.json +0 -0
  54. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/.gitignore +0 -0
  55. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/CLAUDE.md +0 -0
  56. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/cli-packaging-plan.md +0 -0
  57. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/cli-plan.md +0 -0
  58. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-command-tree.md +0 -0
  59. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/docs/superpowers/reports/2026-07-01-phase1-test-review.html +0 -0
  60. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/docs/verification-matrix-fallback.md +0 -0
  61. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/client.py +0 -0
  62. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/__init__.py +0 -0
  63. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/raw.py +0 -0
  64. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/share.py +0 -0
  65. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/sheet.py +0 -0
  66. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/commands/table.py +0 -0
  67. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/config.py +0 -0
  68. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/errors.py +0 -0
  69. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/models/__init__.py +0 -0
  70. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/models/share.py +0 -0
  71. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/models/sheet.py +0 -0
  72. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/models/workbook.py +0 -0
  73. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/options.py +0 -0
  74. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/resolver.py +0 -0
  75. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/src/maybeai_sheet/update.py +0 -0
  76. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/tests/test_formatters.py +0 -0
  77. {maybeai_sheet_cli-0.3.2 → maybeai_sheet_cli-0.4.1}/tests/test_resolver.py +0 -0
@@ -0,0 +1,629 @@
1
+ Metadata-Version: 2.4
2
+ Name: maybeai-sheet-cli
3
+ Version: 0.4.1
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
+ ## Quick Start
92
+
93
+ The examples below follow the target protocol names. The currently shipped
94
+ compatibility aliases are listed in the Implemented Command Tree.
95
+
96
+ List user-visible workbooks:
97
+
98
+ ```bash
99
+ mbs workbook list-user-workbooks --limit 20
100
+ ```
101
+
102
+ Read a bounded range:
103
+
104
+ ```bash
105
+ mbs excel-worksheet range read --doc-id abc123 --worksheet-name Sheet1 --range A1:D20
106
+ ```
107
+
108
+ List worksheets:
109
+
110
+ ```bash
111
+ mbs workbook list-worksheets --doc-id abc123
112
+ ```
113
+
114
+ Inspect the first worksheet-backed table:
115
+
116
+ ```bash
117
+ mbs excel-table metadata --doc-id abc123 --worksheet-name Sheet1 --table-id 1
118
+ ```
119
+
120
+ Create a workbook:
121
+
122
+ ```bash
123
+ mbs workbook create --title "Board Pack"
124
+ ```
125
+
126
+ Import a workbook-style `.xlsx` through the default Excelize path:
127
+
128
+ ```bash
129
+ mbs workbook import ./report.xlsx
130
+ ```
131
+
132
+ Import a large table-like `.xlsx` into SheetTable/PG:
133
+
134
+ ```bash
135
+ mbs workbook import ./large-table.xlsx --engine postgres
136
+ ```
137
+
138
+ Append rows and verify:
139
+
140
+ ```bash
141
+ mbs excel-table insert --doc-id abc123 --worksheet-name Sheet1 --table-id 1 --rows rows.json --verify
142
+ ```
143
+
144
+ Grant workbook access:
145
+
146
+ ```bash
147
+ mbs share create --doc-id abc123 --email teammate@example.com --role viewer
148
+ ```
149
+
150
+ Rename a worksheet and inspect a destructive row delete before sending it:
151
+
152
+ ```bash
153
+ mbs excel-worksheet rename --doc-id abc123 --worksheet-name Old --new-name New
154
+ mbs excel-worksheet row delete --doc-id abc123 --worksheet-name Sheet1 --row 10 --dry-run
155
+ mbs excel-worksheet row delete --doc-id abc123 --worksheet-name Sheet1 --row 10 --yes
156
+ ```
157
+
158
+ Search, style, inspect history, and export:
159
+
160
+ ```bash
161
+ mbs excel-worksheet range search --doc-id abc123 --worksheet-name Sheet1 --query revenue --max-results 20
162
+ mbs excel-worksheet style freeze-panes --doc-id abc123 --worksheet-name Sheet1 --cell B2
163
+ mbs excel-worksheet range calculate --doc-id abc123 --worksheet-name Sheet1 --cell E2 --formula "=SUM(B2:D2)"
164
+ mbs version list --doc-id abc123 --limit 10
165
+ mbs workbook export --doc-id abc123 --out workbook.xlsx
166
+ ```
167
+
168
+ ## Relationship
169
+ 1 workbok
170
+ | \
171
+ N db_worksheet(PG) N excel_worksheets
172
+ | \
173
+ M(N>1) db_worksheet(db_table) J(<N) excel_table
174
+
175
+ CLI command names normalize these relationship labels to hyphenated groups:
176
+ `excel_worksheet` becomes `excel-worksheet`, `excel_table` becomes
177
+ `excel-table`, and `db_worksheet(db_table)` becomes `db-table`.
178
+
179
+ ## Implemented Command Tree
180
+
181
+ This is the current shipped command surface. The full roadmap tree below is
182
+ separate and includes planned or deferred commands.
183
+
184
+ ```text
185
+ mbs
186
+ ├── update
187
+ │ └── Update maybeai-sheet-cli from PyPI.
188
+
189
+ ├── workbook
190
+ │ ├── create Create a new workbook.
191
+ │ ├── create-from-file Import an .xlsx file.
192
+ │ ├── import Preferred alias for create-from-file.
193
+ │ ├── metadata Inspect workbook profile and routing metadata.
194
+ │ ├── list-user-workbooks
195
+ │ │ Preferred alias for bounded user workbook listing.
196
+ │ ├── list-worksheets List worksheets in a workbook.
197
+ │ ├── list List user workbooks with bounded output.
198
+ │ ├── search Search user workbooks with bounded output.
199
+ │ ├── manifest Compatibility alias for metadata.
200
+ │ └── capabilities Inspect workbook capability/profile metadata.
201
+
202
+ ├── excel-worksheet
203
+ │ ├── metadata Inspect worksheet metadata through workbook profile.
204
+ │ └── list-table List worksheet/table metadata for a workbook.
205
+
206
+ ├── excel-table
207
+ │ ├── metadata Resolve a worksheet-backed table from workbook metadata.
208
+ │ ├── schema Infer schema from a resolved worksheet-backed table range.
209
+ │ ├── sample Return bounded table sample rows.
210
+ │ ├── read Read a resolved worksheet-backed table range.
211
+ │ └── insert Insert row objects into a worksheet-backed table.
212
+
213
+ ├── db-table
214
+ │ ├── metadata Resolve PG/SheetTable-backed worksheet metadata.
215
+ │ ├── schema Infer schema from a bounded PG read.
216
+ │ ├── sample Return bounded PG table sample rows.
217
+ │ ├── read Read PG-backed table rows through routed APIs.
218
+ │ └── insert Insert rows into a PG-backed table.
219
+
220
+ ├── worksheet
221
+ │ ├── list List worksheets in a workbook.
222
+ │ ├── create Create a worksheet, optionally with starter values.
223
+ │ ├── rename Rename a worksheet.
224
+ │ ├── delete Delete a worksheet; requires --yes unless --dry-run.
225
+ │ ├── copy Copy a worksheet.
226
+ │ └── move Move a worksheet to a zero-based index.
227
+
228
+ ├── range
229
+ │ ├── read Read a bounded A1 range.
230
+ │ ├── write Write a JSON matrix into an A1 range.
231
+ │ ├── clear Clear an A1 range.
232
+ │ └── search Search a worksheet with bounded results.
233
+
234
+ ├── row
235
+ │ ├── insert Insert rows.
236
+ │ ├── delete Delete rows; requires --yes unless --dry-run.
237
+ │ └── move Move rows.
238
+
239
+ ├── column
240
+ │ ├── insert Insert columns.
241
+ │ ├── delete Delete columns; requires --yes unless --dry-run.
242
+ │ ├── move Move columns.
243
+ │ └── width Set column width.
244
+
245
+ ├── formula
246
+ │ ├── read Read formulas with FORMULA render mode.
247
+ │ ├── set Set one formula cell.
248
+ │ ├── batch-set Set formula ranges from a JSON operations file.
249
+ │ ├── recalculate Recalculate formulas for a worksheet/workbook.
250
+ │ ├── calculate Calculate one formula cell.
251
+ │ └── lineage Trace formula lineage for one cell.
252
+
253
+ ├── style
254
+ │ ├── freeze-panes Freeze rows/columns using an A1 cell boundary.
255
+ │ ├── auto-filter set Set worksheet auto-filter range.
256
+ │ ├── auto-filter remove Remove worksheet auto-filter.
257
+ │ ├── columns-width Set column widths.
258
+ │ └── rows-height Set row heights.
259
+
260
+ ├── history
261
+ │ ├── list List workbook versions with bounded output.
262
+ │ └── read Read a workbook version.
263
+
264
+ ├── file
265
+ │ ├── export Export workbook bytes to --out.
266
+ │ ├── list List files with bounded output.
267
+ │ └── search Search files with bounded output.
268
+
269
+ ├── share
270
+ │ ├── visibility Set workbook visibility.
271
+ │ ├── grant Grant a user permission.
272
+ │ ├── permission Read current permission.
273
+ │ ├── remove Remove a user's access.
274
+ │ └── list List sharing entries.
275
+
276
+ ├── raw
277
+ │ └── post Low-level POST escape hatch for routed API paths.
278
+
279
+ └── sheet Legacy compatibility aliases.
280
+ ├── read
281
+ ├── read-range
282
+ ├── read-many
283
+ ├── named-range
284
+ ├── headers
285
+ ├── worksheets
286
+ ├── formulas
287
+ ├── write-range
288
+ ├── clear-range
289
+ ├── append
290
+ ├── upsert
291
+ ├── formula-set
292
+ ├── formula-batch-set
293
+ ├── recalculate
294
+ └── create-worksheet
295
+ ```
296
+
297
+ ## Full Command Tree
298
+
299
+ The reviewed tree below is the source of truth for the protocol shape. Product
300
+ model labels in this block use underscores; CLI names in examples and future
301
+ router code should normalize them to hyphenated command groups such as
302
+ `excel-worksheet`, `excel-table`, and `db-table`. The older `sheet ...`
303
+ commands remain available as compatibility aliases. This tree includes
304
+ implemented, planned, deferred, and not-recommended command surfaces.
305
+
306
+ Status legend for the full tree:
307
+
308
+ - `NOW`: released in the current CLI under this command shape.
309
+ - `API`: route exists or is expected, but the target command wrapper/refactor is
310
+ not released under this shape yet.
311
+ - `PG`: SheetTable/PG-specific; defer until exposed through the public API.
312
+ - `PLAN`: needs a backend/product contract before implementation.
313
+ - `DEFER`: intentionally not part of the clean agent-first surface yet.
314
+ - `SKIP`: not recommended for this CLI.
315
+
316
+ ```text
317
+ mbs
318
+ ├── update
319
+ │ └── Update maybeai-sheet-cli from PyPI.
320
+
321
+ ├── workbook
322
+ │ ├── metadata API Inspect workbook profile and routing metadata.(workshets)
323
+ | |- source PLAN Similar to NotebookLM source (menu on the left).
324
+ │ ├── create NOW Create a new workbook.
325
+ │ ├── create-from-file NOW Import an .xlsx file.
326
+ │ ├── import NOW Preferred alias for create-from-file.
327
+ │ ├── list-user-workbooks API List user workbooks with bounded output.
328
+ | list-worksheets API List worksheets, including engine.
329
+ │ ├── search NOW Search user workbooks with bounded output.
330
+ │ ├── export API Export workbook bytes.
331
+ │ └── copy API Copy a workbook.
332
+ │ ├── upload API Upload a file through workbook import flow.
333
+ │ ├── update API Update a stored workbook file not change doc_id
334
+ │ ├── export API Export workbook bytes to --out.
335
+ │ ├── delete API Delete a stored file.
336
+ │ └── rename API Rename a stored file.
337
+
338
+ ├── excel_worksheet
339
+ │ ├── list-table API List worksheets in a workbook.
340
+ │ ├── create API Create a worksheet, optionally with starter values.
341
+ │ ├── update API Update worksheet metadata.
342
+ │ ├── sample PLAN Return bounded worksheet/range sample rows.
343
+ │ ├── delete API Delete a worksheet; requires --yes unless --dry-run.
344
+ │ ├── rename API Rename a worksheet.
345
+ │ ├── move API Move a worksheet to a zero-based index.
346
+ │ └── copy API Copy a worksheet.
347
+ | └── metadata API Include table meta: range, header, table id, data summary.
348
+
349
+ ├── excel_table
350
+ │ ├── create PLAN Create a table view from a worksheet range.
351
+ │ ├── update PLAN Update table view metadata or range.
352
+ │ ├── delete PLAN Delete a table view; requires --yes unless --dry-run.
353
+ │ ├── schema API Infer table schema from a resolved table range.
354
+ │ ├── sample API Return bounded table sample rows.
355
+ │ ├── read API Read header-aware table rows.
356
+ │ ├── insert API Insert table rows.
357
+ | └── metadata API Include table meta: range, header, table id, data summary.
358
+ |
359
+ ├── excel_worksheet range
360
+ │ ├── read API Read a bounded A1 range.
361
+ │ ├── write API Write a JSON matrix into an A1 range.
362
+ │ ├── clear API Clear an A1 range.
363
+ │ ├── read-many DEFER Legacy alias only until a real batch API exists.
364
+ │ ├── copy API Copy a range.
365
+ │ ├── search API Search a worksheet with bounded results.
366
+ │ └── used-range PLAN Return worksheet used range after a routed contract exists.
367
+ │ ├── set-formula API Set one formula cell.
368
+ │ ├── calculate API Calculate one formula cell.
369
+ | |- lineage API Trace cell/range lineage.
370
+
371
+ ├── db_worksheet(AKA db_table)
372
+ │ ├── create PG Create a PG-backed table.
373
+ │ ├── update PG Update PG-backed table metadata.
374
+ │ ├── delete PG Delete a PG-backed table; requires --yes unless --dry-run.
375
+ │ ├── schema API Infer table schema from a bounded PG read.
376
+ │ ├── sample API Return bounded table sample rows.
377
+ │ ├── read API Read PG-backed table rows.
378
+ │ ├── insert API Insert PG-backed table rows.
379
+ | └── metadata API Include table meta, backend id, schema, and data summary.
380
+
381
+ ├── excel_worksheet row
382
+ │ ├── insert API Insert rows.
383
+ │ ├── delete API Delete rows; requires --yes unless --dry-run.
384
+ │ └── move API Move rows.
385
+
386
+ ├── excel_worksheet column
387
+ │ ├── insert API Insert columns.
388
+ │ ├── delete API Delete columns; requires --yes unless --dry-run.
389
+ │ ├── move API Move columns.
390
+ │ ├── width API Set column width.
391
+ │ └── append API Append columns.
392
+
393
+ ├── excel_worksheet chart
394
+ │ ├── list API List charts in a workbook or dashboard.
395
+ │ ├── get API Read one chart spec and source binding.
396
+ │ ├── preview PLAN Preview one chart from its spec/source binding.
397
+ │ ├── create-config API Create one chart from a chart spec.
398
+ │ ├── update API Update one chart from a chart spec.
399
+ │ ├── refresh PLAN Refresh one chart from its current source binding.
400
+ │ └── delete API Delete one chart.
401
+
402
+ ├── excel_worksheet dashboard
403
+ │ ├── manifest PLAN Read dashboard, chart, metric, layout, and lineage metadata.
404
+ │ ├── create-config PLAN Compose chart ids/specs into a dashboard config.
405
+ │ ├── validate PLAN Validate dashboard layout, permissions, filters, and metrics.
406
+ │ └── refresh PLAN Refresh dashboard charts from their current source bindings.
407
+ │ └── delete
408
+
409
+
410
+ ├── excel_worksheet style
411
+ │ ├── cell batch-set API Apply cell style batches from JSON.
412
+ │ ├── columns-width API Set column widths.
413
+ │ ├── rows-height API Set row heights.
414
+ │ ├── freeze-panes API Freeze rows/columns using an A1 boundary.
415
+ │ ├── gridlines toggle API Toggle worksheet gridlines.
416
+ │ ├── auto-filter set API Set worksheet auto-filter range.
417
+ │ ├── auto-filter remove API Remove worksheet auto-filter.
418
+ │ ├── filter-values API Apply filter values.
419
+ │ ├── conditional-formats set API Set conditional formatting rules.
420
+ │ ├── worksheet plan API Generate a worksheet styling plan.
421
+ │ └── worksheet apply API Apply a worksheet styling plan.
422
+
423
+ ├── excel_worksheet image
424
+ │ ├── read API Read worksheet images.
425
+ │ ├── insert API Add an image file.
426
+ │ └── delete API Delete an image.
427
+
428
+ ├── version
429
+ │ ├── list API List workbook history with bounded output.
430
+ │ └── restore PLAN Restore a workbook history version after a routed contract exists.
431
+
432
+
433
+ ├── share
434
+ │ ├── create API Create or grant sharing access.
435
+ │ ├── remove API Remove a user's access.
436
+ │ ├── modify API Modify sharing access.
437
+
438
+
439
+ └── sheet Legacy compatibility aliases.
440
+ ├── read
441
+ ├── read-range
442
+ ├── read-many
443
+ ├── named-range
444
+ ├── headers
445
+ ├── worksheets
446
+ ├── formulas
447
+ ├── write-range
448
+ ├── clear-range
449
+ ├── append
450
+ ├── upsert
451
+ ├── formula-set
452
+ ├── formula-batch-set
453
+ ├── recalculate
454
+ └── create-worksheet
455
+ ```
456
+
457
+ Full tree examples:
458
+
459
+ These examples cover every top-level category. Commands marked `API`, `PLAN`,
460
+ `PG`, or `DEFER` show the intended CLI shape, but are not guaranteed to be
461
+ available until their status moves to `NOW`. They use hyphenated CLI command
462
+ names even when the reviewed protocol tree uses underscore model labels.
463
+
464
+ ```bash
465
+ # update
466
+ mbs update --check
467
+
468
+ # workbook
469
+ mbs workbook metadata --doc-id abc123 # API
470
+ mbs workbook list-user-workbooks --limit 20 # API
471
+ mbs workbook list-worksheets --doc-id abc123 # API
472
+ mbs workbook export --doc-id abc123 --out workbook.xlsx # API
473
+ mbs workbook copy --doc-id abc123 --name "Budget Copy" # API
474
+ mbs workbook delete --doc-id abc123 --dry-run # API
475
+
476
+ # excel-worksheet
477
+ mbs excel-worksheet create --doc-id abc123 --name Actuals # API
478
+ mbs excel-worksheet update --doc-id abc123 --worksheet-name Actuals --title "Actuals FY26" # API
479
+ mbs excel-worksheet metadata --doc-id abc123 --worksheet-name Actuals # API
480
+ mbs excel-worksheet sample --doc-id abc123 --worksheet-name Actuals --range A1:Z5000 --limit 50 # PLAN
481
+
482
+ # excel-worksheet range
483
+ mbs excel-worksheet range read --doc-id abc123 --worksheet-name Actuals --range A1:D20 # API
484
+ mbs excel-worksheet range used-range --doc-id abc123 --worksheet-name Actuals # PLAN
485
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Model --cell E2 --format tree # API
486
+
487
+ # excel-table
488
+ mbs excel-table metadata --doc-id abc123 --worksheet-name Orders --table-id 1 # API
489
+ mbs excel-table schema --doc-id abc123 --worksheet-name Orders --table-id 1 # API
490
+ mbs excel-table sample --doc-id abc123 --worksheet-name Orders --table-id 1 --limit 50 # API
491
+ mbs excel-table read --doc-id abc123 --worksheet-name Orders --table-id 1 --limit 50 # API
492
+ mbs excel-table insert --doc-id abc123 --worksheet-name Orders --table-id 1 --rows rows.json # API
493
+ mbs excel-table style columns-width --doc-id abc123 --worksheet-name Orders --table-id 1 --column B --width 120 # API
494
+
495
+ # db-table
496
+ mbs db-table metadata --doc-id abc123 --name orders-large # API
497
+ mbs db-table schema --doc-id abc123 --name orders-large # API
498
+ mbs db-table sample --doc-id abc123 --name orders-large --limit 50 # API
499
+ mbs db-table read --doc-id abc123 --name orders-large --limit 50 # API
500
+ mbs db-table insert --doc-id abc123 --name orders-large --rows rows.json # API
501
+
502
+ # row
503
+ mbs excel-worksheet row insert --doc-id abc123 --worksheet-name Actuals --row 10 --count 2 # API
504
+
505
+ # column
506
+ mbs excel-worksheet column width --doc-id abc123 --worksheet-name Actuals --column B --width 120 # API
507
+ mbs excel-worksheet column append --doc-id abc123 --worksheet-name Actuals --values columns.json # API
508
+
509
+ # cell
510
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Model --cell E2 --format tree # API
511
+
512
+ # formula
513
+ mbs excel-worksheet range calculate --doc-id abc123 --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)" # API
514
+ mbs excel-worksheet range set-formula --doc-id abc123 --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)" # API
515
+
516
+ # chart
517
+ mbs excel-worksheet chart create-config --doc-id abc123 --worksheet-name Dashboard --cell J2 --spec chart.json # API
518
+ mbs excel-worksheet chart refresh --doc-id abc123 --worksheet-name Dashboard --chart-id chart_monthly_revenue # PLAN
519
+
520
+ # dashboard
521
+ mbs excel-worksheet dashboard manifest --doc-id abc123 --worksheet-name Dashboard --dashboard-id dash_revenue # PLAN
522
+ mbs excel-worksheet dashboard create-config --doc-id abc123 --worksheet-name Dashboard --name "Revenue Dashboard" --spec dashboard.json # PLAN
523
+ mbs excel-worksheet dashboard refresh --doc-id abc123 --worksheet-name Dashboard --dashboard-id dash_revenue # PLAN
524
+
525
+ # style
526
+ mbs excel-worksheet style freeze-panes --doc-id abc123 --worksheet-name Actuals --cell B2 # API
527
+ mbs excel-worksheet style conditional-formats set --doc-id abc123 --worksheet-name Actuals --spec conditional_formats.json # API
528
+
529
+ # image
530
+ mbs excel-worksheet image insert --doc-id abc123 --worksheet-name Dashboard --cell A1 --file logo.png # API
531
+
532
+ # version
533
+ mbs version list --doc-id abc123 --limit 10 # API
534
+ mbs version restore --doc-id abc123 --version-id v42 --dry-run # PLAN
535
+
536
+ # share
537
+ mbs share create --doc-id abc123 --email teammate@example.com --role viewer # API
538
+
539
+ # sheet
540
+ mbs sheet read --doc-id abc123 --worksheet-name Sheet1 --range A1:D20
541
+ ```
542
+
543
+ Refactor planning is tracked separately from this README:
544
+ `docs/superpowers/plans/2026-07-01-mbs-two-engine-command-refactor.md`.
545
+
546
+ Not recommended as first-class CLI commands:
547
+
548
+ ```text
549
+ validation create/update/delete PLAN
550
+ protection protect/unprotect PLAN
551
+ sort range/table PLAN
552
+ comment create/update/delete PLAN
553
+ named-range create/update/delete PLAN
554
+ macro/vba SKIP
555
+ power-query SKIP
556
+ power-pivot SKIP
557
+ workbook diff PLAN
558
+ dependency graph beyond cell lineage PLAN
559
+ ```
560
+
561
+ Relationship guide:
562
+
563
+ - Use `workbook` for file-level creation, upload/import, and manifest checks.
564
+ - Use `excel-worksheet` for Excel tab lifecycle operations and worksheet/range
565
+ inspection.
566
+ - Use `excel-worksheet range` for coordinate-based reads, writes, formulas, and
567
+ cell lineage.
568
+ - Use `excel-table` for worksheet-backed table views. One Excel worksheet can
569
+ contain multiple tables, so workbook metadata should expose simple ordinal
570
+ table ids such as `1`, `2`, `3`, and `4`, each mapped to the real worksheet
571
+ range behind the scenes. `excel-table` commands should accept optional
572
+ `--table-id`; when omitted, the CLI should default to `--table-id 1` only
573
+ inside an unambiguous worksheet target.
574
+ - Use `db-table` for PG/SheetTable-backed tables. These are not worksheet
575
+ ranges, so prefer human-readable `--name` or backend ids instead of worksheet
576
+ `--table-id`.
577
+ - Use `excel-worksheet row` and `excel-worksheet column` for structural
578
+ row/column changes.
579
+ - Use `excel-worksheet style` for worksheet layout operations like freeze
580
+ panes, filter ranges, widths, and heights.
581
+ - Use `excel-table style` when the same styling operation should be scoped to a
582
+ table's resolved worksheet range.
583
+ - Use `excel-worksheet chart` for CRUD, preview, and refresh of individual
584
+ source-backed visualizations before composing dashboards.
585
+ - Use `excel-worksheet dashboard` to compose chart ids/specs into BI asset or
586
+ dashboard worksheet lifecycles.
587
+ - Use `excel-worksheet image` for lower-level report workflows after routed
588
+ public API verification.
589
+ - Use `version` for workbook history inspection and restore.
590
+ - Use `share` for visibility and collaborator access.
591
+
592
+ Targeting notes:
593
+
594
+ - Most commands accept `--doc-id`, `--url`, or `--uri`.
595
+ - Prefer `--worksheet-name` when the backend route supports names.
596
+ - Use `--table-id` when operating on an `excel-table`. It is a simple ordinal
597
+ from workbook metadata, for example `--table-id 1`, and maps internally to
598
+ table metadata such as `worksheet_name` and `range`.
599
+ - Use `--name` or backend ids when operating on a `db-table`.
600
+ - Use `--gid` only for legacy gid-specific compatibility aliases.
601
+
602
+ ## Input Rules
603
+
604
+ - Use `--doc-id`, `--url`, or `--uri` to identify a workbook.
605
+ - Use `--worksheet-name` when the endpoint supports it.
606
+ - Use `--table-id` when operating on an `excel-table`; default to `1` only when
607
+ the target worksheet is unambiguous.
608
+ - Use `--name` or backend ids when operating on a `db-table`.
609
+ - Use `--gid` for gid-specific sheet targeting.
610
+ - File inputs like `--rows`, `--values`, `--targets`, and `--operations` must be JSON.
611
+
612
+ ## Output
613
+
614
+ Default output is JSON. `table` is optimized for sheet-like payloads; `yaml` is also supported.
615
+
616
+ ## Development
617
+
618
+ ```bash
619
+ python3 -m venv .venv
620
+ . .venv/bin/activate
621
+ pip install -U pip
622
+ pip install -e .
623
+ ```
624
+
625
+ Run tests:
626
+
627
+ ```bash
628
+ python -m unittest discover -s tests -v
629
+ ```