@inkeep/agents-cli 0.6.0 → 0.6.5
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 +220 -57
- package/dist/index.js +44 -95
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,49 +15,54 @@ A command-line interface for managing and interacting with Inkeep Agent Framewor
|
|
|
15
15
|
> **📖 For detailed setup instructions, see [SETUP.md](./SETUP.md)**
|
|
16
16
|
|
|
17
17
|
1. **Install and build**
|
|
18
|
+
|
|
18
19
|
```bash
|
|
19
20
|
# Navigate to the CLI directory
|
|
20
21
|
cd /path/to/agent-framework/agents-cli
|
|
21
|
-
|
|
22
|
+
|
|
22
23
|
# Install dependencies
|
|
23
24
|
pnpm install
|
|
24
|
-
|
|
25
|
+
|
|
25
26
|
# Build the CLI
|
|
26
27
|
pnpm build
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
2. **Install globally** (recommended)
|
|
30
|
-
|
|
31
|
+
|
|
31
32
|
**Option A: Using npm link (for development)**
|
|
33
|
+
|
|
32
34
|
```bash
|
|
33
35
|
# Create global symlink from the agents-cli directory
|
|
34
36
|
npm link
|
|
35
|
-
|
|
37
|
+
|
|
36
38
|
# Verify installation
|
|
37
39
|
which inkeep # Should show path to inkeep command
|
|
38
40
|
```
|
|
39
|
-
|
|
41
|
+
|
|
40
42
|
**Option B: Using pnpm/npm global install (after publishing)**
|
|
43
|
+
|
|
41
44
|
```bash
|
|
42
45
|
# Install the scoped package globally
|
|
43
46
|
pnpm add -g @inkeep/agents-cli
|
|
44
47
|
# or
|
|
45
48
|
npm install -g @inkeep/agents-cli
|
|
46
|
-
|
|
49
|
+
|
|
47
50
|
# Verify installation
|
|
48
51
|
inkeep --version
|
|
49
52
|
```
|
|
50
|
-
|
|
51
|
-
**Note:**
|
|
53
|
+
|
|
54
|
+
**Note:**
|
|
55
|
+
|
|
52
56
|
- For local development, use `npm link` (more reliable than `pnpm link --global`)
|
|
53
57
|
- The command is still `inkeep` even though the package name is `@inkeep/agents-cli`
|
|
54
58
|
- If linking fails, try unlinking first: `npm unlink -g @inkeep/agents-cli`
|
|
55
59
|
|
|
56
60
|
3. **Configure your project**
|
|
61
|
+
|
|
57
62
|
```bash
|
|
58
63
|
# Create an inkeep.config.ts file with your tenant ID
|
|
59
64
|
inkeep init
|
|
60
|
-
|
|
65
|
+
|
|
61
66
|
# Or manually create inkeep.config.ts:
|
|
62
67
|
# export default defineConfig({
|
|
63
68
|
# tenantId: "your-tenant-id",
|
|
@@ -71,11 +76,23 @@ A command-line interface for managing and interacting with Inkeep Agent Framewor
|
|
|
71
76
|
|
|
72
77
|
### Configuration Sources (priority order)
|
|
73
78
|
|
|
74
|
-
1. **Command-line flags** - Highest priority (e.g., `--tenant-id`, `--api-url`)
|
|
75
|
-
2. **Config file** - `inkeep.config.ts` (
|
|
79
|
+
1. **Command-line flags** - Highest priority (e.g., `--tenant-id`, `--agents-manage-api-url`, `--config`)
|
|
80
|
+
2. **Config file** - `inkeep.config.ts` (or file specified with `--config`)
|
|
76
81
|
3. **Environment variables** - `INKEEP_AGENTS_MANAGE_API_URL`, `INKEEP_AGENTS_RUN_API_URL`
|
|
77
82
|
4. **Defaults** - Lowest priority (defaults to `http://localhost:3002` and `http://localhost:3003`)
|
|
78
83
|
|
|
84
|
+
### Config File Options
|
|
85
|
+
|
|
86
|
+
Most commands support the `--config` option to specify a custom configuration file:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Use custom config file
|
|
90
|
+
inkeep list-graphs --project my-project --config ./staging-config.ts
|
|
91
|
+
|
|
92
|
+
# Backward compatibility (deprecated)
|
|
93
|
+
inkeep list-graphs --project my-project --config-file-path ./staging-config.ts
|
|
94
|
+
```
|
|
95
|
+
|
|
79
96
|
### Environment Variables
|
|
80
97
|
|
|
81
98
|
Create a `.env` file in your project directory:
|
|
@@ -94,6 +111,109 @@ export INKEEP_AGENTS_RUN_API_URL=http://localhost:3003
|
|
|
94
111
|
|
|
95
112
|
## Commands
|
|
96
113
|
|
|
114
|
+
### `inkeep add [template]`
|
|
115
|
+
|
|
116
|
+
Pull a template project from the [Inkeep Agents Cookbook](https://github.com/inkeep/agents-cookbook/tree/main/template-projects).
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Add a template
|
|
120
|
+
inkeep add my-template
|
|
121
|
+
|
|
122
|
+
# Add template to specific path
|
|
123
|
+
inkeep add my-template --target-path ./src/templates
|
|
124
|
+
|
|
125
|
+
# Using config file
|
|
126
|
+
inkeep add my-template --config ./my-config.ts
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### `inkeep init [path]`
|
|
130
|
+
|
|
131
|
+
Initialize a new Inkeep configuration file.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Interactive initialization
|
|
135
|
+
inkeep init
|
|
136
|
+
|
|
137
|
+
# Initialize in specific directory
|
|
138
|
+
inkeep init ./my-project
|
|
139
|
+
|
|
140
|
+
# Skip interactive prompts
|
|
141
|
+
inkeep init --no-interactive
|
|
142
|
+
|
|
143
|
+
# Use existing config as template
|
|
144
|
+
inkeep init --config ./template-config.ts
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `inkeep config`
|
|
148
|
+
|
|
149
|
+
Manage Inkeep configuration values.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Get configuration value
|
|
153
|
+
inkeep config get tenantId
|
|
154
|
+
|
|
155
|
+
# Set configuration value
|
|
156
|
+
inkeep config set tenantId my-tenant-id
|
|
157
|
+
|
|
158
|
+
# List all configuration values
|
|
159
|
+
inkeep config list
|
|
160
|
+
|
|
161
|
+
# Using specific config file
|
|
162
|
+
inkeep config get tenantId --config ./my-config.ts
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `inkeep pull`
|
|
166
|
+
|
|
167
|
+
Pull entire project configuration from backend and update local files.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Pull current project
|
|
171
|
+
inkeep pull
|
|
172
|
+
|
|
173
|
+
# Pull specific project
|
|
174
|
+
inkeep pull --project my-project-id
|
|
175
|
+
|
|
176
|
+
# Generate environment file
|
|
177
|
+
inkeep pull --env production
|
|
178
|
+
|
|
179
|
+
# Generate JSON file instead of updating files
|
|
180
|
+
inkeep pull --json
|
|
181
|
+
|
|
182
|
+
# Enable debug logging
|
|
183
|
+
inkeep pull --debug
|
|
184
|
+
|
|
185
|
+
# Using config file
|
|
186
|
+
inkeep pull --project my-project-id --config ./my-config.ts
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `inkeep dev`
|
|
190
|
+
|
|
191
|
+
Start the Inkeep dashboard server or build for production.
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Start development server
|
|
195
|
+
inkeep dev
|
|
196
|
+
|
|
197
|
+
# Start on custom port and host
|
|
198
|
+
inkeep dev --port 3001 --host 0.0.0.0
|
|
199
|
+
|
|
200
|
+
# Build for production
|
|
201
|
+
inkeep dev --build --output-dir ./build
|
|
202
|
+
|
|
203
|
+
# Get dashboard path for deployment
|
|
204
|
+
DASHBOARD_PATH=$(inkeep dev --path)
|
|
205
|
+
echo "Dashboard built at: $DASHBOARD_PATH"
|
|
206
|
+
|
|
207
|
+
# Use with Vercel
|
|
208
|
+
vercel --cwd $(inkeep dev --path) -Q .vercel build
|
|
209
|
+
|
|
210
|
+
# Use with Docker
|
|
211
|
+
docker build -t inkeep-dashboard $(inkeep dev --path)
|
|
212
|
+
|
|
213
|
+
# Use with other deployment tools
|
|
214
|
+
rsync -av $(inkeep dev --path)/ user@server:/var/www/dashboard/
|
|
215
|
+
```
|
|
216
|
+
|
|
97
217
|
### `inkeep tenant [tenant-id]` ⚠️ NOT IMPLEMENTED
|
|
98
218
|
|
|
99
219
|
> **⚠️ WARNING: This command is not yet implemented in the current CLI.**
|
|
@@ -111,16 +231,24 @@ inkeep tenant
|
|
|
111
231
|
|
|
112
232
|
### `inkeep list-graphs`
|
|
113
233
|
|
|
114
|
-
List all available graphs for
|
|
234
|
+
List all available graphs for a specific project.
|
|
115
235
|
|
|
116
236
|
```bash
|
|
117
|
-
|
|
237
|
+
# List graphs for a project (required)
|
|
238
|
+
inkeep list-graphs --project my-project-id
|
|
118
239
|
|
|
119
240
|
# With custom API URL
|
|
120
|
-
inkeep list-graphs --api-url http://api.example.com:3002
|
|
241
|
+
inkeep list-graphs --project my-project-id --agents-manage-api-url http://api.example.com:3002
|
|
242
|
+
|
|
243
|
+
# With custom tenant ID
|
|
244
|
+
inkeep list-graphs --project my-project-id --tenant-id my-tenant-id
|
|
245
|
+
|
|
246
|
+
# Using config file
|
|
247
|
+
inkeep list-graphs --project my-project-id --config ./my-config.ts
|
|
121
248
|
```
|
|
122
249
|
|
|
123
250
|
Output:
|
|
251
|
+
|
|
124
252
|
```
|
|
125
253
|
┌─────────────────────────┬────────────────────┬───────────────┬───────────┐
|
|
126
254
|
│ Graph ID │ Name │ Default Agent │ Created │
|
|
@@ -137,9 +265,22 @@ Push your project configuration to the backend.
|
|
|
137
265
|
```bash
|
|
138
266
|
# Push the current project (from the directory with inkeep.config.ts)
|
|
139
267
|
inkeep push
|
|
268
|
+
|
|
269
|
+
# Push specific project
|
|
270
|
+
inkeep push --project my-project-id
|
|
271
|
+
|
|
272
|
+
# With custom configuration
|
|
273
|
+
inkeep push --project my-project-id --config ./my-config.ts
|
|
274
|
+
|
|
275
|
+
# With custom API URLs
|
|
276
|
+
inkeep push --project my-project-id --agents-manage-api-url http://manage.example.com --agents-run-api-url http://run.example.com
|
|
277
|
+
|
|
278
|
+
# With custom tenant ID
|
|
279
|
+
inkeep push --project my-project-id --tenant-id my-tenant-id
|
|
140
280
|
```
|
|
141
281
|
|
|
142
282
|
**Features:**
|
|
283
|
+
|
|
143
284
|
- Automatically injects tenant ID and API URL from `inkeep.config.ts`
|
|
144
285
|
- Validates exactly one AgentGraph is exported
|
|
145
286
|
- Warns about dangling resources (unreferenced agents/tools)
|
|
@@ -152,27 +293,27 @@ inkeep push
|
|
|
152
293
|
|
|
153
294
|
```javascript
|
|
154
295
|
// customer-support.graph.ts
|
|
155
|
-
import { agent, agentGraph, tool } from
|
|
296
|
+
import { agent, agentGraph, tool } from "@inkeep/agents-manage-api/builder";
|
|
156
297
|
|
|
157
298
|
const assistantAgent = agent({
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
299
|
+
id: "assistant",
|
|
300
|
+
name: "Assistant",
|
|
301
|
+
instructions: "Help users with their questions",
|
|
302
|
+
tools: {
|
|
303
|
+
search: searchTool,
|
|
304
|
+
},
|
|
305
|
+
// No tenantId needed - injected by CLI
|
|
165
306
|
});
|
|
166
307
|
|
|
167
308
|
// Must export exactly one graph
|
|
168
309
|
export const graph = agentGraph({
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
310
|
+
id: "my-assistant",
|
|
311
|
+
name: "My Assistant Graph",
|
|
312
|
+
defaultAgent: assistantAgent,
|
|
313
|
+
agents: {
|
|
314
|
+
assistant: assistantAgent,
|
|
315
|
+
},
|
|
316
|
+
// No tenantId or apiUrl needed - CLI injects from config
|
|
176
317
|
});
|
|
177
318
|
// No graph.init() call - CLI handles initialization
|
|
178
319
|
```
|
|
@@ -188,11 +329,18 @@ inkeep chat my-graph-id
|
|
|
188
329
|
# Interactive graph selection (with search)
|
|
189
330
|
inkeep chat
|
|
190
331
|
|
|
191
|
-
# With custom API
|
|
192
|
-
inkeep chat --api-url http://api.example.com
|
|
332
|
+
# With custom API URLs
|
|
333
|
+
inkeep chat --agents-manage-api-url http://manage.example.com --agents-run-api-url http://run.example.com
|
|
334
|
+
|
|
335
|
+
# With custom tenant ID
|
|
336
|
+
inkeep chat --tenant-id my-tenant-id
|
|
337
|
+
|
|
338
|
+
# Using config file
|
|
339
|
+
inkeep chat --config ./my-config.ts
|
|
193
340
|
```
|
|
194
341
|
|
|
195
342
|
**Interactive Features:**
|
|
343
|
+
|
|
196
344
|
- **Graph selection**: If no graph ID provided, shows searchable list
|
|
197
345
|
- **Chat commands**:
|
|
198
346
|
- `help` - Show available commands
|
|
@@ -223,6 +371,7 @@ inkeep mcp start graph.graph.ts --verbose
|
|
|
223
371
|
```
|
|
224
372
|
|
|
225
373
|
**Features:**
|
|
374
|
+
|
|
226
375
|
- Supports both TypeScript (`.ts`) and JavaScript (`.js`) files
|
|
227
376
|
- Automatically allocates ports for local servers (3100-3200)
|
|
228
377
|
- Shows server names, ports, and URLs
|
|
@@ -253,6 +402,7 @@ inkeep mcp status
|
|
|
253
402
|
```
|
|
254
403
|
|
|
255
404
|
Output shows:
|
|
405
|
+
|
|
256
406
|
- Process ID
|
|
257
407
|
- Graph ID
|
|
258
408
|
- Tool name
|
|
@@ -277,11 +427,10 @@ inkeep mcp list --format table
|
|
|
277
427
|
inkeep mcp list --verbose
|
|
278
428
|
```
|
|
279
429
|
|
|
280
|
-
|
|
281
|
-
|
|
282
430
|
## Complete Workflow Example
|
|
283
431
|
|
|
284
432
|
### Basic Setup
|
|
433
|
+
|
|
285
434
|
```bash
|
|
286
435
|
# Install and link CLI
|
|
287
436
|
cd agents-cli
|
|
@@ -300,39 +449,44 @@ inkeep init
|
|
|
300
449
|
> This section shows planned functionality that is not available in the current version.
|
|
301
450
|
|
|
302
451
|
1. **Create a graph with MCP tools** (`my-graph.graph.ts`)
|
|
452
|
+
|
|
303
453
|
```typescript
|
|
304
|
-
import {
|
|
454
|
+
import {
|
|
455
|
+
agent,
|
|
456
|
+
agentGraph,
|
|
457
|
+
mcpServer,
|
|
458
|
+
} from "@inkeep/agents-manage-api/builder";
|
|
305
459
|
|
|
306
460
|
// Define MCP servers (tools)
|
|
307
461
|
const randomNumberServer = mcpServer({
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
462
|
+
name: "random_number",
|
|
463
|
+
description: "Generates a random number",
|
|
464
|
+
execute: async () => Math.random(),
|
|
311
465
|
});
|
|
312
466
|
|
|
313
467
|
const weatherServer = mcpServer({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
468
|
+
name: "weather_api",
|
|
469
|
+
description: "Get weather information",
|
|
470
|
+
serverUrl: "https://api.weather.example.com/mcp",
|
|
317
471
|
});
|
|
318
472
|
|
|
319
473
|
// Define agents
|
|
320
474
|
const assistantAgent = agent({
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
475
|
+
id: "assistant",
|
|
476
|
+
name: "Assistant",
|
|
477
|
+
instructions: "Help users with various tasks",
|
|
478
|
+
tools: {
|
|
479
|
+
random: randomNumberServer,
|
|
480
|
+
weather: weatherServer,
|
|
481
|
+
},
|
|
328
482
|
});
|
|
329
483
|
|
|
330
484
|
// Export the graph
|
|
331
485
|
export const graph = agentGraph({
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
486
|
+
id: "my-assistant",
|
|
487
|
+
name: "My Assistant",
|
|
488
|
+
defaultAgent: assistantAgent,
|
|
489
|
+
agents: { assistant: assistantAgent },
|
|
336
490
|
});
|
|
337
491
|
|
|
338
492
|
// Export servers for MCP management
|
|
@@ -340,6 +494,7 @@ export const servers = [randomNumberServer, weatherServer];
|
|
|
340
494
|
```
|
|
341
495
|
|
|
342
496
|
2. **Start MCP servers and chat**
|
|
497
|
+
|
|
343
498
|
```bash
|
|
344
499
|
# Start MCP servers (works with TypeScript directly!)
|
|
345
500
|
inkeep mcp start my-graph.graph.ts
|
|
@@ -353,6 +508,7 @@ inkeep chat my-assistant
|
|
|
353
508
|
```
|
|
354
509
|
|
|
355
510
|
3. **Monitor and manage servers**
|
|
511
|
+
|
|
356
512
|
```bash
|
|
357
513
|
# Check server status
|
|
358
514
|
inkeep mcp status
|
|
@@ -367,6 +523,7 @@ inkeep mcp stop --all
|
|
|
367
523
|
## Working with Different Environments
|
|
368
524
|
|
|
369
525
|
### Development
|
|
526
|
+
|
|
370
527
|
```bash
|
|
371
528
|
# Using environment variables
|
|
372
529
|
INKEEP_AGENTS_MANAGE_API_URL=http://localhost:3002 inkeep list-graphs
|
|
@@ -378,6 +535,7 @@ inkeep chat my-graph
|
|
|
378
535
|
```
|
|
379
536
|
|
|
380
537
|
### Staging
|
|
538
|
+
|
|
381
539
|
```bash
|
|
382
540
|
# Set in config file
|
|
383
541
|
# Edit your inkeep.config.ts:
|
|
@@ -386,6 +544,7 @@ inkeep chat my-graph
|
|
|
386
544
|
```
|
|
387
545
|
|
|
388
546
|
### Production
|
|
547
|
+
|
|
389
548
|
```bash
|
|
390
549
|
# Using environment variables
|
|
391
550
|
export INKEEP_AGENTS_MANAGE_API_URL=https://manage-api.example.com
|
|
@@ -454,6 +613,7 @@ agents-cli/
|
|
|
454
613
|
### Common Issues
|
|
455
614
|
|
|
456
615
|
**"Failed to fetch graphs" or connection errors**
|
|
616
|
+
|
|
457
617
|
```bash
|
|
458
618
|
# Check if backend is running
|
|
459
619
|
curl http://localhost:3002/health
|
|
@@ -462,15 +622,15 @@ curl http://localhost:3002/health
|
|
|
462
622
|
echo $INKEEP_AGENTS_MANAGE_API_URL
|
|
463
623
|
echo $INKEEP_AGENTS_RUN_API_URL
|
|
464
624
|
|
|
465
|
-
# Try with explicit URL
|
|
466
|
-
inkeep list-graphs --api-url http://localhost:3002
|
|
625
|
+
# Try with explicit URL and project
|
|
626
|
+
inkeep list-graphs --project my-project-id --agents-manage-api-url http://localhost:3002
|
|
467
627
|
```
|
|
468
628
|
|
|
469
|
-
|
|
470
629
|
**"Graph not found" when using chat**
|
|
630
|
+
|
|
471
631
|
```bash
|
|
472
|
-
# List available graphs first
|
|
473
|
-
inkeep list-graphs
|
|
632
|
+
# List available graphs first (requires project)
|
|
633
|
+
inkeep list-graphs --project my-project-id
|
|
474
634
|
|
|
475
635
|
# Use interactive selection
|
|
476
636
|
inkeep chat
|
|
@@ -478,6 +638,7 @@ inkeep chat
|
|
|
478
638
|
```
|
|
479
639
|
|
|
480
640
|
**Command not found: inkeep**
|
|
641
|
+
|
|
481
642
|
```bash
|
|
482
643
|
# Ensure CLI is linked globally
|
|
483
644
|
cd agents-cli
|
|
@@ -495,6 +656,7 @@ export PATH="$PATH:/path/to/agents-cli/dist"
|
|
|
495
656
|
## Dependencies
|
|
496
657
|
|
|
497
658
|
### Runtime Dependencies
|
|
659
|
+
|
|
498
660
|
- **commander**: Command-line framework
|
|
499
661
|
- **chalk**: Terminal styling
|
|
500
662
|
- **dotenv**: Environment variable loading
|
|
@@ -504,6 +666,7 @@ export PATH="$PATH:/path/to/agents-cli/dist"
|
|
|
504
666
|
- **inquirer-autocomplete-prompt**: Searchable selections
|
|
505
667
|
|
|
506
668
|
### Development Dependencies
|
|
669
|
+
|
|
507
670
|
- **typescript**: TypeScript compiler
|
|
508
671
|
- **@types/node**: Node.js types
|
|
509
672
|
- **vitest**: Testing framework
|
|
@@ -518,4 +681,4 @@ export PATH="$PATH:/path/to/agents-cli/dist"
|
|
|
518
681
|
|
|
519
682
|
## License
|
|
520
683
|
|
|
521
|
-
MIT
|
|
684
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -21520,16 +21520,19 @@ import chalk3 from "chalk";
|
|
|
21520
21520
|
import fs4 from "fs-extra";
|
|
21521
21521
|
import ora2 from "ora";
|
|
21522
21522
|
var require2 = createRequire(import.meta.url);
|
|
21523
|
-
function resolveWebRuntime() {
|
|
21523
|
+
function resolveWebRuntime(isRoot = false) {
|
|
21524
21524
|
try {
|
|
21525
21525
|
const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
|
|
21526
21526
|
const root = dirname(pkg);
|
|
21527
|
+
if (isRoot) {
|
|
21528
|
+
return root;
|
|
21529
|
+
}
|
|
21527
21530
|
return join2(root, ".next/standalone/agents-manage-ui");
|
|
21528
21531
|
} catch (err) {
|
|
21529
21532
|
throw new Error(`Could not find @inkeep/agents-manage-ui package. ${err}`);
|
|
21530
21533
|
}
|
|
21531
21534
|
}
|
|
21532
|
-
function startWebApp({ port
|
|
21535
|
+
function startWebApp({ port, host }) {
|
|
21533
21536
|
console.log("");
|
|
21534
21537
|
const spinner = ora2("Starting dashboard server...").start();
|
|
21535
21538
|
try {
|
|
@@ -21573,37 +21576,9 @@ function startWebApp({ port = 3e3, host = "localhost" }) {
|
|
|
21573
21576
|
process.exit(1);
|
|
21574
21577
|
}
|
|
21575
21578
|
}
|
|
21576
|
-
async function
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
|
|
21580
|
-
const root = dirname(pkg);
|
|
21581
|
-
const sourceOutputPath = join2(root, ".vercel", "output");
|
|
21582
|
-
if (!existsSync2(sourceOutputPath)) {
|
|
21583
|
-
spinner.fail("Vercel output not found");
|
|
21584
|
-
console.error(chalk3.red("The Vercel output has not been built yet in the package."));
|
|
21585
|
-
process.exit(1);
|
|
21586
|
-
}
|
|
21587
|
-
const destVercelDir = join2(process.cwd(), ".vercel");
|
|
21588
|
-
const destOutputPath = join2(destVercelDir, "output");
|
|
21589
|
-
await fs4.ensureDir(destVercelDir);
|
|
21590
|
-
if (existsSync2(destOutputPath)) {
|
|
21591
|
-
await fs4.remove(destOutputPath);
|
|
21592
|
-
}
|
|
21593
|
-
await fs4.copy(sourceOutputPath, destOutputPath);
|
|
21594
|
-
spinner.succeed(`Vercel output copied to .vercel/output/`);
|
|
21595
|
-
console.log("");
|
|
21596
|
-
console.log(chalk3.blue("\u{1F680} Ready for Vercel deployment"));
|
|
21597
|
-
console.log(chalk3.gray("Run: vercel deploy --prebuilt --prod"));
|
|
21598
|
-
console.log("");
|
|
21599
|
-
} catch (error) {
|
|
21600
|
-
spinner.fail("Failed to copy Vercel output");
|
|
21601
|
-
console.error(chalk3.red("Error:"), error instanceof Error ? error.message : "Unknown error");
|
|
21602
|
-
throw error;
|
|
21603
|
-
}
|
|
21604
|
-
}
|
|
21605
|
-
async function buildForVercel({ outputDir = "./vercel-build" }) {
|
|
21606
|
-
const spinner = ora2("Creating Vercel-ready build...").start();
|
|
21579
|
+
async function buildNextApp({ outputDir }) {
|
|
21580
|
+
console.log("");
|
|
21581
|
+
const spinner = ora2("Building Standalone build...").start();
|
|
21607
21582
|
try {
|
|
21608
21583
|
const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
|
|
21609
21584
|
const root = dirname(pkg);
|
|
@@ -21616,6 +21591,9 @@ async function buildForVercel({ outputDir = "./vercel-build" }) {
|
|
|
21616
21591
|
if (existsSync2(outputDir)) {
|
|
21617
21592
|
await fs4.remove(outputDir);
|
|
21618
21593
|
}
|
|
21594
|
+
if (existsSync2(outputDir)) {
|
|
21595
|
+
await fs4.remove(outputDir);
|
|
21596
|
+
}
|
|
21619
21597
|
await fs4.ensureDir(outputDir);
|
|
21620
21598
|
await fs4.copy(standalonePath, outputDir);
|
|
21621
21599
|
const packageJson2 = {
|
|
@@ -21629,42 +21607,7 @@ async function buildForVercel({ outputDir = "./vercel-build" }) {
|
|
|
21629
21607
|
}
|
|
21630
21608
|
};
|
|
21631
21609
|
await fs4.writeJson(join2(outputDir, "package.json"), packageJson2, { spaces: 2 });
|
|
21632
|
-
const
|
|
21633
|
-
version: 2,
|
|
21634
|
-
builds: [
|
|
21635
|
-
{
|
|
21636
|
-
src: "server.js",
|
|
21637
|
-
use: "@vercel/node"
|
|
21638
|
-
}
|
|
21639
|
-
],
|
|
21640
|
-
routes: [
|
|
21641
|
-
{
|
|
21642
|
-
src: "/(.*)",
|
|
21643
|
-
dest: "server.js"
|
|
21644
|
-
}
|
|
21645
|
-
]
|
|
21646
|
-
};
|
|
21647
|
-
await fs4.writeJson(join2(outputDir, "vercel.json"), vercelConfig, { spaces: 2 });
|
|
21648
|
-
const instructions = `# Inkeep Dashboard - Vercel Deployment
|
|
21649
|
-
|
|
21650
|
-
## Quick Deploy
|
|
21651
|
-
|
|
21652
|
-
1. Go to https://vercel.com/dashboard
|
|
21653
|
-
2. Click "New Project"
|
|
21654
|
-
3. Upload this folder or connect to GitHub
|
|
21655
|
-
4. Set environment variables:
|
|
21656
|
-
- INKEEP_API_URL=your-api-url
|
|
21657
|
-
- INKEEP_TENANT_ID=your-tenant-id
|
|
21658
|
-
- NODE_ENV=production
|
|
21659
|
-
5. Deploy!
|
|
21660
|
-
|
|
21661
|
-
## Using Vercel CLI
|
|
21662
|
-
|
|
21663
|
-
\`\`\`bash
|
|
21664
|
-
cd ${outputDir}
|
|
21665
|
-
vercel --prod
|
|
21666
|
-
\`\`\`
|
|
21667
|
-
|
|
21610
|
+
const instructions = `
|
|
21668
21611
|
## Environment Variables
|
|
21669
21612
|
|
|
21670
21613
|
Make sure to set these in your Vercel project settings:
|
|
@@ -21672,37 +21615,39 @@ Make sure to set these in your Vercel project settings:
|
|
|
21672
21615
|
- INKEEP_TENANT_ID
|
|
21673
21616
|
- Any other variables from your .env file
|
|
21674
21617
|
`;
|
|
21675
|
-
await fs4.writeFile(join2(outputDir, "README
|
|
21676
|
-
spinner.succeed(`
|
|
21618
|
+
await fs4.writeFile(join2(outputDir, "README.md"), instructions);
|
|
21619
|
+
spinner.succeed(`Build created at ${outputDir}/`);
|
|
21620
|
+
console.log("");
|
|
21621
|
+
console.log(chalk3.green("\u2705 Build completed successfully!"));
|
|
21622
|
+
console.log("");
|
|
21623
|
+
console.log(chalk3.blue("\u{1F4C1} To run your dashboard:"));
|
|
21624
|
+
console.log(chalk3.gray(" cd"), chalk3.white(outputDir));
|
|
21625
|
+
console.log(chalk3.gray(" npm start"));
|
|
21677
21626
|
console.log("");
|
|
21678
|
-
console.log(chalk3.blue("\u{
|
|
21627
|
+
console.log(chalk3.blue("\u{1F310} Or with pnpm:"));
|
|
21628
|
+
console.log(chalk3.gray(" cd"), chalk3.white(outputDir));
|
|
21629
|
+
console.log(chalk3.gray(" pnpm start"));
|
|
21630
|
+
console.log("");
|
|
21631
|
+
console.log(chalk3.yellow("\u{1F4D6} See README.md for deployment instructions"));
|
|
21679
21632
|
console.log("");
|
|
21680
|
-
console.log(chalk3.yellow("\u{1F4D6} See README-VERCEL.md for deployment instructions"));
|
|
21681
21633
|
} catch (error) {
|
|
21682
|
-
spinner.fail("Failed to
|
|
21634
|
+
spinner.fail("Failed to build dashboard");
|
|
21683
21635
|
console.error(chalk3.red("Error:"), error instanceof Error ? error.message : "Unknown error");
|
|
21684
21636
|
throw error;
|
|
21685
21637
|
}
|
|
21686
21638
|
}
|
|
21687
21639
|
async function devCommand(options) {
|
|
21688
|
-
const {
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
outputDir = "./vercel-build",
|
|
21693
|
-
vercel = false
|
|
21694
|
-
} = options;
|
|
21695
|
-
if (vercel) {
|
|
21696
|
-
await copyVercelOutput();
|
|
21640
|
+
const { port, host, build, outputDir, path: path3 } = options;
|
|
21641
|
+
if (path3) {
|
|
21642
|
+
const rt = resolveWebRuntime(true);
|
|
21643
|
+
console.log(rt);
|
|
21697
21644
|
return;
|
|
21698
21645
|
}
|
|
21699
21646
|
if (build) {
|
|
21700
|
-
await
|
|
21701
|
-
console.log("");
|
|
21702
|
-
console.log(chalk3.blue("Next steps: Deploy the build folder to Vercel"));
|
|
21647
|
+
await buildNextApp({ outputDir });
|
|
21703
21648
|
return;
|
|
21704
21649
|
}
|
|
21705
|
-
startWebApp({ port, host });
|
|
21650
|
+
await startWebApp({ port, host });
|
|
21706
21651
|
}
|
|
21707
21652
|
|
|
21708
21653
|
// src/commands/init.ts
|
|
@@ -21872,15 +21817,17 @@ async function listGraphsCommand(options) {
|
|
|
21872
21817
|
const api = await ManagementApiClient.create(
|
|
21873
21818
|
config.agentsManageApiUrl,
|
|
21874
21819
|
configPath,
|
|
21875
|
-
config.tenantId
|
|
21820
|
+
config.tenantId,
|
|
21821
|
+
options.project
|
|
21822
|
+
// pass project ID as projectIdOverride
|
|
21876
21823
|
);
|
|
21877
21824
|
const spinner = ora3("Fetching graphs...").start();
|
|
21878
21825
|
try {
|
|
21879
21826
|
const graphs = await api.listGraphs();
|
|
21880
|
-
spinner.succeed(`Found ${graphs.length} graph(s)`);
|
|
21827
|
+
spinner.succeed(`Found ${graphs.length} graph(s) in project "${options.project}"`);
|
|
21881
21828
|
if (graphs.length === 0) {
|
|
21882
21829
|
console.log(
|
|
21883
|
-
chalk5.gray(
|
|
21830
|
+
chalk5.gray(`No graphs found in project "${options.project}". Define graphs in your project and run: inkeep push`)
|
|
21884
21831
|
);
|
|
21885
21832
|
return;
|
|
21886
21833
|
}
|
|
@@ -23532,7 +23479,10 @@ program.command("push").description("Push a project configuration to the backend
|
|
|
23532
23479
|
).option("--json", "Generate project data JSON file instead of pushing to backend").action(async (options) => {
|
|
23533
23480
|
await pushCommand(options);
|
|
23534
23481
|
});
|
|
23535
|
-
program.command("pull").description("Pull entire project configuration from backend and update local files").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--agents-manage-api-url <url>", "Override agents manage API URL").option(
|
|
23482
|
+
program.command("pull").description("Pull entire project configuration from backend and update local files").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--agents-manage-api-url <url>", "Override agents manage API URL").option(
|
|
23483
|
+
"--env <environment>",
|
|
23484
|
+
"Environment file to generate (development, staging, production). Defaults to development"
|
|
23485
|
+
).option("--json", "Generate project data JSON file instead of updating files").option("--debug", "Enable debug logging for LLM generation").action(async (options) => {
|
|
23536
23486
|
await pullProjectCommand(options);
|
|
23537
23487
|
});
|
|
23538
23488
|
program.command("chat [graph-id]").description(
|
|
@@ -23542,18 +23492,17 @@ program.command("chat [graph-id]").description(
|
|
|
23542
23492
|
const config = options.config || options.configFilePath;
|
|
23543
23493
|
await chatCommandEnhanced2(graphId, { ...options, config });
|
|
23544
23494
|
});
|
|
23545
|
-
program.command("list-graphs").description("List all available graphs for
|
|
23495
|
+
program.command("list-graphs").description("List all available graphs for a specific project").requiredOption("--project <project-id>", "Project ID to list graphs for").option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-manage-api-url <url>", "Agents manage API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (options) => {
|
|
23546
23496
|
const config = options.config || options.configFilePath;
|
|
23547
23497
|
await listGraphsCommand({ ...options, config });
|
|
23548
23498
|
});
|
|
23549
|
-
program.command("dev").description("Start the Inkeep dashboard server").option("--port <port>", "Port to run the server on", "3000").option("--host <host>", "Host to bind the server to", "localhost").option("--build", "
|
|
23499
|
+
program.command("dev").description("Start the Inkeep dashboard server").option("--port <port>", "Port to run the server on", "3000").option("--host <host>", "Host to bind the server to", "localhost").option("--build", "Build the Dashboard UI for production", false).option("--output-dir <dir>", "Output directory for build files", "./vercel-build").option("--path", "Output the path to the Dashboard UI", false).action(async (options) => {
|
|
23550
23500
|
await devCommand({
|
|
23551
23501
|
port: parseInt(options.port, 10),
|
|
23552
23502
|
host: options.host,
|
|
23553
23503
|
build: options.build,
|
|
23554
23504
|
outputDir: options.outputDir,
|
|
23555
|
-
|
|
23556
|
-
config: options.config
|
|
23505
|
+
path: options.path
|
|
23557
23506
|
});
|
|
23558
23507
|
});
|
|
23559
23508
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"recast": "^0.23.0",
|
|
46
46
|
"ts-morph": "^26.0.0",
|
|
47
47
|
"tsx": "^4.20.5",
|
|
48
|
-
"@inkeep/agents-core": "^0.6.
|
|
49
|
-
"@inkeep/agents-manage-ui": "^0.6.
|
|
48
|
+
"@inkeep/agents-core": "^0.6.5",
|
|
49
|
+
"@inkeep/agents-manage-ui": "^0.6.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/degit": "^2.8.6",
|