maybeai-sheet-cli 0.4.0__tar.gz → 0.5.0__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 (76) hide show
  1. maybeai_sheet_cli-0.5.0/PKG-INFO +493 -0
  2. maybeai_sheet_cli-0.5.0/README.md +469 -0
  3. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/agent-friendly-command-tree.md +164 -133
  4. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/operation-plan-cli-no-dsl-plan.md +39 -57
  5. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-phase-2-routes.md +4 -4
  6. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-phase-2.md +38 -43
  7. maybeai_sheet_cli-0.5.0/docs/superpowers/plans/2026-07-01-mbs-be-new-backend-contracts-plan.md +928 -0
  8. maybeai_sheet_cli-0.5.0/docs/superpowers/plans/2026-07-01-mbs-deferred-table-routing-plan.md +713 -0
  9. maybeai_sheet_cli-0.5.0/docs/superpowers/plans/2026-07-01-mbs-excel-worksheet-multi-table-plan.md +683 -0
  10. maybeai_sheet_cli-0.5.0/docs/superpowers/plans/2026-07-01-mbs-two-engine-command-refactor.md +139 -0
  11. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/2026-07-01-mbs-deferred-routing-e2e-report.html +239 -0
  12. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/20260701-130317-excel-table-empty-range-e2e.html +99 -0
  13. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/20260701-130447-excel-table-empty-range-e2e.html +23 -0
  14. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/20260701-130556-excel-table-empty-range-e2e.html +204 -0
  15. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/20260701-230803-local-cli-endpoint-verification.html +52 -0
  16. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/20260701-232511-local7011-cli-table-metadata-verification.html +78 -0
  17. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/e2e-artifacts/e2e-payloads-20260701-130317.json +79 -0
  18. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/e2e-artifacts/e2e-payloads-20260701-130447.json +82 -0
  19. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/e2e-artifacts/e2e-payloads-20260701-130556.json +414 -0
  20. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/e2e-artifacts/multi-table-empty-range-20260701-130317.xlsx +0 -0
  21. maybeai_sheet_cli-0.5.0/docs/superpowers/reports/e2e-artifacts/openpyxl-multi-table-empty-range-20260701-130447.xlsx +0 -0
  22. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/pyproject.toml +1 -1
  23. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/__init__.py +1 -1
  24. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/cli.py +9 -4
  25. maybeai_sheet_cli-0.5.0/src/maybeai_sheet/commands/cell.py +62 -0
  26. maybeai_sheet_cli-0.5.0/src/maybeai_sheet/commands/db_table.py +364 -0
  27. maybeai_sheet_cli-0.5.0/src/maybeai_sheet/commands/excel_table.py +391 -0
  28. maybeai_sheet_cli-0.5.0/src/maybeai_sheet/commands/excel_worksheet.py +333 -0
  29. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/workbook.py +183 -11
  30. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/endpoints.py +22 -5
  31. maybeai_sheet_cli-0.5.0/src/maybeai_sheet/protocol.py +23 -0
  32. maybeai_sheet_cli-0.5.0/src/maybeai_sheet/table_resolver.py +572 -0
  33. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/tests/test_cli.py +34 -82
  34. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/tests/test_endpoints.py +21 -4
  35. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/tests/test_phase2_cli.py +35 -6
  36. maybeai_sheet_cli-0.5.0/tests/test_two_engine_cli.py +670 -0
  37. maybeai_sheet_cli-0.4.0/PKG-INFO +0 -304
  38. maybeai_sheet_cli-0.4.0/README.md +0 -280
  39. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/.claude/settings.local.json +0 -0
  40. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/.gitignore +0 -0
  41. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/CLAUDE.md +0 -0
  42. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/cli-packaging-plan.md +0 -0
  43. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/cli-plan.md +0 -0
  44. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-command-tree.md +0 -0
  45. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/superpowers/reports/2026-07-01-phase1-test-review.html +0 -0
  46. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/superpowers/reports/2026-07-01-phase2-test-review.html +0 -0
  47. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/docs/verification-matrix-fallback.md +0 -0
  48. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/client.py +0 -0
  49. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/__init__.py +0 -0
  50. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/_phase2.py +0 -0
  51. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/column.py +0 -0
  52. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/file.py +0 -0
  53. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/formula.py +0 -0
  54. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/history.py +0 -0
  55. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/range.py +0 -0
  56. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/raw.py +0 -0
  57. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/row.py +0 -0
  58. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/share.py +0 -0
  59. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/sheet.py +0 -0
  60. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/style.py +0 -0
  61. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/table.py +0 -0
  62. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/commands/worksheet.py +0 -0
  63. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/config.py +0 -0
  64. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/errors.py +0 -0
  65. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/formatters.py +0 -0
  66. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/models/__init__.py +0 -0
  67. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/models/share.py +0 -0
  68. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/models/sheet.py +0 -0
  69. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/models/workbook.py +0 -0
  70. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/options.py +0 -0
  71. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/resolver.py +0 -0
  72. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/src/maybeai_sheet/update.py +0 -0
  73. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/tests/test_formatters.py +0 -0
  74. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/tests/test_resolver.py +0 -0
  75. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/tests/test_update.py +0 -0
  76. {maybeai_sheet_cli-0.4.0 → maybeai_sheet_cli-0.5.0}/uv.lock +0 -0
@@ -0,0 +1,493 @@
1
+ Metadata-Version: 2.4
2
+ Name: maybeai-sheet-cli
3
+ Version: 0.5.0
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.
94
+
95
+ List user-visible workbooks:
96
+
97
+ ```bash
98
+ mbs workbook list-user-workbooks --limit 20
99
+ ```
100
+
101
+ Read a worksheet:
102
+
103
+ ```bash
104
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Sheet1
105
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Sheet1 --range A1:H1
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
+
180
+ ## Full Command Tree
181
+
182
+ The reviewed tree below is the source of truth for the protocol shape. Product
183
+ model labels in this block use underscores; CLI names in examples and future
184
+ router code should normalize them to hyphenated command groups such as
185
+ `excel-worksheet`, `excel-table`, and `db-table`. This tree includes
186
+ implemented, planned, deferred, and not-recommended command surfaces.
187
+
188
+ Status legend for the full tree:
189
+
190
+ - `NOW`: released in the current CLI under this command shape.
191
+ - `API`: route exists or is expected, but the target command wrapper/refactor is
192
+ not released under this shape yet.
193
+ - `PG`: SheetTable/PG-specific; defer until exposed through the public API.
194
+ - `PLAN`: needs a backend/product contract before implementation.
195
+ - `DEFER`: intentionally not part of the clean agent-first surface yet.
196
+ - `SKIP`: not recommended for this CLI.
197
+
198
+ ```text
199
+ mbs
200
+ ├── update
201
+ │ └── Update maybeai-sheet-cli from PyPI.
202
+
203
+ ├── workbook
204
+ │ ├── metadata API Inspect workbook profile and routing metadata.(workshets)
205
+ | |- source PLAN Similar to NotebookLM source (menu on the left).
206
+ │ ├── create NOW Create a new workbook.
207
+ │ ├── create-from-file NOW Import an .xlsx file.
208
+ │ ├── import NOW Preferred alias for create-from-file.
209
+ │ ├── list-user-workbooks API List user workbooks with bounded output.
210
+ | list-worksheets API List worksheets, including engine.
211
+ │ ├── search NOW Search user workbooks with bounded output.
212
+ │ ├── export API Export workbook bytes.
213
+ │ └── copy API Copy a workbook.
214
+ │ ├── upload API Upload a file through workbook import flow.
215
+ │ ├── update API Update a stored workbook file not change doc_id
216
+ │ ├── export API Export workbook bytes to --out.
217
+ │ ├── delete API Delete a stored file.
218
+ │ └── rename API Rename a stored file.
219
+
220
+ ├── excel_worksheet
221
+ │ ├── read API Read the full range of the worksheet.
222
+ │ ├── list-table API List worksheets in a workbook.
223
+ │ ├── create API Create a worksheet, optionally with starter values.
224
+ │ ├── update API Update worksheet metadata.
225
+ │ ├── sample PLAN Return bounded worksheet/range sample rows.
226
+ │ ├── delete API Delete a worksheet; requires --yes unless --dry-run.
227
+ │ ├── rename API Rename a worksheet.
228
+ │ ├── move API Move a worksheet to a zero-based index.
229
+ │ └── copy API Copy a worksheet.
230
+ | └── metadata API Include table meta: range, header, table id, data summary.
231
+
232
+ ├── excel_table
233
+ │ ├── create PLAN Create a table view from a worksheet range.
234
+ │ ├── update PLAN Update table view metadata or range.
235
+ │ ├── delete PLAN Delete a table view; requires --yes unless --dry-run.
236
+ │ ├── schema API Infer table schema from a resolved table range.
237
+ │ ├── sample API Return bounded table sample rows.
238
+ │ ├── read API Read header-aware table rows.
239
+ │ ├── insert API Insert table rows.
240
+ | └── metadata API Include table meta: range, header, table id, data summary.
241
+ |
242
+ ├── excel_worksheet range
243
+ │ ├── read API Read a bounded A1 range.
244
+ │ ├── write API Write a JSON matrix into an A1 range.
245
+ │ ├── clear API Clear an A1 range.
246
+ │ ├── read-many DEFER Legacy alias only until a real batch API exists.
247
+ │ ├── copy API Copy a range.
248
+ │ ├── search API Search a worksheet with bounded results.
249
+ │ └── used-range PLAN Return worksheet used range after a routed contract exists.
250
+ │ ├── set-formula API Set one formula cell.
251
+ │ ├── calculate API Calculate one formula cell.
252
+ | |- lineage API Trace cell/range lineage.
253
+
254
+ ├── db_worksheet(AKA db_table)
255
+ │ ├── create PG Create a PG-backed table.
256
+ │ ├── update PG Update PG-backed table metadata.
257
+ │ ├── delete PG Delete a PG-backed table; requires --yes unless --dry-run.
258
+ │ ├── schema API Infer table schema from a bounded PG read.
259
+ │ ├── sample API Return bounded table sample rows.
260
+ │ ├── read API Read PG-backed table rows.
261
+ │ ├── insert API Insert PG-backed table rows.
262
+ | └── metadata API Include table meta, backend id, schema, and data summary.
263
+
264
+ ├── excel_worksheet row
265
+ │ ├── insert API Insert rows.
266
+ │ ├── delete API Delete rows; requires --yes unless --dry-run.
267
+ │ └── move API Move rows.
268
+
269
+ ├── excel_worksheet column
270
+ │ ├── insert API Insert columns.
271
+ │ ├── delete API Delete columns; requires --yes unless --dry-run.
272
+ │ ├── move API Move columns.
273
+ │ ├── width API Set column width.
274
+ │ └── append API Append columns.
275
+
276
+ ├── excel_worksheet chart
277
+ │ ├── list API List charts in a workbook or dashboard.
278
+ │ ├── get API Read one chart spec and source binding.
279
+ │ ├── preview PLAN Preview one chart from its spec/source binding.
280
+ │ ├── create-config API Create one chart from a chart spec.
281
+ │ ├── update API Update one chart from a chart spec.
282
+ │ ├── refresh PLAN Refresh one chart from its current source binding.
283
+ │ └── delete API Delete one chart.
284
+
285
+ ├── excel_worksheet dashboard
286
+ │ ├── manifest PLAN Read dashboard, chart, metric, layout, and lineage metadata.
287
+ │ ├── create-config PLAN Compose chart ids/specs into a dashboard config.
288
+ │ ├── validate PLAN Validate dashboard layout, permissions, filters, and metrics.
289
+ │ └── refresh PLAN Refresh dashboard charts from their current source bindings.
290
+ │ └── delete
291
+
292
+
293
+ ├── excel_worksheet style
294
+ │ ├── cell batch-set API Apply cell style batches from JSON.
295
+ │ ├── columns-width API Set column widths.
296
+ │ ├── rows-height API Set row heights.
297
+ │ ├── freeze-panes API Freeze rows/columns using an A1 boundary.
298
+ │ ├── gridlines toggle API Toggle worksheet gridlines.
299
+ │ ├── auto-filter set API Set worksheet auto-filter range.
300
+ │ ├── auto-filter remove API Remove worksheet auto-filter.
301
+ │ ├── filter-values API Apply filter values.
302
+ │ ├── conditional-formats set API Set conditional formatting rules.
303
+ │ ├── worksheet plan API Generate a worksheet styling plan.
304
+ │ └── worksheet apply API Apply a worksheet styling plan.
305
+
306
+ ├── excel_worksheet image
307
+ │ ├── read API Read worksheet images.
308
+ │ ├── insert API Add an image file.
309
+ │ └── delete API Delete an image.
310
+
311
+ ├── version
312
+ │ ├── list API List workbook history with bounded output.
313
+ │ └── restore PLAN Restore a workbook history version after a routed contract exists.
314
+
315
+
316
+ ├── share
317
+ │ ├── create API Create or grant sharing access.
318
+ │ ├── remove API Remove a user's access.
319
+ │ ├── modify API Modify sharing access.
320
+ ```
321
+
322
+ Full tree examples:
323
+
324
+ These examples cover every top-level category. Commands marked `API`, `PLAN`,
325
+ `PG`, or `DEFER` show the intended CLI shape, but are not guaranteed to be
326
+ available until their status moves to `NOW`. They use hyphenated CLI command
327
+ names even when the reviewed protocol tree uses underscore model labels.
328
+
329
+ ```bash
330
+ # update
331
+ mbs update --check
332
+
333
+ # workbook
334
+ mbs workbook metadata --doc-id abc123 # API
335
+ mbs workbook list-user-workbooks --limit 20 # API
336
+ mbs workbook list-worksheets --doc-id abc123 # API
337
+ mbs workbook export --doc-id abc123 --out workbook.xlsx # API
338
+ mbs workbook copy --doc-id abc123 --name "Budget Copy" # API
339
+ mbs workbook delete --doc-id abc123 --dry-run # API
340
+
341
+ # excel-worksheet
342
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Actuals # API
343
+ mbs excel-worksheet read --doc-id abc123 --worksheet-name Actuals --range A1:D20 # API
344
+ mbs excel-worksheet create --doc-id abc123 --name Actuals # API
345
+ mbs excel-worksheet update --doc-id abc123 --worksheet-name Actuals --title "Actuals FY26" # API
346
+ mbs excel-worksheet metadata --doc-id abc123 --worksheet-name Actuals # API
347
+ mbs excel-worksheet sample --doc-id abc123 --worksheet-name Actuals --range A1:Z5000 --limit 50 # PLAN
348
+
349
+ # excel-worksheet range
350
+ mbs excel-worksheet range read --doc-id abc123 --worksheet-name Actuals --range A1:D20 # API, advanced structured alias
351
+ mbs excel-worksheet range used-range --doc-id abc123 --worksheet-name Actuals # PLAN
352
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Model --cell E2 --format tree # API
353
+
354
+ # excel-table
355
+ mbs excel-table metadata --doc-id abc123 --worksheet-name Orders --table-id 1 # API
356
+ mbs excel-table schema --doc-id abc123 --worksheet-name Orders --table-id 1 # API
357
+ mbs excel-table sample --doc-id abc123 --worksheet-name Orders --table-id 1 --limit 50 # API
358
+ mbs excel-table read --doc-id abc123 --worksheet-name Orders --table-id 1 --limit 50 # API
359
+ mbs excel-table insert --doc-id abc123 --worksheet-name Orders --table-id 1 --rows rows.json # API
360
+ mbs excel-table style columns-width --doc-id abc123 --worksheet-name Orders --table-id 1 --column B --width 120 # API
361
+
362
+ # db-table
363
+ mbs db-table metadata --doc-id abc123 --name orders-large # API
364
+ mbs db-table schema --doc-id abc123 --name orders-large # API
365
+ mbs db-table sample --doc-id abc123 --name orders-large --limit 50 # API
366
+ mbs db-table read --doc-id abc123 --name orders-large --limit 50 # API
367
+ mbs db-table insert --doc-id abc123 --name orders-large --rows rows.json # API
368
+
369
+ # row
370
+ mbs excel-worksheet row insert --doc-id abc123 --worksheet-name Actuals --row 10 --count 2 # API
371
+
372
+ # column
373
+ mbs excel-worksheet column width --doc-id abc123 --worksheet-name Actuals --column B --width 120 # API
374
+ mbs excel-worksheet column append --doc-id abc123 --worksheet-name Actuals --values columns.json # API
375
+
376
+ # cell
377
+ mbs excel-worksheet range lineage --doc-id abc123 --worksheet-name Model --cell E2 --format tree # API
378
+
379
+ # formula
380
+ mbs excel-worksheet range calculate --doc-id abc123 --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)" # API
381
+ mbs excel-worksheet range set-formula --doc-id abc123 --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)" # API
382
+
383
+ # chart
384
+ mbs excel-worksheet chart create-config --doc-id abc123 --worksheet-name Dashboard --cell J2 --spec chart.json # API
385
+ mbs excel-worksheet chart refresh --doc-id abc123 --worksheet-name Dashboard --chart-id chart_monthly_revenue # PLAN
386
+
387
+ # dashboard
388
+ mbs excel-worksheet dashboard manifest --doc-id abc123 --worksheet-name Dashboard --dashboard-id dash_revenue # PLAN
389
+ mbs excel-worksheet dashboard create-config --doc-id abc123 --worksheet-name Dashboard --name "Revenue Dashboard" --spec dashboard.json # PLAN
390
+ mbs excel-worksheet dashboard refresh --doc-id abc123 --worksheet-name Dashboard --dashboard-id dash_revenue # PLAN
391
+
392
+ # style
393
+ mbs excel-worksheet style freeze-panes --doc-id abc123 --worksheet-name Actuals --cell B2 # API
394
+ mbs excel-worksheet style conditional-formats set --doc-id abc123 --worksheet-name Actuals --spec conditional_formats.json # API
395
+
396
+ # image
397
+ mbs excel-worksheet image insert --doc-id abc123 --worksheet-name Dashboard --cell A1 --file logo.png # API
398
+
399
+ # version
400
+ mbs version list --doc-id abc123 --limit 10 # API
401
+ mbs version restore --doc-id abc123 --version-id v42 --dry-run # PLAN
402
+
403
+ # share
404
+ mbs share create --doc-id abc123 --email teammate@example.com --role viewer # API
405
+ ```
406
+
407
+ Refactor planning is tracked separately from this README:
408
+ `docs/superpowers/plans/2026-07-01-mbs-two-engine-command-refactor.md`.
409
+
410
+ Not recommended as first-class CLI commands:
411
+
412
+ ```text
413
+ validation create/update/delete PLAN
414
+ protection protect/unprotect PLAN
415
+ sort range/table PLAN
416
+ comment create/update/delete PLAN
417
+ named-range create/update/delete PLAN
418
+ macro/vba SKIP
419
+ power-query SKIP
420
+ power-pivot SKIP
421
+ workbook diff PLAN
422
+ dependency graph beyond cell lineage PLAN
423
+ ```
424
+
425
+ Relationship guide:
426
+
427
+ - Use `workbook` for file-level creation, upload/import, and manifest checks.
428
+ - Use `excel-worksheet read` for full worksheet used-range inspection.
429
+ - Use `excel-worksheet` for Excel tab lifecycle operations.
430
+ - Use `excel-worksheet range` for coordinate-based reads, writes, formulas, and
431
+ cell lineage.
432
+ - Use `excel-table` for worksheet-backed table views. One Excel worksheet can
433
+ contain multiple tables, so workbook metadata should expose simple ordinal
434
+ table ids such as `1`, `2`, `3`, and `4`, each mapped to the real worksheet
435
+ range behind the scenes. `excel-table` commands should accept optional
436
+ `--table-id`; when omitted, the CLI should default to `--table-id 1` only
437
+ inside an unambiguous worksheet target.
438
+ - Use `db-table` for PG/SheetTable-backed tables. These are not worksheet
439
+ ranges, so prefer human-readable `--name` or backend ids instead of worksheet
440
+ `--table-id`.
441
+ - Use `excel-worksheet row` and `excel-worksheet column` for structural
442
+ row/column changes.
443
+ - Use `excel-worksheet style` for worksheet layout operations like freeze
444
+ panes, filter ranges, widths, and heights.
445
+ - Use `excel-table style` when the same styling operation should be scoped to a
446
+ table's resolved worksheet range.
447
+ - Use `excel-worksheet chart` for CRUD, preview, and refresh of individual
448
+ source-backed visualizations before composing dashboards.
449
+ - Use `excel-worksheet dashboard` to compose chart ids/specs into BI asset or
450
+ dashboard worksheet lifecycles.
451
+ - Use `excel-worksheet image` for lower-level report workflows after routed
452
+ public API verification.
453
+ - Use `version` for workbook history inspection and restore.
454
+ - Use `share` for visibility and collaborator access.
455
+
456
+ Targeting notes:
457
+
458
+ - Most commands accept `--doc-id`, `--url`, or `--uri`.
459
+ - Prefer `--worksheet-name` when the backend route supports names.
460
+ - Use `--table-id` when operating on an `excel-table`. It is a simple ordinal
461
+ from workbook metadata, for example `--table-id 1`, and maps internally to
462
+ table metadata such as `worksheet_name` and `range`.
463
+ - Use `--name` or backend ids when operating on a `db-table`.
464
+ - Use `--gid` only when a route specifically requires gid targeting.
465
+
466
+ ## Input Rules
467
+
468
+ - Use `--doc-id`, `--url`, or `--uri` to identify a workbook.
469
+ - Use `--worksheet-name` when the endpoint supports it.
470
+ - Use `--table-id` when operating on an `excel-table`; default to `1` only when
471
+ the target worksheet is unambiguous.
472
+ - Use `--name` or backend ids when operating on a `db-table`.
473
+ - Use `--gid` for gid-specific sheet targeting.
474
+ - File inputs like `--rows`, `--values`, `--targets`, and `--operations` must be JSON.
475
+
476
+ ## Output
477
+
478
+ Default output is JSON. `table` is optimized for sheet-like payloads; `yaml` is also supported.
479
+
480
+ ## Development
481
+
482
+ ```bash
483
+ python3 -m venv .venv
484
+ . .venv/bin/activate
485
+ pip install -U pip
486
+ pip install -e .
487
+ ```
488
+
489
+ Run tests:
490
+
491
+ ```bash
492
+ python -m unittest discover -s tests -v
493
+ ```