@inkeep/agents-cli 0.5.0 → 0.6.4
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/commands/create.d.ts +12 -0
- package/dist/commands/create.js +869 -0
- package/dist/config.d.ts +0 -4
- package/dist/index.js +1533 -837
- package/package.json +5 -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
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const createAgents: (args?: {
|
|
2
|
+
tenantId?: string;
|
|
3
|
+
projectId?: string;
|
|
4
|
+
dirName?: string;
|
|
5
|
+
openAiKey?: string;
|
|
6
|
+
anthropicKey?: string;
|
|
7
|
+
manageApiPort?: string;
|
|
8
|
+
runApiPort?: string;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
declare function createCommand(dirName?: string, options?: any): Promise<void>;
|
|
11
|
+
|
|
12
|
+
export { createAgents, createCommand };
|