fulfil-cli 0.1.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.
- fulfil_cli-0.1.0/PKG-INFO +291 -0
- fulfil_cli-0.1.0/README.md +261 -0
- fulfil_cli-0.1.0/pyproject.toml +117 -0
- fulfil_cli-0.1.0/src/fulfil_cli/__init__.py +3 -0
- fulfil_cli-0.1.0/src/fulfil_cli/__main__.py +5 -0
- fulfil_cli-0.1.0/src/fulfil_cli/auth/__init__.py +0 -0
- fulfil_cli-0.1.0/src/fulfil_cli/auth/api_key.py +76 -0
- fulfil_cli-0.1.0/src/fulfil_cli/auth/keyring_store.py +25 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/__init__.py +7 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/app.py +248 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/__init__.py +0 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/api.py +63 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/auth.py +167 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/completion.py +65 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/config.py +68 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/model.py +445 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/commands/report.py +229 -0
- fulfil_cli-0.1.0/src/fulfil_cli/cli/state.py +61 -0
- fulfil_cli-0.1.0/src/fulfil_cli/client/__init__.py +0 -0
- fulfil_cli-0.1.0/src/fulfil_cli/client/errors.py +121 -0
- fulfil_cli-0.1.0/src/fulfil_cli/client/http.py +164 -0
- fulfil_cli-0.1.0/src/fulfil_cli/config/__init__.py +0 -0
- fulfil_cli-0.1.0/src/fulfil_cli/config/manager.py +114 -0
- fulfil_cli-0.1.0/src/fulfil_cli/config/paths.py +29 -0
- fulfil_cli-0.1.0/src/fulfil_cli/output/__init__.py +0 -0
- fulfil_cli-0.1.0/src/fulfil_cli/output/describe.py +125 -0
- fulfil_cli-0.1.0/src/fulfil_cli/output/formatter.py +113 -0
- fulfil_cli-0.1.0/src/fulfil_cli/output/json_output.py +29 -0
- fulfil_cli-0.1.0/src/fulfil_cli/output/report.py +189 -0
- fulfil_cli-0.1.0/src/fulfil_cli/output/table.py +42 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fulfil-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The Fulfil CLI — primary interface for humans and AI agents
|
|
5
|
+
Keywords: fulfil,cli,erp,ecommerce
|
|
6
|
+
Author: Fulfil.IO
|
|
7
|
+
Author-email: Fulfil.IO <hello@fulfil.io>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Dist: typer>=0.12.0
|
|
19
|
+
Requires-Dist: rich>=13.0.0
|
|
20
|
+
Requires-Dist: httpx>=0.27.0
|
|
21
|
+
Requires-Dist: orjson>=3.10.0
|
|
22
|
+
Requires-Dist: keyring>=25.0.0
|
|
23
|
+
Requires-Dist: platformdirs>=4.0.0
|
|
24
|
+
Requires-Dist: tomli>=2.0.0 ; python_full_version < '3.11'
|
|
25
|
+
Requires-Dist: tomli-w>=1.0.0
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Project-URL: Homepage, https://github.com/fulfilio/fulfil-cli
|
|
28
|
+
Project-URL: Bug Tracker, https://github.com/fulfilio/fulfil-cli/issues
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# Fulfil CLI
|
|
32
|
+
|
|
33
|
+
The command-line interface for [Fulfil](https://fulfil.io) — query data, manage records, run reports, and automate workflows from the terminal.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Recommended: install with uv (https://docs.astral.sh/uv/)
|
|
39
|
+
uv tool install fulfil-cli
|
|
40
|
+
|
|
41
|
+
# Or with pipx
|
|
42
|
+
pipx install fulfil-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> **Don't have uv or pipx?** Install uv first — it's a single command:
|
|
46
|
+
> `curl -LsSf https://astral.sh/uv/install.sh | sh` (macOS/Linux) or
|
|
47
|
+
> `powershell -c "irm https://astral.sh/uv/install.ps1 | iex"` (Windows).
|
|
48
|
+
> Then run `uv tool install fulfil-cli`.
|
|
49
|
+
|
|
50
|
+
## Getting Started
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 1. Log in to your Fulfil workspace
|
|
54
|
+
fulfil auth login
|
|
55
|
+
|
|
56
|
+
# 2. List sales orders
|
|
57
|
+
fulfil sales_order list --fields reference,state,total_amount
|
|
58
|
+
|
|
59
|
+
# 3. Count products
|
|
60
|
+
fulfil product count
|
|
61
|
+
|
|
62
|
+
# 4. Look up a contact
|
|
63
|
+
fulfil contact list --where '{"name": "Acme Corp"}' --fields name,email
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Authentication
|
|
67
|
+
|
|
68
|
+
The CLI stores your API key in the system keyring (macOS Keychain, GNOME Keyring, Windows Credential Locker).
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Interactive — prompts for workspace and API key
|
|
72
|
+
fulfil auth login
|
|
73
|
+
|
|
74
|
+
# Non-interactive
|
|
75
|
+
fulfil auth login --workspace acme.fulfil.io --api-key sk_live_...
|
|
76
|
+
|
|
77
|
+
# Check current auth
|
|
78
|
+
fulfil auth status
|
|
79
|
+
|
|
80
|
+
# List all configured workspaces
|
|
81
|
+
fulfil workspaces
|
|
82
|
+
|
|
83
|
+
# Switch workspace
|
|
84
|
+
fulfil auth use other-workspace.fulfil.io
|
|
85
|
+
|
|
86
|
+
# Log out
|
|
87
|
+
fulfil auth logout
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Environment variables** (useful for CI/scripts):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
export FULFIL_API_KEY=sk_live_...
|
|
94
|
+
export FULFIL_WORKSPACE=acme.fulfil.io
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Priority: `--token` flag > `FULFIL_API_KEY` env var > system keyring.
|
|
98
|
+
|
|
99
|
+
## Working with Records
|
|
100
|
+
|
|
101
|
+
Any Fulfil model name is a valid command. Each model supports: `list`, `get`, `create`, `update`, `delete`, `count`, `call`, and `describe`.
|
|
102
|
+
|
|
103
|
+
### Listing records
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# List with specific fields
|
|
107
|
+
fulfil sales_order list --fields reference,state,total_amount
|
|
108
|
+
|
|
109
|
+
# Filter with MongoDB-style queries
|
|
110
|
+
fulfil sales_order list --where '{"state": "confirmed"}'
|
|
111
|
+
fulfil sales_order list --where '{"total_amount": {"gte": 1000}}'
|
|
112
|
+
fulfil sales_order list --where '{"or": [{"state": "draft"}, {"state": "confirmed"}]}'
|
|
113
|
+
|
|
114
|
+
# Sort results
|
|
115
|
+
fulfil sales_order list --order sale_date:desc
|
|
116
|
+
fulfil sales_order list --order total_amount:desc,reference:asc
|
|
117
|
+
|
|
118
|
+
# Control page size
|
|
119
|
+
fulfil sales_order list --limit 50
|
|
120
|
+
|
|
121
|
+
# Paginate — the CLI prints the full command for the next page
|
|
122
|
+
fulfil sales_order list --cursor <token-from-previous-response>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Available filter operators:** `gt`, `gte`, `lt`, `lte`, `ne`, `in`, `not_in`, `contains`, `startswith`, `endswith`.
|
|
126
|
+
|
|
127
|
+
### Getting records by ID
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
fulfil sales_order get 42
|
|
131
|
+
fulfil sales_order get 1,2,3
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Creating records
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Single record
|
|
138
|
+
fulfil contact create --data '{"name": "Acme Corp"}'
|
|
139
|
+
|
|
140
|
+
# Multiple records at once
|
|
141
|
+
fulfil contact create --data '[{"name": "Alice"}, {"name": "Bob"}]'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Updating records
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
fulfil sales_order update 42 --data '{"comment": "Approved by finance"}'
|
|
148
|
+
fulfil sales_order update 1,2,3 --data '{"state": "confirmed"}'
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Deleting records
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
fulfil sales_order delete 42 # asks for confirmation
|
|
155
|
+
fulfil sales_order delete 42 --yes # skip confirmation
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Counting records
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
fulfil product count
|
|
162
|
+
fulfil sales_order count --where '{"state": "draft"}'
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Calling custom methods
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
fulfil sales_order call confirm --ids 1,2,3
|
|
169
|
+
fulfil sales_order call process --ids 42 --data '{"warehouse": 1}'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Exploring models
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# List all models you have access to
|
|
176
|
+
fulfil models
|
|
177
|
+
|
|
178
|
+
# Search for models by name
|
|
179
|
+
fulfil models --search shipment
|
|
180
|
+
|
|
181
|
+
# See fields and endpoints for a model
|
|
182
|
+
fulfil sales_order describe
|
|
183
|
+
fulfil sales_order describe confirm
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Reports
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# List available reports
|
|
190
|
+
fulfil reports
|
|
191
|
+
|
|
192
|
+
# Run a report with parameters
|
|
193
|
+
fulfil reports price_list_report execute --params '{"date_from": "2024-01-01"}'
|
|
194
|
+
|
|
195
|
+
# Interactive — prompts for each parameter
|
|
196
|
+
fulfil reports price_list_report execute -i
|
|
197
|
+
|
|
198
|
+
# See what parameters a report accepts
|
|
199
|
+
fulfil reports price_list_report describe
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Raw JSON-RPC
|
|
203
|
+
|
|
204
|
+
For full control, send raw JSON-RPC requests:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
fulfil api '{"method": "system.version", "params": {}}'
|
|
208
|
+
|
|
209
|
+
# Pipe from stdin
|
|
210
|
+
echo '{"method": "model.product.count", "params": {}}' | fulfil api -
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Output
|
|
214
|
+
|
|
215
|
+
| Context | Format |
|
|
216
|
+
|---|---|
|
|
217
|
+
| Terminal | Rich tables with colors |
|
|
218
|
+
| Piped / redirected / CI | JSON (automatic) |
|
|
219
|
+
| `--json` flag | JSON (forced) |
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Force JSON and pipe to jq
|
|
223
|
+
fulfil sales_order list --fields reference,state --json | jq '.data[].reference'
|
|
224
|
+
|
|
225
|
+
# Force JSON via env var
|
|
226
|
+
FULFIL_JSON=1 fulfil sales_order list
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Configuration
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
fulfil config set key value
|
|
233
|
+
fulfil config get key
|
|
234
|
+
fulfil config list
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Config file location: `~/.config/fulfil/config.toml`
|
|
238
|
+
|
|
239
|
+
## Global Options
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
--token TEXT API key (overrides env and keyring)
|
|
243
|
+
--workspace TEXT Workspace domain (e.g. acme.fulfil.io)
|
|
244
|
+
--debug Show HTTP request/response details
|
|
245
|
+
--quiet, -q Suppress hints and decorative output
|
|
246
|
+
--json Force JSON output
|
|
247
|
+
-h, --help Show help
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Exit Codes
|
|
251
|
+
|
|
252
|
+
| Code | Meaning |
|
|
253
|
+
|---|---|
|
|
254
|
+
| `0` | Success |
|
|
255
|
+
| `2` | Bad arguments |
|
|
256
|
+
| `3` | Configuration error |
|
|
257
|
+
| `4` | Authentication error |
|
|
258
|
+
| `5` | Not found |
|
|
259
|
+
| `6` | Forbidden |
|
|
260
|
+
| `7` | Validation error |
|
|
261
|
+
| `8` | Rate limited |
|
|
262
|
+
| `9` | Server error |
|
|
263
|
+
| `10` | Network error |
|
|
264
|
+
|
|
265
|
+
## Shell Completion
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
fulfil completion # auto-detects zsh/bash/fish
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## AI Agent Integration
|
|
272
|
+
|
|
273
|
+
The CLI is designed for programmatic use:
|
|
274
|
+
|
|
275
|
+
- **JSON output by default** when stdout is piped or redirected
|
|
276
|
+
- **Structured exit codes** for error handling
|
|
277
|
+
- **Errors on stderr**, data on stdout — safe to parse stdout directly
|
|
278
|
+
- **Environment variable auth** — no interactive prompts: `FULFIL_API_KEY` + `FULFIL_WORKSPACE`
|
|
279
|
+
|
|
280
|
+
See [AGENTS.md](AGENTS.md) for the full agent guide.
|
|
281
|
+
|
|
282
|
+
## Development
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
git clone https://github.com/fulfilio/fulfil-cli.git
|
|
286
|
+
cd fulfil-cli
|
|
287
|
+
uv sync --dev
|
|
288
|
+
pytest
|
|
289
|
+
uv run ruff check .
|
|
290
|
+
uv run pre-commit install
|
|
291
|
+
```
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Fulfil CLI
|
|
2
|
+
|
|
3
|
+
The command-line interface for [Fulfil](https://fulfil.io) — query data, manage records, run reports, and automate workflows from the terminal.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Recommended: install with uv (https://docs.astral.sh/uv/)
|
|
9
|
+
uv tool install fulfil-cli
|
|
10
|
+
|
|
11
|
+
# Or with pipx
|
|
12
|
+
pipx install fulfil-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> **Don't have uv or pipx?** Install uv first — it's a single command:
|
|
16
|
+
> `curl -LsSf https://astral.sh/uv/install.sh | sh` (macOS/Linux) or
|
|
17
|
+
> `powershell -c "irm https://astral.sh/uv/install.ps1 | iex"` (Windows).
|
|
18
|
+
> Then run `uv tool install fulfil-cli`.
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 1. Log in to your Fulfil workspace
|
|
24
|
+
fulfil auth login
|
|
25
|
+
|
|
26
|
+
# 2. List sales orders
|
|
27
|
+
fulfil sales_order list --fields reference,state,total_amount
|
|
28
|
+
|
|
29
|
+
# 3. Count products
|
|
30
|
+
fulfil product count
|
|
31
|
+
|
|
32
|
+
# 4. Look up a contact
|
|
33
|
+
fulfil contact list --where '{"name": "Acme Corp"}' --fields name,email
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Authentication
|
|
37
|
+
|
|
38
|
+
The CLI stores your API key in the system keyring (macOS Keychain, GNOME Keyring, Windows Credential Locker).
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Interactive — prompts for workspace and API key
|
|
42
|
+
fulfil auth login
|
|
43
|
+
|
|
44
|
+
# Non-interactive
|
|
45
|
+
fulfil auth login --workspace acme.fulfil.io --api-key sk_live_...
|
|
46
|
+
|
|
47
|
+
# Check current auth
|
|
48
|
+
fulfil auth status
|
|
49
|
+
|
|
50
|
+
# List all configured workspaces
|
|
51
|
+
fulfil workspaces
|
|
52
|
+
|
|
53
|
+
# Switch workspace
|
|
54
|
+
fulfil auth use other-workspace.fulfil.io
|
|
55
|
+
|
|
56
|
+
# Log out
|
|
57
|
+
fulfil auth logout
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Environment variables** (useful for CI/scripts):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export FULFIL_API_KEY=sk_live_...
|
|
64
|
+
export FULFIL_WORKSPACE=acme.fulfil.io
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Priority: `--token` flag > `FULFIL_API_KEY` env var > system keyring.
|
|
68
|
+
|
|
69
|
+
## Working with Records
|
|
70
|
+
|
|
71
|
+
Any Fulfil model name is a valid command. Each model supports: `list`, `get`, `create`, `update`, `delete`, `count`, `call`, and `describe`.
|
|
72
|
+
|
|
73
|
+
### Listing records
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# List with specific fields
|
|
77
|
+
fulfil sales_order list --fields reference,state,total_amount
|
|
78
|
+
|
|
79
|
+
# Filter with MongoDB-style queries
|
|
80
|
+
fulfil sales_order list --where '{"state": "confirmed"}'
|
|
81
|
+
fulfil sales_order list --where '{"total_amount": {"gte": 1000}}'
|
|
82
|
+
fulfil sales_order list --where '{"or": [{"state": "draft"}, {"state": "confirmed"}]}'
|
|
83
|
+
|
|
84
|
+
# Sort results
|
|
85
|
+
fulfil sales_order list --order sale_date:desc
|
|
86
|
+
fulfil sales_order list --order total_amount:desc,reference:asc
|
|
87
|
+
|
|
88
|
+
# Control page size
|
|
89
|
+
fulfil sales_order list --limit 50
|
|
90
|
+
|
|
91
|
+
# Paginate — the CLI prints the full command for the next page
|
|
92
|
+
fulfil sales_order list --cursor <token-from-previous-response>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Available filter operators:** `gt`, `gte`, `lt`, `lte`, `ne`, `in`, `not_in`, `contains`, `startswith`, `endswith`.
|
|
96
|
+
|
|
97
|
+
### Getting records by ID
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
fulfil sales_order get 42
|
|
101
|
+
fulfil sales_order get 1,2,3
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Creating records
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Single record
|
|
108
|
+
fulfil contact create --data '{"name": "Acme Corp"}'
|
|
109
|
+
|
|
110
|
+
# Multiple records at once
|
|
111
|
+
fulfil contact create --data '[{"name": "Alice"}, {"name": "Bob"}]'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Updating records
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
fulfil sales_order update 42 --data '{"comment": "Approved by finance"}'
|
|
118
|
+
fulfil sales_order update 1,2,3 --data '{"state": "confirmed"}'
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Deleting records
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
fulfil sales_order delete 42 # asks for confirmation
|
|
125
|
+
fulfil sales_order delete 42 --yes # skip confirmation
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Counting records
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
fulfil product count
|
|
132
|
+
fulfil sales_order count --where '{"state": "draft"}'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Calling custom methods
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
fulfil sales_order call confirm --ids 1,2,3
|
|
139
|
+
fulfil sales_order call process --ids 42 --data '{"warehouse": 1}'
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Exploring models
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# List all models you have access to
|
|
146
|
+
fulfil models
|
|
147
|
+
|
|
148
|
+
# Search for models by name
|
|
149
|
+
fulfil models --search shipment
|
|
150
|
+
|
|
151
|
+
# See fields and endpoints for a model
|
|
152
|
+
fulfil sales_order describe
|
|
153
|
+
fulfil sales_order describe confirm
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Reports
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# List available reports
|
|
160
|
+
fulfil reports
|
|
161
|
+
|
|
162
|
+
# Run a report with parameters
|
|
163
|
+
fulfil reports price_list_report execute --params '{"date_from": "2024-01-01"}'
|
|
164
|
+
|
|
165
|
+
# Interactive — prompts for each parameter
|
|
166
|
+
fulfil reports price_list_report execute -i
|
|
167
|
+
|
|
168
|
+
# See what parameters a report accepts
|
|
169
|
+
fulfil reports price_list_report describe
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Raw JSON-RPC
|
|
173
|
+
|
|
174
|
+
For full control, send raw JSON-RPC requests:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
fulfil api '{"method": "system.version", "params": {}}'
|
|
178
|
+
|
|
179
|
+
# Pipe from stdin
|
|
180
|
+
echo '{"method": "model.product.count", "params": {}}' | fulfil api -
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Output
|
|
184
|
+
|
|
185
|
+
| Context | Format |
|
|
186
|
+
|---|---|
|
|
187
|
+
| Terminal | Rich tables with colors |
|
|
188
|
+
| Piped / redirected / CI | JSON (automatic) |
|
|
189
|
+
| `--json` flag | JSON (forced) |
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# Force JSON and pipe to jq
|
|
193
|
+
fulfil sales_order list --fields reference,state --json | jq '.data[].reference'
|
|
194
|
+
|
|
195
|
+
# Force JSON via env var
|
|
196
|
+
FULFIL_JSON=1 fulfil sales_order list
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Configuration
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
fulfil config set key value
|
|
203
|
+
fulfil config get key
|
|
204
|
+
fulfil config list
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Config file location: `~/.config/fulfil/config.toml`
|
|
208
|
+
|
|
209
|
+
## Global Options
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
--token TEXT API key (overrides env and keyring)
|
|
213
|
+
--workspace TEXT Workspace domain (e.g. acme.fulfil.io)
|
|
214
|
+
--debug Show HTTP request/response details
|
|
215
|
+
--quiet, -q Suppress hints and decorative output
|
|
216
|
+
--json Force JSON output
|
|
217
|
+
-h, --help Show help
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Exit Codes
|
|
221
|
+
|
|
222
|
+
| Code | Meaning |
|
|
223
|
+
|---|---|
|
|
224
|
+
| `0` | Success |
|
|
225
|
+
| `2` | Bad arguments |
|
|
226
|
+
| `3` | Configuration error |
|
|
227
|
+
| `4` | Authentication error |
|
|
228
|
+
| `5` | Not found |
|
|
229
|
+
| `6` | Forbidden |
|
|
230
|
+
| `7` | Validation error |
|
|
231
|
+
| `8` | Rate limited |
|
|
232
|
+
| `9` | Server error |
|
|
233
|
+
| `10` | Network error |
|
|
234
|
+
|
|
235
|
+
## Shell Completion
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
fulfil completion # auto-detects zsh/bash/fish
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## AI Agent Integration
|
|
242
|
+
|
|
243
|
+
The CLI is designed for programmatic use:
|
|
244
|
+
|
|
245
|
+
- **JSON output by default** when stdout is piped or redirected
|
|
246
|
+
- **Structured exit codes** for error handling
|
|
247
|
+
- **Errors on stderr**, data on stdout — safe to parse stdout directly
|
|
248
|
+
- **Environment variable auth** — no interactive prompts: `FULFIL_API_KEY` + `FULFIL_WORKSPACE`
|
|
249
|
+
|
|
250
|
+
See [AGENTS.md](AGENTS.md) for the full agent guide.
|
|
251
|
+
|
|
252
|
+
## Development
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
git clone https://github.com/fulfilio/fulfil-cli.git
|
|
256
|
+
cd fulfil-cli
|
|
257
|
+
uv sync --dev
|
|
258
|
+
pytest
|
|
259
|
+
uv run ruff check .
|
|
260
|
+
uv run pre-commit install
|
|
261
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.10.4,<0.11.0"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fulfil-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "The Fulfil CLI — primary interface for humans and AI agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [{ name = "Fulfil.IO", email = "hello@fulfil.io" }]
|
|
13
|
+
keywords = ["fulfil", "cli", "erp", "ecommerce"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"typer>=0.12.0",
|
|
27
|
+
"rich>=13.0.0",
|
|
28
|
+
"httpx>=0.27.0",
|
|
29
|
+
"orjson>=3.10.0",
|
|
30
|
+
"keyring>=25.0.0",
|
|
31
|
+
"platformdirs>=4.0.0",
|
|
32
|
+
"tomli>=2.0.0; python_version < '3.11'",
|
|
33
|
+
"tomli-w>=1.0.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.scripts]
|
|
37
|
+
fulfil = "fulfil_cli.cli:main"
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/fulfilio/fulfil-cli"
|
|
41
|
+
"Bug Tracker" = "https://github.com/fulfilio/fulfil-cli/issues"
|
|
42
|
+
|
|
43
|
+
[dependency-groups]
|
|
44
|
+
dev = [
|
|
45
|
+
"pytest>=8.0.0",
|
|
46
|
+
"pytest-httpx>=0.30.0",
|
|
47
|
+
"pytest-cov>=6.0.0",
|
|
48
|
+
"coverage[toml]>=7.0.0",
|
|
49
|
+
"ruff>=0.4.0",
|
|
50
|
+
"pre-commit>=3.7.0",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[tool.uv.build-backend]
|
|
54
|
+
module-name = "fulfil_cli"
|
|
55
|
+
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
testpaths = ["tests"]
|
|
58
|
+
pythonpath = ["src"]
|
|
59
|
+
addopts = [
|
|
60
|
+
"--strict-markers",
|
|
61
|
+
"--strict-config",
|
|
62
|
+
"-ra",
|
|
63
|
+
]
|
|
64
|
+
xfail_strict = true
|
|
65
|
+
|
|
66
|
+
[tool.ruff]
|
|
67
|
+
target-version = "py310"
|
|
68
|
+
line-length = 100
|
|
69
|
+
|
|
70
|
+
[tool.ruff.lint]
|
|
71
|
+
select = [
|
|
72
|
+
"E", # pycodestyle errors
|
|
73
|
+
"W", # pycodestyle warnings
|
|
74
|
+
"F", # pyflakes
|
|
75
|
+
"I", # isort
|
|
76
|
+
"N", # pep8-naming
|
|
77
|
+
"UP", # pyupgrade
|
|
78
|
+
"B", # flake8-bugbear
|
|
79
|
+
"C4", # flake8-comprehensions
|
|
80
|
+
"SIM", # flake8-simplify
|
|
81
|
+
"RUF", # ruff-specific
|
|
82
|
+
"PTH", # flake8-use-pathlib
|
|
83
|
+
"PERF", # perflint
|
|
84
|
+
"ISC", # implicit-str-concat
|
|
85
|
+
]
|
|
86
|
+
ignore = [
|
|
87
|
+
"B008", # function-call-in-default-argument — Typer uses this pattern
|
|
88
|
+
"ISC001", # conflicts with ruff formatter
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[tool.ruff.lint.per-file-ignores]
|
|
92
|
+
"tests/**/*.py" = [
|
|
93
|
+
"S101", # allow assert
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[tool.ruff.lint.isort]
|
|
97
|
+
known-first-party = ["fulfil_cli"]
|
|
98
|
+
|
|
99
|
+
[tool.coverage.run]
|
|
100
|
+
source = ["fulfil_cli"]
|
|
101
|
+
branch = true
|
|
102
|
+
parallel = true
|
|
103
|
+
|
|
104
|
+
[tool.coverage.report]
|
|
105
|
+
show_missing = true
|
|
106
|
+
exclude_lines = [
|
|
107
|
+
"pragma: no cover",
|
|
108
|
+
"if TYPE_CHECKING:",
|
|
109
|
+
"raise NotImplementedError",
|
|
110
|
+
"@(abc\\.)?abstractmethod",
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
[tool.coverage.paths]
|
|
114
|
+
source = [
|
|
115
|
+
"src/",
|
|
116
|
+
"*/site-packages/",
|
|
117
|
+
]
|
|
File without changes
|