@nestbox-ai/cli 1.0.50 → 1.0.52

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/README.md CHANGED
@@ -1,37 +1,550 @@
1
1
  # Nestbox CLI for managing and deploying agents
2
+
2
3
  The Nestbox CLI tool is designed to facilitate development, management, and deployment of AI agents built on the Nestbox platform. It provides developers streamlined commands for authentication, deployment lifecycle management, and AI agent management.
3
4
 
4
5
  Read more in the [Nestbox AI developers site](https://developers.nestbox.ai)
5
6
 
6
7
  ## Installation
7
- ```
8
+
9
+ ```bash
8
10
  npm install -g @nestbox-ai/cli
9
11
  ```
10
12
 
11
- # Authentication
13
+ ## Quick Start
14
+
15
+ 1. **Login to your Nestbox platform:**
16
+ ```bash
17
+ nestbox login <nestbox-domain>
18
+ ```
19
+
20
+ 2. **List available projects:**
21
+ ```bash
22
+ nestbox project list
23
+ ```
24
+
25
+ 3. **Set default project:**
26
+ ```bash
27
+ nestbox project use <project-name>
28
+ ```
29
+
30
+ 4. **Deploy an agent:**
31
+ ```bash
32
+ nestbox agent deploy --agent <agent-name> --instance <machine-name>
33
+ ```
34
+
35
+ ## Global Options
36
+
37
+ ```
38
+ nestbox [options] [command]
39
+
40
+ Options:
41
+ -V, --version output the version number
42
+ -h, --help display help for command
12
43
  ```
44
+
45
+ ## Commands Overview
46
+
47
+ - [`login`](#login) - Login using Google SSO
48
+ - [`logout`](#logout) - Logout from Nestbox platform
49
+ - [`project`](#project) - Manage Nestbox projects
50
+ - [`compute`](#compute) - Manage Nestbox compute instances
51
+ - [`agent`](#agent) - Manage Nestbox agents
52
+ - [`document`](#document) - Manage Nestbox documents and collections
53
+ - [`image`](#image) - Manage Nestbox images
54
+ - [`generate`](#generate) - Generate new projects and components
55
+
56
+ ---
57
+
58
+ ## Authentication Commands
59
+
60
+ ### `login`
61
+
62
+ Login to the Nestbox platform using Google SSO.
63
+
64
+ ```bash
13
65
  nestbox login <nestbox-domain>
14
66
  ```
15
67
 
16
- # Usage
68
+ **Parameters:**
69
+ - `<nestbox-domain>` - The Nestbox domain to authenticate with (e.g., `app.nestbox.ai` or `localhost:3000`)
70
+
71
+ **Example:**
72
+ ```bash
73
+ nestbox login app.nestbox.ai
17
74
  ```
18
- nestbox --help
19
- Usage: nestbox [options] [command]
20
75
 
21
- CLI tool for the Nestbox AI platform
76
+ After running this command, your browser will open for Google authentication. Once authenticated, paste the provided token and API URL when prompted.
22
77
 
23
- Options:
24
- -V, --version output the version number
25
- -h, --help display help for command
78
+ ### `logout`
79
+
80
+ Logout from the Nestbox platform.
81
+
82
+ ```bash
83
+ nestbox logout [nestbox-domain]
84
+ ```
85
+
86
+ **Parameters:**
87
+ - `[nestbox-domain]` - Optional domain to logout from. If not provided, will logout from all stored credentials.
88
+
89
+ **Example:**
90
+ ```bash
91
+ nestbox logout app.nestbox.ai
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Project Management
97
+
98
+ ### `project`
99
+
100
+ Manage Nestbox projects with the following subcommands:
101
+
102
+ #### `project list`
103
+
104
+ List all available projects.
105
+
106
+ ```bash
107
+ nestbox project list
108
+ ```
109
+
110
+ Shows all projects from the API with their names, aliases (if any), and indicates which is the current default project.
111
+
112
+ #### `project use`
113
+
114
+ Set a default project for all subsequent commands.
115
+
116
+ ```bash
117
+ nestbox project use <project-name>
118
+ ```
119
+
120
+ **Parameters:**
121
+ - `<project-name>` - Name of the project to set as default
122
+
123
+ **Example:**
124
+ ```bash
125
+ nestbox project use my-ai-project
126
+ ```
127
+
128
+ #### `project add`
129
+
130
+ Add a project with an optional alias.
131
+
132
+ ```bash
133
+ nestbox project add <project-name> [alias]
134
+ ```
135
+
136
+ **Parameters:**
137
+ - `<project-name>` - Name of the project to add
138
+ - `[alias]` - Optional alias for the project
139
+
140
+ **Example:**
141
+ ```bash
142
+ nestbox project add my-ai-project myproj
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Compute Management
148
+
149
+ ### `compute`
150
+
151
+ Manage Nestbox compute instances with the following subcommands:
152
+
153
+ #### `compute list`
154
+
155
+ List all compute instances.
156
+
157
+ ```bash
158
+ nestbox compute list [options]
159
+ ```
160
+
161
+ **Options:**
162
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
163
+
164
+ #### `compute create`
165
+
166
+ Create a new compute instance.
167
+
168
+ ```bash
169
+ nestbox compute create <instance-name> [options]
170
+ ```
171
+
172
+ **Parameters:**
173
+ - `<instance-name>` - Name for the new compute instance
174
+
175
+ **Options:**
176
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
177
+
178
+ #### `compute delete`
179
+
180
+ Delete a compute instance.
181
+
182
+ ```bash
183
+ nestbox compute delete <instance-name> [options]
184
+ ```
185
+
186
+ **Parameters:**
187
+ - `<instance-name>` - Name of the compute instance to delete
188
+
189
+ **Options:**
190
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
191
+ - `--force` - Skip confirmation prompt
192
+
193
+ ---
194
+
195
+ ## Agent Management
196
+
197
+ ### `agent`
198
+
199
+ Manage Nestbox agents with the following subcommands:
200
+
201
+ #### `agent list`
202
+
203
+ List all agents in the project.
204
+
205
+ ```bash
206
+ nestbox agent list [options]
207
+ ```
208
+
209
+ **Options:**
210
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
211
+
212
+ #### `agent create`
213
+
214
+ Create a new agent.
215
+
216
+ ```bash
217
+ nestbox agent create [options]
218
+ ```
219
+
220
+ **Options:**
221
+ - `--agent <agent>` - Agent name to create
222
+ - `--all` - Create all agents defined in nestbox-agents.yaml
223
+ - `--project <project>` - Project ID (defaults to current project)
224
+ - `--type <type>` - Agent type (e.g. CHAT, AGENT, REGULAR)
225
+ - `--description <description>` - Description of the agent
226
+ - `--instance <instance>` - Machine name
227
+ - `--inputSchema <inputSchema>` - Agent input schema
228
+
229
+ **Examples:**
230
+ ```bash
231
+ # Create a single agent
232
+ nestbox agent create --agent my-agent --instance my-compute --type REGULAR
233
+
234
+ # Create all agents from YAML manifest
235
+ nestbox agent create --all --instance my-compute
236
+ ```
237
+
238
+ #### `agent deploy`
239
+
240
+ Deploy an AI agent to the Nestbox platform.
241
+
242
+ ```bash
243
+ nestbox agent deploy [options]
244
+ ```
245
+
246
+ **Options:**
247
+ - `--agent <agent>` - Agent name to deploy
248
+ - `--all` - Deploy all agents defined in nestbox-agents.yaml
249
+ - `--prefix <prefix>` - A prefix added to beginning of the agent name
250
+ - `--description <description>` - Goal/description of the agent
251
+ - `--inputSchema <inputSchema>` - Agent input schema
252
+ - `--project <project>` - Project ID (defaults to current project)
253
+ - `--type <type>` - Agent type (e.g. CHAT, AGENT, REGULAR)
254
+ - `--entryFunction <entryFunction>` - Entry function name
255
+ - `--instance <instance>` - Machine name
256
+ - `--log` - Show detailed logs during deployment
257
+ - `--silent` - Disable automatic agent creation
258
+
259
+ **Examples:**
260
+ ```bash
261
+ # Deploy a single agent
262
+ nestbox agent deploy --agent my-agent --instance my-compute
263
+
264
+ # Deploy all agents with logging
265
+ nestbox agent deploy --all --instance my-compute --log
266
+
267
+ # Deploy with custom prefix
268
+ nestbox agent deploy --agent my-agent --instance my-compute --prefix "v2-"
269
+ ```
270
+
271
+ #### `agent remove`
272
+
273
+ Remove an agent from the platform.
274
+
275
+ ```bash
276
+ nestbox agent remove <agent-name> [options]
277
+ ```
278
+
279
+ **Parameters:**
280
+ - `<agent-name>` - Name of the agent to remove
281
+
282
+ **Options:**
283
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
284
+
285
+ ---
286
+
287
+ ## Document Management
288
+
289
+ ### `document`
290
+
291
+ Manage Nestbox documents and collections with the following subcommands:
292
+
293
+ #### Document Collections
294
+
295
+ ##### `document collection list`
296
+
297
+ List all document collections.
298
+
299
+ ```bash
300
+ nestbox document collection list [options]
301
+ ```
302
+
303
+ **Options:**
304
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
305
+
306
+ ##### `document collection create`
307
+
308
+ Create a new document collection.
309
+
310
+ ```bash
311
+ nestbox document collection create <collection-name> [options]
312
+ ```
313
+
314
+ **Parameters:**
315
+ - `<collection-name>` - Name of the collection to create
316
+
317
+ **Options:**
318
+ - `--metadata <json>` - Metadata for the document collection in JSON format
319
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
320
+
321
+ **Example:**
322
+ ```bash
323
+ nestbox document collection create my-docs --metadata '{"category": "research"}'
324
+ ```
325
+
326
+ ##### `document collection get`
327
+
328
+ Get details of a specific document collection.
329
+
330
+ ```bash
331
+ nestbox document collection get <collection-id> [options]
332
+ ```
333
+
334
+ **Parameters:**
335
+ - `<collection-id>` - ID of the collection to retrieve
336
+
337
+ **Options:**
338
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
339
+
340
+ ##### `document collection update`
341
+
342
+ Update a document collection.
343
+
344
+ ```bash
345
+ nestbox document collection update <collection-id> [options]
346
+ ```
347
+
348
+ **Parameters:**
349
+ - `<collection-id>` - ID of the collection to update
350
+
351
+ **Options:**
352
+ - `--name <name>` - New name of the document collection
353
+ - `--metadata <json>` - New metadata for the document collection in JSON format
354
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
355
+
356
+ ##### `document collection delete`
357
+
358
+ Delete a document collection.
359
+
360
+ ```bash
361
+ nestbox document collection delete <collection-id> [options]
362
+ ```
363
+
364
+ **Parameters:**
365
+ - `<collection-id>` - ID of the collection to delete
366
+
367
+ **Options:**
368
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
369
+
370
+ #### Documents
371
+
372
+ ##### `document doc add`
373
+
374
+ Add a document to a collection.
375
+
376
+ ```bash
377
+ nestbox document doc add <collection-id> <document-content> [options]
378
+ ```
379
+
380
+ **Parameters:**
381
+ - `<collection-id>` - ID of the collection to add the document to
382
+ - `<document-content>` - Content of the document
383
+
384
+ **Options:**
385
+ - `--metadata <json>` - Document metadata in JSON format (optional)
386
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
387
+
388
+ **Example:**
389
+ ```bash
390
+ nestbox document doc add col123 "This is my document content" --metadata '{"title": "My Doc"}'
391
+ ```
392
+
393
+ ##### `document doc get`
394
+
395
+ Get a specific document.
396
+
397
+ ```bash
398
+ nestbox document doc get <collection-id> <document-id> [options]
399
+ ```
400
+
401
+ **Parameters:**
402
+ - `<collection-id>` - ID of the collection containing the document
403
+ - `<document-id>` - ID of the document to retrieve
404
+
405
+ **Options:**
406
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
407
+
408
+ ##### `document doc update`
409
+
410
+ Update a document.
411
+
412
+ ```bash
413
+ nestbox document doc update <collection-id> <document-id> <new-content> [options]
414
+ ```
415
+
416
+ **Parameters:**
417
+ - `<collection-id>` - ID of the collection containing the document
418
+ - `<document-id>` - ID of the document to update
419
+ - `<new-content>` - New content for the document
420
+
421
+ **Options:**
422
+ - `--metadata <json>` - Updated document metadata in JSON format (optional)
423
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
424
+
425
+ ##### `document doc delete`
426
+
427
+ Delete a document.
428
+
429
+ ```bash
430
+ nestbox document doc delete <collection-id> <document-id> [options]
431
+ ```
432
+
433
+ **Parameters:**
434
+ - `<collection-id>` - ID of the collection containing the document
435
+ - `<document-id>` - ID of the document to delete
436
+
437
+ **Options:**
438
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
439
+
440
+ ##### `document doc upload-file`
441
+
442
+ Upload a file as a document.
443
+
444
+ ```bash
445
+ nestbox document doc upload-file <collection-id> <file-path> [options]
446
+ ```
447
+
448
+ **Parameters:**
449
+ - `<collection-id>` - ID of the collection to upload the file to
450
+ - `<file-path>` - Path to the file to upload
451
+
452
+ **Options:**
453
+ - `--type <fileType>` - Type of the file (e.g., pdf, txt, doc)
454
+ - `--options <json>` - Additional options for file processing in JSON format
455
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
456
+
457
+ **Example:**
458
+ ```bash
459
+ nestbox document doc upload-file col123 ./document.pdf --type pdf
460
+ ```
461
+
462
+ ##### `document doc search`
463
+
464
+ Search for documents within collections.
465
+
466
+ ```bash
467
+ nestbox document doc search <collection-id> <search-query> [options]
468
+ ```
469
+
470
+ **Parameters:**
471
+ - `<collection-id>` - ID of the collection to search in
472
+ - `<search-query>` - Search query string
473
+
474
+ **Options:**
475
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
476
+ - `--filter <json>` - Filter criteria as JSON string
477
+
478
+ ---
479
+
480
+ ## Image Management
481
+
482
+ ### `image`
483
+
484
+ Manage Nestbox images with the following subcommands:
485
+
486
+ #### `image list`
487
+
488
+ List all available images.
489
+
490
+ ```bash
491
+ nestbox image list [options]
492
+ ```
493
+
494
+ **Options:**
495
+ - `--project <projectId>` - Project ID or name (defaults to the current project)
496
+
497
+ ---
498
+
499
+ ## Project Generation
500
+
501
+ ### `generate`
502
+
503
+ Generate new projects and components with the following subcommands:
504
+
505
+ #### `generate project`
506
+
507
+ Generate a new Nestbox project from templates.
508
+
509
+ ```bash
510
+ nestbox generate project <folder> [options]
511
+ ```
512
+
513
+ **Parameters:**
514
+ - `<folder>` - Name of the folder to create the project in
515
+
516
+ **Options:**
517
+ - `--lang <language>` - Project language (ts|js)
518
+ - `--template <type>` - Template type (agent|chatbot)
519
+ - `--instanceName <name>` - Name of the compute instance
520
+ - `--project <projectId>` - Project ID
521
+
522
+ **Examples:**
523
+ ```bash
524
+ # Generate a TypeScript agent project
525
+ nestbox generate project my-agent --lang ts --template agent
526
+
527
+ # Generate a JavaScript chatbot project
528
+ nestbox generate project my-chatbot --lang js --template chatbot --project my-project-id
529
+ ```
530
+
531
+ ---
532
+
533
+ ## Configuration
534
+
535
+ The CLI stores authentication and configuration data in `~/.config/.nestbox/`. This includes:
536
+
537
+ - Authentication tokens for different domains
538
+ - Default project settings
539
+ - Project aliases
540
+
541
+ ## Error Handling
542
+
543
+ The CLI includes automatic token refresh functionality. If your authentication token expires, the CLI will attempt to refresh it automatically. If this fails, you'll need to login again using `nestbox login`.
544
+
545
+ ## Support
546
+
547
+ For more information and detailed guides, visit the [Nestbox AI developers site](https://developers.nestbox.ai).
26
548
 
27
- Commands:
28
- login <nestbox-domain> Login using Google SSO
29
- logout [nestbox-domain] Logout from Nestbox platform
30
- project Manage Nestbox projects
31
- compute Manage Nestbox computes
32
- agent Manage Nestbox agents
33
- document Manage Nestbox documents
34
- image Manage Nestbox images
35
- help [command] display help for command
36
- ```
549
+ For issues and bug reports, please visit the [GitHub repository](https://github.com/NestboxAI/nestbox-ai-cli-tools).
37
550
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestbox-ai/cli",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "The cli tools that helps developers to build agents",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "files": [
21
21
  "dist",
22
+ "templates",
22
23
  "README.md",
23
24
  "GETTING_STARTED.md"
24
25
  ],
@@ -0,0 +1,30 @@
1
+ var { useAgent } = require('@nestbox-ai/functions');
2
+ var { OpenAI } = require('openai');
3
+
4
+ const MODEL_NAME = 'openai/gpt-oss-20b';
5
+
6
+ const client = new OpenAI({
7
+ baseURL: 'http://localhost:8000/v1',
8
+ apiKey: 'sk-xxxxxx'
9
+ });
10
+
11
+ var {{agentName}} = useAgent(async (context, events) => {
12
+
13
+ const response = await client.chat.completions.create({
14
+ model: MODEL_NAME,
15
+ messages: [
16
+ {
17
+ role: "user",
18
+ content: "Why is the sky blue?"
19
+ }
20
+ ]
21
+ });
22
+ const result = response.choices[0].message.content;
23
+ if (!result) {
24
+ events.emitQueryFailed({ data: { error: 'No response from model' } });
25
+ } else {
26
+ events.emitQueryCompleted({ data: result });
27
+ }
28
+ });
29
+
30
+ module.exports = { {{agentName}} };
@@ -0,0 +1,12 @@
1
+ agents:
2
+ - name: {{ agentNameInYaml }}
3
+ description: Our new agent {{ agentNameInYaml }} that uses the nestbox API
4
+ entry: {{agentName}}
5
+ inputSchema:
6
+ type: object
7
+ properties:
8
+ content:
9
+ type: string
10
+ description: The content of the input as string
11
+ minLength: 10
12
+ maxLength: 5000
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "app",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1"
7
+ },
8
+ "author": "",
9
+ "license": "ISC",
10
+ "description": "",
11
+ "dependencies": {
12
+ "@nestbox-ai/functions": "^2.0.0",
13
+ "openai": "^6.5.0"
14
+ }
15
+ }
@@ -0,0 +1,42 @@
1
+ from nestbox_ai_functions import use_agent
2
+ from openai import OpenAI
3
+
4
+ MODEL_NAME = "openai/gpt-oss-20b"
5
+
6
+ client = OpenAI(
7
+ base_url="http://localhost:8000/v1",
8
+ api_key="sk-xxxxxx"
9
+ )
10
+
11
+ @use_agent
12
+ async def {{agentName}}(context, events):
13
+ try:
14
+ response = client.chat.completions.create(
15
+ model=MODEL_NAME,
16
+ messages=[
17
+ {
18
+ "role": "user",
19
+ "content": "Why is the sky blue?"
20
+ }
21
+ ],
22
+ )
23
+
24
+ result = response.choices[0].message.content if response.choices else None
25
+
26
+ if not result:
27
+ await events.emitQueryFailed({
28
+ "data": {
29
+ "error": "No response from model"
30
+ }
31
+ })
32
+ else:
33
+ await events.emitQueryCompleted({
34
+ "data": result
35
+ })
36
+
37
+ except Exception as e:
38
+ await events.emitQueryFailed({
39
+ "data": {
40
+ "error": str(e)
41
+ }
42
+ })
@@ -0,0 +1,12 @@
1
+ agents:
2
+ - name: {{ agentNameInYaml }}
3
+ description: Our new agent {{ agentNameInYaml }} that uses the nestbox API
4
+ entry: {{agentName}}
5
+ inputSchema:
6
+ type: object
7
+ properties:
8
+ content:
9
+ type: string
10
+ description: The content of the input as string
11
+ minLength: 10
12
+ maxLength: 5000
@@ -0,0 +1,15 @@
1
+ [project]
2
+ name = "app"
3
+ description = "Nestbox Python Agent"
4
+ version = "1.0.0"
5
+ requires-python = ">=3.11"
6
+ dependencies = [
7
+ "nestbox-ai-functions>=2.0.3",
8
+ "openai>=1.40.0",
9
+ "httpx>=0.27.0",
10
+ "anyio>=4.0.0"
11
+ ]
12
+
13
+ [build-system]
14
+ requires = ["setuptools", "wheel"]
15
+ build-backend = "setuptools.build_meta"