@inkeep/agents-cli 0.0.0-chat-to-edit-20251119071712
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/LICENSE.md +56 -0
- package/README.md +631 -0
- package/SUPPLEMENTAL_TERMS.md +40 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.js +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +258903 -0
- package/package.json +98 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
3
|
+
Source: ./LICENSE.md
|
|
4
|
+
This file is automatically copied from the root LICENSE.md during build.
|
|
5
|
+
Any changes should be made to the root LICENSE.md file.
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
# Inkeep SDK β Elastic License 2.0 with Supplemental Terms
|
|
9
|
+
|
|
10
|
+
NOTE: The Inkeep SDK is licensed under the Elastic License 2.0 (ELv2), subject to Supplemental Terms included in [SUPPLEMENTAL_TERMS.md](SUPPLEMENTAL_TERMS.md). In the event of conflict, the Supplemental Terms control.
|
|
11
|
+
|
|
12
|
+
# Elastic License 2.0
|
|
13
|
+
|
|
14
|
+
## Acceptance
|
|
15
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
16
|
+
|
|
17
|
+
## Copyright License
|
|
18
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.
|
|
19
|
+
|
|
20
|
+
## Limitations
|
|
21
|
+
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
|
|
22
|
+
|
|
23
|
+
You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
|
|
24
|
+
|
|
25
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensorβs trademarks is subject to applicable law.
|
|
26
|
+
|
|
27
|
+
## Patents
|
|
28
|
+
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
29
|
+
|
|
30
|
+
## Notices
|
|
31
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
|
32
|
+
|
|
33
|
+
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
|
34
|
+
|
|
35
|
+
## No Other Rights
|
|
36
|
+
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
37
|
+
|
|
38
|
+
## Termination
|
|
39
|
+
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
|
40
|
+
|
|
41
|
+
## No Liability
|
|
42
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
43
|
+
|
|
44
|
+
## Definitions
|
|
45
|
+
The **licensor** is the entity offering these terms, and the **software** is the software the licensor makes available under these terms, including any portion of it.
|
|
46
|
+
|
|
47
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
48
|
+
|
|
49
|
+
**your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
50
|
+
|
|
51
|
+
**your licenses** are all the licenses granted to you for the software under these terms.
|
|
52
|
+
|
|
53
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
54
|
+
|
|
55
|
+
**trademark** means trademarks, service marks, and similar rights.
|
|
56
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
# Inkeep CLI
|
|
2
|
+
|
|
3
|
+
A command-line interface for managing and interacting with Inkeep Agent Frameworks.
|
|
4
|
+
|
|
5
|
+
## Installation & Setup
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js >= 20.x
|
|
10
|
+
- pnpm package manager
|
|
11
|
+
- Inkeep Agent Framework backend running (default: http://localhost:3002)
|
|
12
|
+
- `@inkeep/agents-manage-ui` package installed (for visual agents orchestration)
|
|
13
|
+
|
|
14
|
+
### Quick Start
|
|
15
|
+
|
|
16
|
+
> **π For detailed setup instructions, see [SETUP.md](./SETUP.md)**
|
|
17
|
+
|
|
18
|
+
1. **Install and build**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Navigate to the CLI directory
|
|
22
|
+
cd /path/to/agent-framework/agents-cli
|
|
23
|
+
|
|
24
|
+
# Install dependencies
|
|
25
|
+
pnpm install
|
|
26
|
+
|
|
27
|
+
# Build the CLI
|
|
28
|
+
pnpm build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. **Install globally** (recommended)
|
|
32
|
+
|
|
33
|
+
**Option A: Using npm link (for development)**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Create global symlink from the agents-cli directory
|
|
37
|
+
npm link
|
|
38
|
+
|
|
39
|
+
# Verify installation
|
|
40
|
+
which inkeep # Should show path to inkeep command
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Option B: Using pnpm/npm global install (after publishing)**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Install the scoped package globally
|
|
47
|
+
pnpm add -g @inkeep/agents-cli
|
|
48
|
+
# or
|
|
49
|
+
npm install -g @inkeep/agents-cli
|
|
50
|
+
|
|
51
|
+
# Verify installation
|
|
52
|
+
inkeep --version
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Note:**
|
|
56
|
+
|
|
57
|
+
- For local development, use `npm link` (more reliable than `pnpm link --global`)
|
|
58
|
+
- The command is still `inkeep` even though the package name is `@inkeep/agents-cli`
|
|
59
|
+
- If linking fails, try unlinking first: `npm unlink -g @inkeep/agents-cli`
|
|
60
|
+
|
|
61
|
+
3. **Install the dashboard package (for visual agents orchestration)**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Install the dashboard UI package for visual agents orchestration
|
|
65
|
+
npm install @inkeep/agents-manage-ui
|
|
66
|
+
# or
|
|
67
|
+
pnpm add @inkeep/agents-manage-ui
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
4. **Configure your project**
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Create an inkeep.config.ts file with your tenant ID
|
|
74
|
+
inkeep init
|
|
75
|
+
|
|
76
|
+
# Or manually create inkeep.config.ts:
|
|
77
|
+
# export default defineConfig({
|
|
78
|
+
# tenantId: "your-tenant-id",
|
|
79
|
+
# projectId: "your-project-id",
|
|
80
|
+
# agentsManageApiUrl: "http://localhost:3002",
|
|
81
|
+
# agentsRunApiUrl: "http://localhost:3003"
|
|
82
|
+
# });
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Configuration
|
|
86
|
+
|
|
87
|
+
### Configuration Sources (priority order)
|
|
88
|
+
|
|
89
|
+
1. **Command-line flags** - Highest priority (e.g., `--tenant-id`, `--agents-manage-api-url`, `--config`)
|
|
90
|
+
2. **Config file** - `inkeep.config.ts` (or file specified with `--config`)
|
|
91
|
+
3. **Environment variables** - `INKEEP_AGENTS_MANAGE_API_URL`, `INKEEP_AGENTS_RUN_API_URL`
|
|
92
|
+
4. **Defaults** - Lowest priority (defaults to `http://localhost:3002` and `http://localhost:3003`)
|
|
93
|
+
|
|
94
|
+
### Config File Options
|
|
95
|
+
|
|
96
|
+
Most commands support the `--config` option to specify a custom configuration file:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Use custom config file
|
|
100
|
+
inkeep list-graphs --project my-project --config ./staging-config.ts
|
|
101
|
+
|
|
102
|
+
# Backward compatibility (deprecated)
|
|
103
|
+
inkeep list-graphs --project my-project --config-file-path ./staging-config.ts
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Environment Variables
|
|
107
|
+
|
|
108
|
+
Create a `.env` file in your project directory:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
INKEEP_AGENTS_MANAGE_API_URL=http://localhost:3002
|
|
112
|
+
INKEEP_AGENTS_RUN_API_URL=http://localhost:3003
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Or export them in your shell:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
export INKEEP_AGENTS_MANAGE_API_URL=http://localhost:3002
|
|
119
|
+
export INKEEP_AGENTS_RUN_API_URL=http://localhost:3003
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Commands
|
|
123
|
+
|
|
124
|
+
### `inkeep add [template]`
|
|
125
|
+
|
|
126
|
+
Pull a template project from the [Inkeep Agents Cookbook](https://github.com/inkeep/agents/tree/main/agents-cookbook/template-projects).
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Add a template
|
|
130
|
+
inkeep add my-template
|
|
131
|
+
|
|
132
|
+
# Add template to specific path
|
|
133
|
+
inkeep add my-template --target-path ./src/templates
|
|
134
|
+
|
|
135
|
+
# Using config file
|
|
136
|
+
inkeep add my-template --config ./my-config.ts
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### `inkeep init [path]`
|
|
140
|
+
|
|
141
|
+
Initialize a new Inkeep configuration file.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Interactive initialization
|
|
145
|
+
inkeep init
|
|
146
|
+
|
|
147
|
+
# Initialize in specific directory
|
|
148
|
+
inkeep init ./my-project
|
|
149
|
+
|
|
150
|
+
# Skip interactive prompts
|
|
151
|
+
inkeep init --no-interactive
|
|
152
|
+
|
|
153
|
+
# Use existing config as template
|
|
154
|
+
inkeep init --config ./template-config.ts
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `inkeep config`
|
|
158
|
+
|
|
159
|
+
Manage Inkeep configuration values.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Get configuration value
|
|
163
|
+
inkeep config get tenantId
|
|
164
|
+
|
|
165
|
+
# Set configuration value
|
|
166
|
+
inkeep config set tenantId my-tenant-id
|
|
167
|
+
|
|
168
|
+
# List all configuration values
|
|
169
|
+
inkeep config list
|
|
170
|
+
|
|
171
|
+
# Using specific config file
|
|
172
|
+
inkeep config get tenantId --config ./my-config.ts
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### `inkeep pull`
|
|
176
|
+
|
|
177
|
+
Pull entire project configuration from backend and update local files.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Pull current project
|
|
181
|
+
inkeep pull
|
|
182
|
+
|
|
183
|
+
# Pull specific project
|
|
184
|
+
inkeep pull --project my-project-id
|
|
185
|
+
|
|
186
|
+
# Generate environment file
|
|
187
|
+
inkeep pull --env production
|
|
188
|
+
|
|
189
|
+
# Generate JSON file instead of updating files
|
|
190
|
+
inkeep pull --json
|
|
191
|
+
|
|
192
|
+
# Enable debug logging
|
|
193
|
+
inkeep pull --debug
|
|
194
|
+
|
|
195
|
+
# Using config file
|
|
196
|
+
inkeep pull --project my-project-id --config ./my-config.ts
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### `inkeep dev`
|
|
200
|
+
|
|
201
|
+
Start the Inkeep dashboard server, build for production, or export the Next.js project.
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Start development server
|
|
205
|
+
inkeep dev
|
|
206
|
+
|
|
207
|
+
# Start on custom port and host
|
|
208
|
+
inkeep dev --port 3001 --host 0.0.0.0
|
|
209
|
+
|
|
210
|
+
# Build for production (packages standalone build)
|
|
211
|
+
inkeep dev --build --output-dir ./build
|
|
212
|
+
|
|
213
|
+
# Export Next.js project source files
|
|
214
|
+
inkeep dev --export --output-dir ./my-dashboard
|
|
215
|
+
|
|
216
|
+
# Get dashboard path for deployment
|
|
217
|
+
DASHBOARD_PATH=$(inkeep dev --path)
|
|
218
|
+
echo "Dashboard built at: $DASHBOARD_PATH"
|
|
219
|
+
|
|
220
|
+
# Use with Vercel
|
|
221
|
+
vercel --cwd $(inkeep dev --path) -Q .vercel build
|
|
222
|
+
|
|
223
|
+
# Use with Docker
|
|
224
|
+
docker build -t inkeep-dashboard $(inkeep dev --path)
|
|
225
|
+
|
|
226
|
+
# Use with other deployment tools
|
|
227
|
+
rsync -av $(inkeep dev --path)/ user@server:/var/www/dashboard/
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### `inkeep tenant [tenant-id]` β οΈ NOT IMPLEMENTED
|
|
231
|
+
|
|
232
|
+
> **β οΈ WARNING: This command is not yet implemented in the current CLI.**
|
|
233
|
+
> Use `inkeep.config.ts` to set your tenant ID instead.
|
|
234
|
+
|
|
235
|
+
Manage tenant configuration.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Set tenant ID
|
|
239
|
+
inkeep tenant my-tenant
|
|
240
|
+
|
|
241
|
+
# View current tenant ID
|
|
242
|
+
inkeep tenant
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### `inkeep list-graphs`
|
|
246
|
+
|
|
247
|
+
List all available graphs for a specific project.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# List graphs for a project (required)
|
|
251
|
+
inkeep list-graphs --project my-project-id
|
|
252
|
+
|
|
253
|
+
# With custom API URL
|
|
254
|
+
inkeep list-graphs --project my-project-id --agents-manage-api-url http://api.example.com:3002
|
|
255
|
+
|
|
256
|
+
# With custom tenant ID
|
|
257
|
+
inkeep list-graphs --project my-project-id --tenant-id my-tenant-id
|
|
258
|
+
|
|
259
|
+
# Using config file
|
|
260
|
+
inkeep list-agents --project my-project-id --config ./my-config.ts
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Output:
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
βββββββββββββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββ
|
|
267
|
+
β Agent ID β Name β Default Agent β Created β
|
|
268
|
+
βββββββββββββββββββββββββββΌβββββββββββββββββββββΌββββββββββββββββΌββββββββββββ€
|
|
269
|
+
β customer-support-graph β Customer Support β router β 1/15/2025 β
|
|
270
|
+
β qa-assistant β QA Assistant β qa-agent β 1/14/2025 β
|
|
271
|
+
βββββββββββββββββββββββββββ΄βββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββ
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### `inkeep push`
|
|
275
|
+
|
|
276
|
+
Push your project configuration to the backend.
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# Push the current project (from the directory with inkeep.config.ts)
|
|
280
|
+
inkeep push
|
|
281
|
+
|
|
282
|
+
# Push specific project
|
|
283
|
+
inkeep push --project my-project-id
|
|
284
|
+
|
|
285
|
+
# With custom configuration
|
|
286
|
+
inkeep push --project my-project-id --config ./my-config.ts
|
|
287
|
+
|
|
288
|
+
# With custom API URLs
|
|
289
|
+
inkeep push --project my-project-id --agents-manage-api-url http://manage.example.com --agents-run-api-url http://run.example.com
|
|
290
|
+
|
|
291
|
+
# With custom tenant ID
|
|
292
|
+
inkeep push --project my-project-id --tenant-id my-tenant-id
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Features:**
|
|
296
|
+
|
|
297
|
+
- Automatically injects tenant ID and API URL from `inkeep.config.ts`
|
|
298
|
+
- Validates exactly one Agent is exported
|
|
299
|
+
- Warns about dangling resources (unreferenced agents/tools)
|
|
300
|
+
- Shows graph summary after successful push
|
|
301
|
+
- Handles graph initialization automatically
|
|
302
|
+
|
|
303
|
+
**Agent files:** Define your agents in your project (e.g., `agents/*.ts`). The CLI pushes the project containing those agents.
|
|
304
|
+
|
|
305
|
+
**Example graph configuration:**
|
|
306
|
+
|
|
307
|
+
```javascript
|
|
308
|
+
// customer-support.agent.ts
|
|
309
|
+
import { agent, subAgent, tool } from "@inkeep/agents-sdk";
|
|
310
|
+
|
|
311
|
+
const assistantSubAgent = subAgent({
|
|
312
|
+
id: "assistant",
|
|
313
|
+
name: "Assistant",
|
|
314
|
+
prompt: "Help users with their questions",
|
|
315
|
+
canUse: () => [searchTool],
|
|
316
|
+
// No tenantId needed - injected by CLI
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// Must export exactly one agent
|
|
320
|
+
export const myAgent = agent({
|
|
321
|
+
id: "my-assistant",
|
|
322
|
+
name: "My Assistant",
|
|
323
|
+
defaultSubAgent: assistantSubAgent,
|
|
324
|
+
subAgents: () => [assistantSubAgent],
|
|
325
|
+
// No tenantId or apiUrl needed - CLI injects from config
|
|
326
|
+
});
|
|
327
|
+
// No agent.init() call - CLI handles initialization
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### `inkeep mcp start <graph-file>` β οΈ NOT IMPLEMENTED
|
|
331
|
+
|
|
332
|
+
> **β οΈ WARNING: This command is not yet implemented in the current CLI.**
|
|
333
|
+
> MCP functionality is planned but not available in the current version.
|
|
334
|
+
|
|
335
|
+
Start MCP (Model Context Protocol) servers defined in a graph file.
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# Start MCP servers from a TypeScript agent file
|
|
339
|
+
inkeep mcp start examples/agent-configurations/weather-agent.ts
|
|
340
|
+
|
|
341
|
+
# Start from compiled JavaScript
|
|
342
|
+
inkeep mcp start dist/examples/agent-configurations/weather-agent.js
|
|
343
|
+
|
|
344
|
+
# Run in detached mode
|
|
345
|
+
inkeep mcp start my-agent.ts --detached
|
|
346
|
+
|
|
347
|
+
# Show verbose output
|
|
348
|
+
inkeep mcp start my-agent.ts --verbose
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Features:**
|
|
352
|
+
|
|
353
|
+
- Supports both TypeScript (`.ts`) and JavaScript (`.js`) files
|
|
354
|
+
- Automatically allocates ports for local servers (3100-3200)
|
|
355
|
+
- Shows server names, ports, and URLs
|
|
356
|
+
- Distinguishes between local (π ) and remote (βοΈ) servers
|
|
357
|
+
|
|
358
|
+
### `inkeep mcp stop` β οΈ NOT IMPLEMENTED
|
|
359
|
+
|
|
360
|
+
> **β οΈ WARNING: This command is not yet implemented in the current CLI.**
|
|
361
|
+
|
|
362
|
+
Stop running MCP servers.
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
# Stop all servers
|
|
366
|
+
inkeep mcp stop --all
|
|
367
|
+
|
|
368
|
+
# Stop servers for a specific graph
|
|
369
|
+
inkeep mcp stop --graph customer-support-graph
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### `inkeep mcp status` β οΈ NOT IMPLEMENTED
|
|
373
|
+
|
|
374
|
+
> **β οΈ WARNING: This command is not yet implemented in the current CLI.**
|
|
375
|
+
|
|
376
|
+
Show status of all MCP servers.
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
inkeep mcp status
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Output shows:
|
|
383
|
+
|
|
384
|
+
- Process ID
|
|
385
|
+
- Graph ID
|
|
386
|
+
- Tool name
|
|
387
|
+
- Port/URL
|
|
388
|
+
- Running status
|
|
389
|
+
- Uptime
|
|
390
|
+
|
|
391
|
+
### `inkeep mcp list` β οΈ NOT IMPLEMENTED
|
|
392
|
+
|
|
393
|
+
> **β οΈ WARNING: This command is not yet implemented in the current CLI.**
|
|
394
|
+
|
|
395
|
+
List all MCP servers with detailed information.
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# Default tree view
|
|
399
|
+
inkeep mcp list
|
|
400
|
+
|
|
401
|
+
# Table format
|
|
402
|
+
inkeep mcp list --format table
|
|
403
|
+
|
|
404
|
+
# Verbose output (includes descriptions)
|
|
405
|
+
inkeep mcp list --verbose
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
## Complete Workflow Example
|
|
409
|
+
|
|
410
|
+
### Basic Setup
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
# Install and link CLI
|
|
414
|
+
cd agents-cli
|
|
415
|
+
pnpm install
|
|
416
|
+
pnpm build
|
|
417
|
+
npm link
|
|
418
|
+
|
|
419
|
+
# Initialize configuration
|
|
420
|
+
inkeep init
|
|
421
|
+
# Edit inkeep.config.ts to set your tenantId and projectId
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Working with Graphs and MCP Servers β οΈ NOT AVAILABLE
|
|
425
|
+
|
|
426
|
+
> **β οΈ WARNING: MCP commands shown below are not yet implemented.**
|
|
427
|
+
> This section shows planned functionality that is not available in the current version.
|
|
428
|
+
|
|
429
|
+
1. **Create an agent with MCP tools** (`my-agent.ts`)
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
import {
|
|
433
|
+
agent,
|
|
434
|
+
subAgent,
|
|
435
|
+
mcpServer,
|
|
436
|
+
} from "@inkeep/agents-sdk";
|
|
437
|
+
|
|
438
|
+
// Define MCP servers (tools)
|
|
439
|
+
const randomNumberServer = mcpServer({
|
|
440
|
+
name: "random_number",
|
|
441
|
+
description: "Generates a random number",
|
|
442
|
+
execute: async () => Math.random(),
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
const weatherServer = mcpServer({
|
|
446
|
+
name: "weather_api",
|
|
447
|
+
description: "Get weather information",
|
|
448
|
+
serverUrl: "https://api.weather.example.com/mcp",
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// Define sub-agents
|
|
452
|
+
const assistantSubAgent = subAgent({
|
|
453
|
+
id: "assistant",
|
|
454
|
+
name: "Assistant",
|
|
455
|
+
prompt: "Help users with various tasks",
|
|
456
|
+
canUse: () => [randomNumberServer, weatherServer],
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// Export the agent
|
|
460
|
+
export const myAgent = agent({
|
|
461
|
+
id: "my-assistant",
|
|
462
|
+
name: "My Assistant",
|
|
463
|
+
defaultSubAgent: assistantSubAgent,
|
|
464
|
+
subAgents: () => [assistantSubAgent],
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
// Export servers for MCP management
|
|
468
|
+
export const servers = [randomNumberServer, weatherServer];
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
2. **Monitor and manage servers**
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Check server status
|
|
475
|
+
inkeep mcp status
|
|
476
|
+
|
|
477
|
+
# List all servers with details
|
|
478
|
+
inkeep mcp list
|
|
479
|
+
|
|
480
|
+
# Stop servers when done
|
|
481
|
+
inkeep mcp stop --all
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
## Working with Different Environments
|
|
485
|
+
|
|
486
|
+
### Development
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
# Using environment variables
|
|
490
|
+
INKEEP_AGENTS_MANAGE_API_URL=http://localhost:3002 inkeep list-graphs
|
|
491
|
+
|
|
492
|
+
# Using .env file
|
|
493
|
+
echo "INKEEP_AGENTS_MANAGE_API_URL=http://localhost:3002" > .env
|
|
494
|
+
echo "INKEEP_AGENTS_RUN_API_URL=http://localhost:3003" >> .env
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Staging
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
# Set in config file
|
|
501
|
+
# Edit your inkeep.config.ts:
|
|
502
|
+
# agentsManageApiUrl: 'https://staging-manage-api.example.com'
|
|
503
|
+
# agentsRunApiUrl: 'https://staging-run-api.example.com'
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### Production
|
|
507
|
+
|
|
508
|
+
```bash
|
|
509
|
+
# Using environment variables
|
|
510
|
+
export INKEEP_AGENTS_MANAGE_API_URL=https://manage-api.example.com
|
|
511
|
+
export INKEEP_AGENTS_RUN_API_URL=https://run-api.example.com
|
|
512
|
+
inkeep list-graphs
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
## Development
|
|
516
|
+
|
|
517
|
+
### Running from Source
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
# Without building (using tsx)
|
|
521
|
+
pnpm tsx src/index.ts <command>
|
|
522
|
+
|
|
523
|
+
# After building
|
|
524
|
+
node dist/index.js <command>
|
|
525
|
+
|
|
526
|
+
# Watch mode (auto-rebuild on changes)
|
|
527
|
+
pnpm dev
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Testing
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
# Run tests
|
|
534
|
+
pnpm test
|
|
535
|
+
|
|
536
|
+
# Watch mode
|
|
537
|
+
pnpm test:watch
|
|
538
|
+
|
|
539
|
+
# Coverage report
|
|
540
|
+
pnpm test:coverage
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### Type Checking
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
pnpm typecheck
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### Project Structure
|
|
550
|
+
|
|
551
|
+
```
|
|
552
|
+
agents-cli/
|
|
553
|
+
βββ src/
|
|
554
|
+
β βββ index.ts # Main CLI entry point
|
|
555
|
+
β βββ config.ts # Configuration management
|
|
556
|
+
β βββ api.ts # API client for backend
|
|
557
|
+
β βββ commands/ # Command implementations
|
|
558
|
+
β β βββ push.ts # Push graph configurations
|
|
559
|
+
β β βββ tenant.ts # Tenant management
|
|
560
|
+
β β βββ list-graphs.ts # List graphs
|
|
561
|
+
β βββ types/ # TypeScript declarations
|
|
562
|
+
β βββ __tests__/ # Test files
|
|
563
|
+
βββ dist/ # Compiled JavaScript
|
|
564
|
+
βββ package.json
|
|
565
|
+
βββ tsconfig.json
|
|
566
|
+
βββ README.md
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
## Troubleshooting
|
|
570
|
+
|
|
571
|
+
### Common Issues
|
|
572
|
+
|
|
573
|
+
**"Failed to fetch graphs" or connection errors**
|
|
574
|
+
|
|
575
|
+
```bash
|
|
576
|
+
# Check if backend is running
|
|
577
|
+
curl http://localhost:3002/health
|
|
578
|
+
|
|
579
|
+
# Verify API URLs
|
|
580
|
+
echo $INKEEP_AGENTS_MANAGE_API_URL
|
|
581
|
+
echo $INKEEP_AGENTS_RUN_API_URL
|
|
582
|
+
|
|
583
|
+
# Try with explicit URL and project
|
|
584
|
+
inkeep list-graphs --project my-project-id --agents-manage-api-url http://localhost:3002
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
**Command not found: inkeep**
|
|
588
|
+
|
|
589
|
+
```bash
|
|
590
|
+
# Ensure CLI is linked globally
|
|
591
|
+
cd agents-cli
|
|
592
|
+
npm link
|
|
593
|
+
|
|
594
|
+
# Or if published, install globally
|
|
595
|
+
pnpm add -g @inkeep/agents-cli
|
|
596
|
+
# or
|
|
597
|
+
npm install -g @inkeep/agents-cli
|
|
598
|
+
|
|
599
|
+
# Or add to PATH manually (for development)
|
|
600
|
+
export PATH="$PATH:/path/to/agents-cli/dist"
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
## Dependencies
|
|
604
|
+
|
|
605
|
+
### Runtime Dependencies
|
|
606
|
+
|
|
607
|
+
- **commander**: Command-line framework
|
|
608
|
+
- **chalk**: Terminal styling
|
|
609
|
+
- **dotenv**: Environment variable loading
|
|
610
|
+
- **ora**: Loading spinners
|
|
611
|
+
- **cli-table3**: Table formatting
|
|
612
|
+
- **inquirer**: Interactive prompts
|
|
613
|
+
- **inquirer-autocomplete-prompt**: Searchable selections
|
|
614
|
+
|
|
615
|
+
### Development Dependencies
|
|
616
|
+
|
|
617
|
+
- **typescript**: TypeScript compiler
|
|
618
|
+
- **@types/node**: Node.js types
|
|
619
|
+
- **vitest**: Testing framework
|
|
620
|
+
- **@vitest/coverage-v8**: Coverage reporting
|
|
621
|
+
|
|
622
|
+
## Requirements
|
|
623
|
+
|
|
624
|
+
- Node.js >= 20.x
|
|
625
|
+
- pnpm package manager
|
|
626
|
+
- TypeScript 5.x
|
|
627
|
+
- Inkeep Agent Framework backend
|
|
628
|
+
|
|
629
|
+
## License
|
|
630
|
+
|
|
631
|
+
MIT
|