maybeai-sheet-cli 0.3.0__tar.gz → 0.3.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.
- maybeai_sheet_cli-0.3.2/PKG-INFO +248 -0
- maybeai_sheet_cli-0.3.2/README.md +224 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/cli-packaging-plan.md +29 -29
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/cli-plan.md +26 -26
- maybeai_sheet_cli-0.3.2/docs/agent-friendly-command-tree.md +1245 -0
- maybeai_sheet_cli-0.3.2/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-command-tree.md +1270 -0
- maybeai_sheet_cli-0.3.2/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-phase-2-routes.md +50 -0
- maybeai_sheet_cli-0.3.2/docs/superpowers/plans/2026-07-01-mbs-agent-friendly-phase-2.md +713 -0
- maybeai_sheet_cli-0.3.2/docs/superpowers/reports/2026-07-01-phase1-test-review.html +326 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/pyproject.toml +2 -2
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/__init__.py +1 -1
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/cli.py +8 -0
- maybeai_sheet_cli-0.3.2/src/maybeai_sheet/commands/formula.py +133 -0
- maybeai_sheet_cli-0.3.2/src/maybeai_sheet/commands/range.py +108 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/commands/sheet.py +1 -0
- maybeai_sheet_cli-0.3.2/src/maybeai_sheet/commands/table.py +112 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/commands/workbook.py +29 -0
- maybeai_sheet_cli-0.3.2/src/maybeai_sheet/commands/worksheet.py +65 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/update.py +2 -2
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/tests/test_cli.py +328 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/tests/test_update.py +1 -1
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/uv.lock +1 -1
- maybeai_sheet_cli-0.3.0/PKG-INFO +0 -194
- maybeai_sheet_cli-0.3.0/README.md +0 -170
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/.claude/settings.local.json +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/.gitignore +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/CLAUDE.md +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/docs/verification-matrix-fallback.md +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/client.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/commands/__init__.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/commands/raw.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/commands/share.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/config.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/errors.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/formatters.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/models/__init__.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/models/share.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/models/sheet.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/models/workbook.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/options.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/src/maybeai_sheet/resolver.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/tests/test_formatters.py +0 -0
- {maybeai_sheet_cli-0.3.0 → maybeai_sheet_cli-0.3.2}/tests/test_resolver.py +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: maybeai-sheet-cli
|
|
3
|
+
Version: 0.3.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
|
+
## Quick Start
|
|
92
|
+
|
|
93
|
+
Read a bounded range:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mbs range read --doc-id abc123 --worksheet-name Sheet1 --range A1:D20
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
List worksheets:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
mbs worksheet list --doc-id abc123
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Read headers from a worksheet:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
mbs table headers --doc-id abc123 --gid 3
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Create a workbook:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
mbs workbook create --title "Board Pack"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Upload a workbook-style `.xlsx` through the default Excelize path:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mbs workbook import ./report.xlsx
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Import a large table-like `.xlsx` into SheetTable/PG:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
mbs workbook import ./large-table.xlsx --engine postgres
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Append rows and verify:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
mbs table append-rows --doc-id abc123 --gid 3 --rows rows.json --verify
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Make a workbook public for viewers:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
mbs share visibility --doc-id abc123 --visibility public --public-permission viewer
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Commands
|
|
142
|
+
|
|
143
|
+
The preferred command groups are `workbook`, `worksheet`, `range`, `table`,
|
|
144
|
+
`formula`, `share`, and `raw`. The older `sheet ...` commands remain available
|
|
145
|
+
as compatibility aliases.
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
mbs
|
|
149
|
+
├── update
|
|
150
|
+
│ └── Update maybeai-sheet-cli from PyPI.
|
|
151
|
+
│
|
|
152
|
+
├── workbook
|
|
153
|
+
│ ├── create Create a new workbook.
|
|
154
|
+
│ ├── create-from-file Upload/import an .xlsx file.
|
|
155
|
+
│ ├── import Preferred alias for create-from-file.
|
|
156
|
+
│ ├── manifest Inspect workbook profile and routing metadata.
|
|
157
|
+
│ └── capabilities Inspect workbook capability/profile metadata.
|
|
158
|
+
│
|
|
159
|
+
├── worksheet
|
|
160
|
+
│ ├── list List worksheets in a workbook.
|
|
161
|
+
│ └── create Create a worksheet, optionally with starter values.
|
|
162
|
+
│
|
|
163
|
+
├── range
|
|
164
|
+
│ ├── read Read a bounded A1 range.
|
|
165
|
+
│ ├── write Write a JSON matrix into an A1 range.
|
|
166
|
+
│ └── clear Clear an A1 range.
|
|
167
|
+
│
|
|
168
|
+
├── table
|
|
169
|
+
│ ├── headers Read header row metadata.
|
|
170
|
+
│ ├── append-rows Append JSON row objects.
|
|
171
|
+
│ └── upsert-rows Upsert JSON row objects by key.
|
|
172
|
+
│
|
|
173
|
+
├── formula
|
|
174
|
+
│ ├── read Read formulas with FORMULA render mode.
|
|
175
|
+
│ ├── set Set one formula cell.
|
|
176
|
+
│ ├── batch-set Set formula ranges from a JSON operations file.
|
|
177
|
+
│ └── recalculate Recalculate formulas for a worksheet/workbook.
|
|
178
|
+
│
|
|
179
|
+
├── share
|
|
180
|
+
│ ├── visibility Set workbook visibility.
|
|
181
|
+
│ ├── grant Grant a user permission.
|
|
182
|
+
│ ├── permission Read current permission.
|
|
183
|
+
│ ├── remove Remove a user's access.
|
|
184
|
+
│ └── list List sharing entries.
|
|
185
|
+
│
|
|
186
|
+
├── raw
|
|
187
|
+
│ └── post Low-level POST escape hatch for routed API paths.
|
|
188
|
+
│
|
|
189
|
+
└── sheet Legacy compatibility aliases.
|
|
190
|
+
├── read
|
|
191
|
+
├── read-range
|
|
192
|
+
├── read-many
|
|
193
|
+
├── named-range
|
|
194
|
+
├── headers
|
|
195
|
+
├── worksheets
|
|
196
|
+
├── formulas
|
|
197
|
+
├── write-range
|
|
198
|
+
├── clear-range
|
|
199
|
+
├── append
|
|
200
|
+
├── upsert
|
|
201
|
+
├── formula-set
|
|
202
|
+
├── formula-batch-set
|
|
203
|
+
├── recalculate
|
|
204
|
+
└── create-worksheet
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Relationship guide:
|
|
208
|
+
|
|
209
|
+
- Use `workbook` for file-level creation, upload/import, and manifest checks.
|
|
210
|
+
- Use `worksheet` for tab lifecycle operations.
|
|
211
|
+
- Use `range` for coordinate-based reads and writes.
|
|
212
|
+
- Use `table` when data is row-object shaped and keyed by headers.
|
|
213
|
+
- Use `formula` when preserving or changing formulas matters.
|
|
214
|
+
- Use `share` for visibility and collaborator access.
|
|
215
|
+
- Use `raw post` only when a first-class command does not exist yet.
|
|
216
|
+
|
|
217
|
+
Targeting notes:
|
|
218
|
+
|
|
219
|
+
- Most commands accept `--doc-id`, `--url`, or `--uri`.
|
|
220
|
+
- Prefer `--worksheet-name` when the backend route supports names.
|
|
221
|
+
- Use `--gid` for gid-specific table operations; live verification showed
|
|
222
|
+
`table upsert-rows` is safest with `--gid`.
|
|
223
|
+
|
|
224
|
+
## Input Rules
|
|
225
|
+
|
|
226
|
+
- Use `--doc-id`, `--url`, or `--uri` to identify a workbook.
|
|
227
|
+
- Use `--worksheet-name` when the endpoint supports it.
|
|
228
|
+
- Use `--gid` for gid-specific sheet targeting.
|
|
229
|
+
- File inputs like `--rows`, `--values`, `--targets`, and `--operations` must be JSON.
|
|
230
|
+
|
|
231
|
+
## Output
|
|
232
|
+
|
|
233
|
+
Default output is JSON. `table` is optimized for sheet-like payloads; `yaml` is also supported.
|
|
234
|
+
|
|
235
|
+
## Development
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
python3 -m venv .venv
|
|
239
|
+
. .venv/bin/activate
|
|
240
|
+
pip install -U pip
|
|
241
|
+
pip install -e .
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Run tests:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
python -m unittest discover -s tests -v
|
|
248
|
+
```
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# maybeai-sheet-cli
|
|
2
|
+
|
|
3
|
+
CLI for MaybeAI spreadsheet operations.
|
|
4
|
+
|
|
5
|
+
`mbs` wraps the MaybeAI spreadsheet HTTP APIs behind a stable command-line interface for humans, CI jobs, and agents.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
On Debian/Ubuntu and other **PEP 668** systems, do **not** use bare `pip install` on system Python. Use **pipx** (recommended for CLIs):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
sudo apt install -y pipx python3-venv
|
|
13
|
+
pipx ensurepath
|
|
14
|
+
# re-login or: source ~/.bashrc
|
|
15
|
+
|
|
16
|
+
pipx install maybeai-sheet-cli
|
|
17
|
+
mbs --version
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
For local venvs or macOS/dev machines, plain pip is fine:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install maybeai-sheet-cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Upgrade to the latest release:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
mbs update # when installed via pip or pipx
|
|
30
|
+
pipx upgrade maybeai-sheet-cli # alternative on pipx installs
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Install a specific version:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
mbs update --version 0.3.2
|
|
37
|
+
pipx install maybeai-sheet-cli==0.3.2 --force # pipx reinstall pin
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Uninstall:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pipx uninstall maybeai-sheet-cli
|
|
44
|
+
# not: pip uninstall -U (-U is invalid for uninstall)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
- Python 3.10+
|
|
50
|
+
- `MAYBEAI_API_TOKEN`
|
|
51
|
+
|
|
52
|
+
## Configure
|
|
53
|
+
|
|
54
|
+
Set your API token:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
export MAYBEAI_API_TOKEN="YOUR_TOKEN"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Optional global flags:
|
|
61
|
+
|
|
62
|
+
- `--base-url` to point at a different MaybeAI API host
|
|
63
|
+
- `--output json|table|yaml`
|
|
64
|
+
- `--timeout <seconds>`
|
|
65
|
+
- `--verbose`
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
Read a bounded range:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mbs range read --doc-id abc123 --worksheet-name Sheet1 --range A1:D20
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
List worksheets:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
mbs worksheet list --doc-id abc123
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Read headers from a worksheet:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
mbs table headers --doc-id abc123 --gid 3
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Create a workbook:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mbs workbook create --title "Board Pack"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Upload a workbook-style `.xlsx` through the default Excelize path:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mbs workbook import ./report.xlsx
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Import a large table-like `.xlsx` into SheetTable/PG:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
mbs workbook import ./large-table.xlsx --engine postgres
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Append rows and verify:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
mbs table append-rows --doc-id abc123 --gid 3 --rows rows.json --verify
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Make a workbook public for viewers:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
mbs share visibility --doc-id abc123 --visibility public --public-permission viewer
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Commands
|
|
118
|
+
|
|
119
|
+
The preferred command groups are `workbook`, `worksheet`, `range`, `table`,
|
|
120
|
+
`formula`, `share`, and `raw`. The older `sheet ...` commands remain available
|
|
121
|
+
as compatibility aliases.
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
mbs
|
|
125
|
+
├── update
|
|
126
|
+
│ └── Update maybeai-sheet-cli from PyPI.
|
|
127
|
+
│
|
|
128
|
+
├── workbook
|
|
129
|
+
│ ├── create Create a new workbook.
|
|
130
|
+
│ ├── create-from-file Upload/import an .xlsx file.
|
|
131
|
+
│ ├── import Preferred alias for create-from-file.
|
|
132
|
+
│ ├── manifest Inspect workbook profile and routing metadata.
|
|
133
|
+
│ └── capabilities Inspect workbook capability/profile metadata.
|
|
134
|
+
│
|
|
135
|
+
├── worksheet
|
|
136
|
+
│ ├── list List worksheets in a workbook.
|
|
137
|
+
│ └── create Create a worksheet, optionally with starter values.
|
|
138
|
+
│
|
|
139
|
+
├── range
|
|
140
|
+
│ ├── read Read a bounded A1 range.
|
|
141
|
+
│ ├── write Write a JSON matrix into an A1 range.
|
|
142
|
+
│ └── clear Clear an A1 range.
|
|
143
|
+
│
|
|
144
|
+
├── table
|
|
145
|
+
│ ├── headers Read header row metadata.
|
|
146
|
+
│ ├── append-rows Append JSON row objects.
|
|
147
|
+
│ └── upsert-rows Upsert JSON row objects by key.
|
|
148
|
+
│
|
|
149
|
+
├── formula
|
|
150
|
+
│ ├── read Read formulas with FORMULA render mode.
|
|
151
|
+
│ ├── set Set one formula cell.
|
|
152
|
+
│ ├── batch-set Set formula ranges from a JSON operations file.
|
|
153
|
+
│ └── recalculate Recalculate formulas for a worksheet/workbook.
|
|
154
|
+
│
|
|
155
|
+
├── share
|
|
156
|
+
│ ├── visibility Set workbook visibility.
|
|
157
|
+
│ ├── grant Grant a user permission.
|
|
158
|
+
│ ├── permission Read current permission.
|
|
159
|
+
│ ├── remove Remove a user's access.
|
|
160
|
+
│ └── list List sharing entries.
|
|
161
|
+
│
|
|
162
|
+
├── raw
|
|
163
|
+
│ └── post Low-level POST escape hatch for routed API paths.
|
|
164
|
+
│
|
|
165
|
+
└── sheet Legacy compatibility aliases.
|
|
166
|
+
├── read
|
|
167
|
+
├── read-range
|
|
168
|
+
├── read-many
|
|
169
|
+
├── named-range
|
|
170
|
+
├── headers
|
|
171
|
+
├── worksheets
|
|
172
|
+
├── formulas
|
|
173
|
+
├── write-range
|
|
174
|
+
├── clear-range
|
|
175
|
+
├── append
|
|
176
|
+
├── upsert
|
|
177
|
+
├── formula-set
|
|
178
|
+
├── formula-batch-set
|
|
179
|
+
├── recalculate
|
|
180
|
+
└── create-worksheet
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Relationship guide:
|
|
184
|
+
|
|
185
|
+
- Use `workbook` for file-level creation, upload/import, and manifest checks.
|
|
186
|
+
- Use `worksheet` for tab lifecycle operations.
|
|
187
|
+
- Use `range` for coordinate-based reads and writes.
|
|
188
|
+
- Use `table` when data is row-object shaped and keyed by headers.
|
|
189
|
+
- Use `formula` when preserving or changing formulas matters.
|
|
190
|
+
- Use `share` for visibility and collaborator access.
|
|
191
|
+
- Use `raw post` only when a first-class command does not exist yet.
|
|
192
|
+
|
|
193
|
+
Targeting notes:
|
|
194
|
+
|
|
195
|
+
- Most commands accept `--doc-id`, `--url`, or `--uri`.
|
|
196
|
+
- Prefer `--worksheet-name` when the backend route supports names.
|
|
197
|
+
- Use `--gid` for gid-specific table operations; live verification showed
|
|
198
|
+
`table upsert-rows` is safest with `--gid`.
|
|
199
|
+
|
|
200
|
+
## Input Rules
|
|
201
|
+
|
|
202
|
+
- Use `--doc-id`, `--url`, or `--uri` to identify a workbook.
|
|
203
|
+
- Use `--worksheet-name` when the endpoint supports it.
|
|
204
|
+
- Use `--gid` for gid-specific sheet targeting.
|
|
205
|
+
- File inputs like `--rows`, `--values`, `--targets`, and `--operations` must be JSON.
|
|
206
|
+
|
|
207
|
+
## Output
|
|
208
|
+
|
|
209
|
+
Default output is JSON. `table` is optimized for sheet-like payloads; `yaml` is also supported.
|
|
210
|
+
|
|
211
|
+
## Development
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
python3 -m venv .venv
|
|
215
|
+
. .venv/bin/activate
|
|
216
|
+
pip install -U pip
|
|
217
|
+
pip install -e .
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Run tests:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
python -m unittest discover -s tests -v
|
|
224
|
+
```
|
|
@@ -44,16 +44,16 @@ A CLI improves:
|
|
|
44
44
|
|
|
45
45
|
## Product Scope
|
|
46
46
|
|
|
47
|
-
Package
|
|
47
|
+
Package identity:
|
|
48
48
|
|
|
49
|
-
- `maybeai-sheet`
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
49
|
+
- distribution name: `maybeai-sheet-cli`
|
|
50
|
+
- executable: `mbs`
|
|
51
|
+
- import package: `maybeai_sheet`
|
|
52
52
|
|
|
53
53
|
Recommended executable:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
mbs
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Recommended Python baseline:
|
|
@@ -70,7 +70,7 @@ Recommended implementation:
|
|
|
70
70
|
## CLI Shape
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
|
|
73
|
+
mbs [global options] <resource> <command> [command options]
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
Global options:
|
|
@@ -96,40 +96,40 @@ Resolution rules:
|
|
|
96
96
|
### Read path
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
mbs sheet read --doc-id <id> --worksheet-name Sheet1
|
|
100
|
+
mbs sheet read --doc-id <id> --worksheet-name Sheet1 --range A1:C20
|
|
101
|
+
mbs sheet read-many --doc-id <id> --targets targets.json
|
|
102
|
+
mbs sheet named-range --doc-id <id> --name RevenueBlock
|
|
103
|
+
mbs sheet headers --doc-id <id> --gid 0
|
|
104
|
+
mbs sheet worksheets --doc-id <id>
|
|
105
|
+
mbs sheet profile --doc-id <id> --force-refresh
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
### Write path
|
|
109
109
|
|
|
110
110
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
mbs sheet append --doc-id <id> --gid 0 --rows rows.json
|
|
112
|
+
mbs sheet upsert --doc-id <id> --gid 0 --key OrderID --rows rows.json
|
|
113
|
+
mbs sheet write-range --doc-id <id> --worksheet-name Sheet1 --range A1:C3 --values values.json
|
|
114
|
+
mbs sheet clear-range --doc-id <id> --worksheet-name Sheet1 --range A1:C3
|
|
115
|
+
mbs sheet create-worksheet --doc-id <id> --name Summary --values values.json
|
|
116
|
+
mbs sheet formula-set --doc-id <id> --worksheet-name Sheet1 --cell E2 --formula '=SUM(B2:D2)'
|
|
117
|
+
mbs sheet formula-batch-set --doc-id <id> --operations ops.json --recalculate-mode worksheet
|
|
118
|
+
mbs sheet recalculate --doc-id <id> --worksheet-name Sheet1
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
### File path
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
mbs file upload ./report.xlsx
|
|
125
|
+
mbs file export --doc-id <id> --out final.xlsx
|
|
126
|
+
mbs file search "q2 forecast"
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### Escape hatch
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
|
-
|
|
132
|
+
mbs raw post /api/v3/excel/range/read --body body.json
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
The `raw` command prevents CLI growth from tracking every niche endpoint.
|
|
@@ -173,7 +173,7 @@ The CLI should encode the operational rules already documented in this repo:
|
|
|
173
173
|
Example:
|
|
174
174
|
|
|
175
175
|
```bash
|
|
176
|
-
|
|
176
|
+
mbs sheet upsert \
|
|
177
177
|
--doc-id $DOC_ID \
|
|
178
178
|
--gid 0 \
|
|
179
179
|
--key OrderID \
|
|
@@ -206,14 +206,14 @@ Use a console script entry point:
|
|
|
206
206
|
|
|
207
207
|
```toml
|
|
208
208
|
[project]
|
|
209
|
-
name = "maybeai-sheet"
|
|
210
|
-
version = "0.
|
|
209
|
+
name = "maybeai-sheet-cli"
|
|
210
|
+
version = "0.3.0"
|
|
211
211
|
description = "CLI for common MaybeAI spreadsheet operations"
|
|
212
212
|
requires-python = ">=3.10"
|
|
213
213
|
dependencies = ["typer", "httpx", "pydantic", "rich"]
|
|
214
214
|
|
|
215
215
|
[project.scripts]
|
|
216
|
-
|
|
216
|
+
mbs = "maybeai_sheet.cli:app"
|
|
217
217
|
```
|
|
218
218
|
|
|
219
219
|
Build backend:
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Goal
|
|
4
4
|
|
|
5
|
-
Add a stable `
|
|
5
|
+
Add a stable `mbs` CLI in front of the existing curl-first skill so agents and humans can invoke the highest-value spreadsheet operations without dynamically generating shell or Python glue.
|
|
6
6
|
|
|
7
7
|
This plan intentionally focuses on the most useful commands first and does not include `rename_worksheet`.
|
|
8
8
|
|
|
9
9
|
Repository naming:
|
|
10
10
|
|
|
11
11
|
- project directory: `maybeai-sheet-cli`
|
|
12
|
-
- installed executable: `
|
|
12
|
+
- installed executable: `mbs`
|
|
13
13
|
- import package: `maybeai_sheet`
|
|
14
14
|
|
|
15
15
|
## Why This CLI Should Exist
|
|
@@ -41,13 +41,13 @@ The target behavior is:
|
|
|
41
41
|
Recommended executable:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
|
|
44
|
+
mbs
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Recommended package identity:
|
|
48
48
|
|
|
49
|
-
- distribution name: `maybeai-sheet-cli`
|
|
50
|
-
- console script: `
|
|
49
|
+
- distribution name: `maybeai-sheet-cli`
|
|
50
|
+
- console script: `mbs`
|
|
51
51
|
- Python module: `maybeai_sheet`
|
|
52
52
|
|
|
53
53
|
Recommended baseline:
|
|
@@ -89,7 +89,7 @@ Not in the top 10 for this phase:
|
|
|
89
89
|
## CLI Shape
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
|
|
92
|
+
mbs [global options] <resource> <command> [command options]
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
Proposed high-level groups:
|
|
@@ -101,14 +101,14 @@ Proposed high-level groups:
|
|
|
101
101
|
Example command style:
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
mbs workbook create --title "Q2 Review"
|
|
105
|
+
mbs sheet read --url "$URL"
|
|
106
|
+
mbs sheet read-range --doc-id "$DOC_ID" --gid 3 --range A1:G20
|
|
107
|
+
mbs sheet headers --doc-id "$DOC_ID" --worksheet-name "利润分析"
|
|
108
|
+
mbs sheet append --doc-id "$DOC_ID" --gid 2 --rows rows.json
|
|
109
|
+
mbs sheet clear-range --doc-id "$DOC_ID" --worksheet-name Summary --range D1:F10
|
|
110
|
+
mbs sheet formula-set --doc-id "$DOC_ID" --worksheet-name Model --cell E2 --formula "=SUM(B2:D2)"
|
|
111
|
+
mbs sheet recalculate --doc-id "$DOC_ID" --worksheet-name Model
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
## Global Flags
|
|
@@ -159,8 +159,8 @@ Validation rules:
|
|
|
159
159
|
### Workbook Commands
|
|
160
160
|
|
|
161
161
|
```bash
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
mbs workbook create --title "Board Pack"
|
|
163
|
+
mbs workbook create --title "Board Pack" --sheet-name Summary
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
Primary responsibility:
|
|
@@ -172,11 +172,11 @@ Primary responsibility:
|
|
|
172
172
|
### Sheet Read Commands
|
|
173
173
|
|
|
174
174
|
```bash
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
mbs sheet read --doc-id "$DOC_ID" --worksheet-name Sheet1
|
|
176
|
+
mbs sheet read-range --doc-id "$DOC_ID" --gid 3 --range A1:G20
|
|
177
|
+
mbs sheet headers --doc-id "$DOC_ID" --gid 3
|
|
178
|
+
mbs sheet worksheets --doc-id "$DOC_ID"
|
|
179
|
+
mbs sheet formulas --doc-id "$DOC_ID" --worksheet-name Model
|
|
180
180
|
```
|
|
181
181
|
|
|
182
182
|
Responsibilities:
|
|
@@ -190,10 +190,10 @@ Responsibilities:
|
|
|
190
190
|
### Sheet Write Commands
|
|
191
191
|
|
|
192
192
|
```bash
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
mbs sheet write-range --doc-id "$DOC_ID" --worksheet-name Summary --range A1:C3 --values values.json
|
|
194
|
+
mbs sheet append --doc-id "$DOC_ID" --gid 2 --rows rows.json
|
|
195
|
+
mbs sheet upsert --doc-id "$DOC_ID" --gid 2 --key order_id --rows rows.json
|
|
196
|
+
mbs sheet create-worksheet --doc-id "$DOC_ID" --worksheet-name Summary --values values.json
|
|
197
197
|
```
|
|
198
198
|
|
|
199
199
|
Responsibilities:
|
|
@@ -244,7 +244,7 @@ The CLI should encode the operational rules already documented in the skill.
|
|
|
244
244
|
Example:
|
|
245
245
|
|
|
246
246
|
```bash
|
|
247
|
-
|
|
247
|
+
mbs sheet append \
|
|
248
248
|
--doc-id "$DOC_ID" \
|
|
249
249
|
--gid 3 \
|
|
250
250
|
--rows rows.json \
|