gufi-cli 0.1.49 → 0.1.51
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.
- package/dist/commands/docs.js +1 -5
- package/dist/lib/docs-resolver.d.ts +8 -0
- package/dist/lib/docs-resolver.js +27 -0
- package/dist/lib/security.js +5 -0
- package/dist/mcp.js +56 -43
- package/docs/dev-guide/1-01-architecture.md +358 -0
- package/docs/dev-guide/1-02-multi-tenant.md +415 -0
- package/docs/dev-guide/1-03-column-types.md +594 -0
- package/docs/dev-guide/1-04-json-config.md +442 -0
- package/docs/dev-guide/1-05-authentication.md +427 -0
- package/docs/dev-guide/2-01-api-reference.md +564 -0
- package/docs/dev-guide/2-02-automations.md +508 -0
- package/docs/dev-guide/2-03-gufi-cli.md +568 -0
- package/docs/dev-guide/2-04-realtime.md +401 -0
- package/docs/dev-guide/2-05-permissions.md +497 -0
- package/docs/dev-guide/2-06-integrations-overview.md +104 -0
- package/docs/dev-guide/2-07-stripe.md +173 -0
- package/docs/dev-guide/2-08-nayax.md +297 -0
- package/docs/dev-guide/2-09-ourvend.md +226 -0
- package/docs/dev-guide/2-10-tns.md +177 -0
- package/docs/dev-guide/2-11-custom-http.md +268 -0
- package/docs/dev-guide/3-01-custom-views.md +555 -0
- package/docs/dev-guide/3-02-webhooks-api.md +446 -0
- package/docs/mcp/00-overview.md +329 -0
- package/docs/mcp/01-architecture.md +226 -0
- package/docs/mcp/02-modules.md +285 -0
- package/docs/mcp/03-fields.md +357 -0
- package/docs/mcp/04-views.md +613 -0
- package/docs/mcp/05-automations.md +461 -0
- package/docs/mcp/06-api.md +531 -0
- package/docs/mcp/07-packages.md +246 -0
- package/docs/mcp/08-common-errors.md +284 -0
- package/docs/mcp/09-examples.md +453 -0
- package/docs/mcp/README.md +71 -0
- package/docs/mcp/tool-descriptions.json +64 -0
- package/package.json +3 -2
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: gufi-cli
|
|
3
|
+
title: "Gufi CLI"
|
|
4
|
+
description: "Command line tool for developers"
|
|
5
|
+
icon: Terminal
|
|
6
|
+
category: dev
|
|
7
|
+
part: 2
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Gufi CLI
|
|
11
|
+
|
|
12
|
+
Command line tool for developers
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### npm (Recommended)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g gufi-cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Verify Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
gufi --version
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Authentication
|
|
29
|
+
|
|
30
|
+
### Login
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gufi login
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Prompts for email and password. Credentials saved to `~/.gufi/config.json`.
|
|
37
|
+
|
|
38
|
+
### Token Refresh
|
|
39
|
+
|
|
40
|
+
Tokens refresh automatically. If issues occur:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gufi login --force
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Environment Configuration
|
|
47
|
+
|
|
48
|
+
### View Environments
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
gufi config
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Shows configured environments and current selection.
|
|
55
|
+
|
|
56
|
+
### Switch to Local
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
gufi config:local
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Uses `http://localhost:3000` for development.
|
|
63
|
+
|
|
64
|
+
### Switch to Production
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gufi config:prod
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Uses `https://api.gogufi.com` for production.
|
|
71
|
+
|
|
72
|
+
### Custom Environment
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
gufi config:set staging https://staging.gogufi.com
|
|
76
|
+
gufi config:use staging
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Companies & Modules
|
|
80
|
+
|
|
81
|
+
### List Companies
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
gufi companies
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Shows all companies you have access to.
|
|
88
|
+
|
|
89
|
+
### List Modules
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
gufi modules 146
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Shows modules for company ID 146.
|
|
96
|
+
|
|
97
|
+
### View Module JSON
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
gufi module 360
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Auto-detects company from module ID.
|
|
104
|
+
|
|
105
|
+
### Edit Module
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
gufi module 360 --edit
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Opens in `$EDITOR` (or nano). Saves changes on exit.
|
|
112
|
+
|
|
113
|
+
### Export Module
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
gufi module 360 --file inventory.json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Create Module
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
gufi module:create new_module.json -c 146
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Creates module from JSON file for company 146.
|
|
126
|
+
|
|
127
|
+
### Update Module
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
gufi module:update 360 updated_module.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Schema Commands
|
|
134
|
+
|
|
135
|
+
### View Full Schema
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
gufi schema
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Shows all tables and their structure.
|
|
142
|
+
|
|
143
|
+
### Filter by Module
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
gufi schema -m 360
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Shows only tables from module 360.
|
|
150
|
+
|
|
151
|
+
### View Single Table
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
gufi schema -t products
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Shows detailed structure for products table.
|
|
158
|
+
|
|
159
|
+
## Automation Commands
|
|
160
|
+
|
|
161
|
+
### List Automation Scripts
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
gufi automations -c 146
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### View Script Code
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
gufi automation 42
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Auto-detects company.
|
|
174
|
+
|
|
175
|
+
### Edit Script
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
gufi automation 42 --edit
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Opens code in editor.
|
|
182
|
+
|
|
183
|
+
### Export Script
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
gufi automation 42 --file script.js
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Create Script
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
gufi automation:create my_script script.js -c 146
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Creates or updates script with name `my_script`.
|
|
196
|
+
|
|
197
|
+
## Entity Automations
|
|
198
|
+
|
|
199
|
+
### View Entity Triggers
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
gufi entity:automations 4589
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Shows automations configured for entity 4589.
|
|
206
|
+
|
|
207
|
+
### Edit Triggers
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
gufi entity:automations 4589 --edit
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Opens trigger config in editor.
|
|
214
|
+
|
|
215
|
+
### Export Triggers
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
gufi entity:automations 4589 --file triggers.json
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Update Triggers
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
gufi entity:automations:update 4589 triggers.json
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Debugging Automations
|
|
228
|
+
|
|
229
|
+
### View Worker Index
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
gufi automations:meta -c 146
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Shows what the worker knows about automations.
|
|
236
|
+
|
|
237
|
+
### View Executions
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
gufi automations:executions -c 146
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Shows recent execution history.
|
|
244
|
+
|
|
245
|
+
### Filter Executions
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
gufi automations:executions -c 146 --limit 50 --script send_email
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Execution Details
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
gufi automations:executions -c 146 --id 12345
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Shows detailed log for specific execution.
|
|
258
|
+
|
|
259
|
+
## Environment Variables
|
|
260
|
+
|
|
261
|
+
### List Variables
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
gufi env
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Shows all environment variables for current company.
|
|
268
|
+
|
|
269
|
+
### Set Variable
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
gufi env:set API_KEY sk_live_xxxxx
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Delete Variable
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
gufi env:delete API_KEY
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Row Operations
|
|
282
|
+
|
|
283
|
+
### List Records
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
gufi rows products
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Limit Results
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
gufi rows products -l 50
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Filter Records
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
gufi rows products -f "status=active"
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### View Single Record
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
gufi row products 123
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Create Record
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
gufi row:create products --data '{"name":"Widget","price":99}'
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Update Record
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
gufi row:update products 123 --data '{"stock":50}'
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Delete Record
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
gufi row:delete products 123
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Duplicate Record
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
gufi row:duplicate products 123
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## Marketplace Commands
|
|
332
|
+
|
|
333
|
+
### List My Packages
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
gufi packages
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### View Package
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
gufi package 14
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Shows package details including modules and views.
|
|
346
|
+
|
|
347
|
+
### Create Package
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
gufi package:create "My Analytics Package"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Add Module to Package
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
gufi package:add-module 14 -c 146 -m 360
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Adds module 360 from company 146 to package 14.
|
|
360
|
+
|
|
361
|
+
### Add View to Package
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
gufi package:add-view 14 55
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Adds view 55 to package 14.
|
|
368
|
+
|
|
369
|
+
### Check Pending Changes
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
gufi package:check 14
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Shows what changed since last sync.
|
|
376
|
+
|
|
377
|
+
### Sync Package
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
gufi package:sync 14
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
Updates package version with current state.
|
|
384
|
+
|
|
385
|
+
### Publish Package
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
gufi package:publish 14
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Publishes to the Marketplace.
|
|
392
|
+
|
|
393
|
+
## View Development
|
|
394
|
+
|
|
395
|
+
### Pull View for Editing
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
gufi pull 55
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Downloads view code to local directory.
|
|
402
|
+
|
|
403
|
+
### Push Changes
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
gufi push
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Uploads local changes to server.
|
|
410
|
+
|
|
411
|
+
### Watch for Changes
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
gufi watch
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Auto-syncs on file save. Great for development.
|
|
418
|
+
|
|
419
|
+
### View Logs
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
gufi logs
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Shows console.log output from LivePreview.
|
|
426
|
+
|
|
427
|
+
### Check Status
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
gufi status
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
Shows sync status and pending changes.
|
|
434
|
+
|
|
435
|
+
## Global Options
|
|
436
|
+
|
|
437
|
+
| Option | Description |
|
|
438
|
+
|---|---|
|
|
439
|
+
| `-c, --company <id>` | Specify company ID |
|
|
440
|
+
| `-e, --edit` | Open in editor |
|
|
441
|
+
| `-f, --file <path>` | Save to/load from file |
|
|
442
|
+
| `-l, --limit <n>` | Limit results |
|
|
443
|
+
| `--dry-run` | Validate without applying |
|
|
444
|
+
| `-h, --help` | Show help |
|
|
445
|
+
| `-v, --version` | Show version |
|
|
446
|
+
|
|
447
|
+
## Auto-Detection
|
|
448
|
+
|
|
449
|
+
Many commands auto-detect company from resource ID:
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
# These work without -c flag
|
|
453
|
+
gufi module 360 # Detects company from module ID
|
|
454
|
+
gufi automation 42 # Detects company from script ID
|
|
455
|
+
gufi entity:automations 4589 # Detects company from entity ID
|
|
456
|
+
gufi row products 123 # Detects company from table
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
Use `-c` only when listing or creating:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
gufi modules -c 146 # Listing needs company
|
|
463
|
+
gufi module:create -c 146 # Creating needs company
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## Examples
|
|
467
|
+
|
|
468
|
+
### Complete Workflow
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
# 1. Login and configure
|
|
472
|
+
gufi login
|
|
473
|
+
gufi config:local
|
|
474
|
+
|
|
475
|
+
# 2. View company structure
|
|
476
|
+
gufi companies
|
|
477
|
+
gufi modules 146
|
|
478
|
+
gufi schema -m 360
|
|
479
|
+
|
|
480
|
+
# 3. Edit module configuration
|
|
481
|
+
gufi module 360 --edit
|
|
482
|
+
|
|
483
|
+
# 4. Create automation
|
|
484
|
+
cat > send_email.js << 'EOF'
|
|
485
|
+
async function notify_customer(gufi) {
|
|
486
|
+
const { row } = gufi.context;
|
|
487
|
+
await gufi.integrations.notifications.email({
|
|
488
|
+
to: row.email,
|
|
489
|
+
subject: "Welcome!",
|
|
490
|
+
body: "Thanks for signing up."
|
|
491
|
+
});
|
|
492
|
+
return { success: true };
|
|
493
|
+
}
|
|
494
|
+
EOF
|
|
495
|
+
|
|
496
|
+
gufi automation:create notify_customer send_email.js -c 146
|
|
497
|
+
|
|
498
|
+
# 5. Attach to entity
|
|
499
|
+
gufi entity:automations 4589 --edit
|
|
500
|
+
# Add: { "trigger": "insert", "function_name": "notify_customer" }
|
|
501
|
+
|
|
502
|
+
# 6. Test
|
|
503
|
+
gufi row:create customers --data '{"name":"Test","email":"test@example.com"}'
|
|
504
|
+
gufi automations:executions -c 146 --limit 1
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### View Development Workflow
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
# 1. Pull existing view
|
|
511
|
+
gufi pull 55
|
|
512
|
+
cd view_55/
|
|
513
|
+
|
|
514
|
+
# 2. Start watching
|
|
515
|
+
gufi watch &
|
|
516
|
+
|
|
517
|
+
# 3. Edit files
|
|
518
|
+
# Changes auto-sync
|
|
519
|
+
|
|
520
|
+
# 4. View logs
|
|
521
|
+
gufi logs
|
|
522
|
+
|
|
523
|
+
# 5. When done, push final
|
|
524
|
+
gufi push
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
## Troubleshooting
|
|
528
|
+
|
|
529
|
+
### Authentication Issues
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
# Clear credentials
|
|
533
|
+
rm ~/.gufi/config.json
|
|
534
|
+
|
|
535
|
+
# Re-login
|
|
536
|
+
gufi login
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### Connection Errors
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
# Check environment
|
|
543
|
+
gufi config
|
|
544
|
+
|
|
545
|
+
# Test connection
|
|
546
|
+
curl https://api.gogufi.com/health
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### Command Not Found
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
# Check installation
|
|
553
|
+
which gufi
|
|
554
|
+
npm list -g gufi-cli
|
|
555
|
+
|
|
556
|
+
# Reinstall
|
|
557
|
+
npm uninstall -g gufi-cli
|
|
558
|
+
npm install -g gufi-cli
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
### Editor Issues
|
|
562
|
+
|
|
563
|
+
```bash
|
|
564
|
+
# Set editor
|
|
565
|
+
export EDITOR=vim
|
|
566
|
+
# or
|
|
567
|
+
export EDITOR="code --wait"
|
|
568
|
+
```
|