@inkeep/agents-cli 0.0.0-dev-20250911221549 → 0.0.0-dev-20250911232317
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create.js +148 -43
- package/dist/index.js +4360 -20421
- package/package.json +6 -3
package/dist/commands/create.js
CHANGED
|
@@ -7,6 +7,44 @@ import fs from "fs-extra";
|
|
|
7
7
|
import { exec } from "child_process";
|
|
8
8
|
import { promisify } from "util";
|
|
9
9
|
import path from "path";
|
|
10
|
+
|
|
11
|
+
// src/utils/model-config.ts
|
|
12
|
+
import inquirer from "inquirer";
|
|
13
|
+
var defaultDualModelConfigurations = {
|
|
14
|
+
base: {
|
|
15
|
+
model: "anthropic/claude-sonnet-4-20250514"
|
|
16
|
+
},
|
|
17
|
+
structuredOutput: {
|
|
18
|
+
model: "openai/gpt-4.1-mini-2025-04-14"
|
|
19
|
+
},
|
|
20
|
+
summarizer: {
|
|
21
|
+
model: "openai/gpt-4.1-nano-2025-04-14"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
var defaultOpenaiModelConfigurations = {
|
|
25
|
+
base: {
|
|
26
|
+
model: "openai/gpt-5-2025-08-07"
|
|
27
|
+
},
|
|
28
|
+
structuredOutput: {
|
|
29
|
+
model: "openai/gpt-4.1-mini-2025-04-14"
|
|
30
|
+
},
|
|
31
|
+
summarizer: {
|
|
32
|
+
model: "openai/gpt-4.1-nano-2025-04-14"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var defaultAnthropicModelConfigurations = {
|
|
36
|
+
base: {
|
|
37
|
+
model: "anthropic/claude-sonnet-4-20250514"
|
|
38
|
+
},
|
|
39
|
+
structuredOutput: {
|
|
40
|
+
model: "anthropic/claude-sonnet-4-20250514"
|
|
41
|
+
},
|
|
42
|
+
summarizer: {
|
|
43
|
+
model: "anthropic/claude-sonnet-4-20250514"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/commands/create.ts
|
|
10
48
|
var execAsync = promisify(exec);
|
|
11
49
|
var createAgents = async (args = {}) => {
|
|
12
50
|
let { tenantId, projectId, dirName, openAiKey, anthropicKey, manageApiPort, runApiPort } = args;
|
|
@@ -53,29 +91,86 @@ var createAgents = async (args = {}) => {
|
|
|
53
91
|
}
|
|
54
92
|
projectId = projectIdResponse;
|
|
55
93
|
}
|
|
56
|
-
if (!anthropicKey) {
|
|
57
|
-
const
|
|
58
|
-
message: "
|
|
59
|
-
|
|
60
|
-
|
|
94
|
+
if (!anthropicKey && !openAiKey) {
|
|
95
|
+
const providerChoice = await p.select({
|
|
96
|
+
message: "Which AI provider(s) would you like to use?",
|
|
97
|
+
options: [
|
|
98
|
+
{ value: "both", label: "Both Anthropic and OpenAI (recommended)" },
|
|
99
|
+
{ value: "anthropic", label: "Anthropic only" },
|
|
100
|
+
{ value: "openai", label: "OpenAI only" }
|
|
101
|
+
]
|
|
61
102
|
});
|
|
62
|
-
if (p.isCancel(
|
|
103
|
+
if (p.isCancel(providerChoice)) {
|
|
63
104
|
p.cancel("Operation cancelled");
|
|
64
105
|
process.exit(0);
|
|
65
106
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
107
|
+
if (providerChoice === "anthropic" || providerChoice === "both") {
|
|
108
|
+
const anthropicKeyResponse = await p.text({
|
|
109
|
+
message: "Enter your Anthropic API key:",
|
|
110
|
+
placeholder: "sk-ant-...",
|
|
111
|
+
validate: (value) => {
|
|
112
|
+
if (!value || value.trim() === "") {
|
|
113
|
+
return "Anthropic API key is required";
|
|
114
|
+
}
|
|
115
|
+
return void 0;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
if (p.isCancel(anthropicKeyResponse)) {
|
|
119
|
+
p.cancel("Operation cancelled");
|
|
120
|
+
process.exit(0);
|
|
121
|
+
}
|
|
122
|
+
anthropicKey = anthropicKeyResponse;
|
|
123
|
+
}
|
|
124
|
+
if (providerChoice === "openai" || providerChoice === "both") {
|
|
125
|
+
const openAiKeyResponse = await p.text({
|
|
126
|
+
message: "Enter your OpenAI API key:",
|
|
127
|
+
placeholder: "sk-...",
|
|
128
|
+
validate: (value) => {
|
|
129
|
+
if (!value || value.trim() === "") {
|
|
130
|
+
return "OpenAI API key is required";
|
|
131
|
+
}
|
|
132
|
+
return void 0;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
if (p.isCancel(openAiKeyResponse)) {
|
|
136
|
+
p.cancel("Operation cancelled");
|
|
137
|
+
process.exit(0);
|
|
138
|
+
}
|
|
139
|
+
openAiKey = openAiKeyResponse;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
if (!anthropicKey) {
|
|
143
|
+
const anthropicKeyResponse = await p.text({
|
|
144
|
+
message: "Enter your Anthropic API key (optional):",
|
|
145
|
+
placeholder: "sk-ant-...",
|
|
146
|
+
defaultValue: ""
|
|
147
|
+
});
|
|
148
|
+
if (p.isCancel(anthropicKeyResponse)) {
|
|
149
|
+
p.cancel("Operation cancelled");
|
|
150
|
+
process.exit(0);
|
|
151
|
+
}
|
|
152
|
+
anthropicKey = anthropicKeyResponse || void 0;
|
|
77
153
|
}
|
|
78
|
-
openAiKey
|
|
154
|
+
if (!openAiKey) {
|
|
155
|
+
const openAiKeyResponse = await p.text({
|
|
156
|
+
message: "Enter your OpenAI API key (optional):",
|
|
157
|
+
placeholder: "sk-...",
|
|
158
|
+
defaultValue: ""
|
|
159
|
+
});
|
|
160
|
+
if (p.isCancel(openAiKeyResponse)) {
|
|
161
|
+
p.cancel("Operation cancelled");
|
|
162
|
+
process.exit(0);
|
|
163
|
+
}
|
|
164
|
+
openAiKey = openAiKeyResponse || void 0;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
let defaultModelSettings = {};
|
|
168
|
+
if (anthropicKey && openAiKey) {
|
|
169
|
+
defaultModelSettings = defaultDualModelConfigurations;
|
|
170
|
+
} else if (anthropicKey) {
|
|
171
|
+
defaultModelSettings = defaultAnthropicModelConfigurations;
|
|
172
|
+
} else if (openAiKey) {
|
|
173
|
+
defaultModelSettings = defaultOpenaiModelConfigurations;
|
|
79
174
|
}
|
|
80
175
|
const s = p.spinner();
|
|
81
176
|
s.start("Creating directory structure...");
|
|
@@ -102,7 +197,8 @@ var createAgents = async (args = {}) => {
|
|
|
102
197
|
openAiKey,
|
|
103
198
|
anthropicKey,
|
|
104
199
|
manageApiPort: manageApiPort || "3002",
|
|
105
|
-
runApiPort: runApiPort || "3003"
|
|
200
|
+
runApiPort: runApiPort || "3003",
|
|
201
|
+
modelSettings: defaultModelSettings
|
|
106
202
|
};
|
|
107
203
|
s.message("Setting up workspace structure...");
|
|
108
204
|
await createWorkspaceStructure(projectId);
|
|
@@ -126,19 +222,19 @@ var createAgents = async (args = {}) => {
|
|
|
126
222
|
|
|
127
223
|
${color.yellow("Next steps:")}
|
|
128
224
|
cd ${dirName}
|
|
129
|
-
|
|
130
|
-
|
|
225
|
+
pnpm run dev (for APIs only)
|
|
226
|
+
inkeep dev (for APIs + Management Dashboard)
|
|
131
227
|
|
|
132
228
|
${color.yellow("Available services:")}
|
|
133
229
|
\u2022 Management API: http://localhost:${manageApiPort || "3002"}
|
|
134
230
|
\u2022 Execution API: http://localhost:${runApiPort || "3003"}
|
|
135
|
-
\u2022 Management Dashboard: Available with '
|
|
231
|
+
\u2022 Management Dashboard: Available with 'inkeep dev'
|
|
136
232
|
|
|
137
233
|
${color.yellow("Configuration:")}
|
|
138
234
|
\u2022 Edit .env for environment variables
|
|
139
235
|
\u2022 Edit src/${projectId}/hello.graph.ts for agent definitions
|
|
140
|
-
\u2022 Use '
|
|
141
|
-
\u2022 Use '
|
|
236
|
+
\u2022 Use 'inkeep push' to deploy agents to the platform
|
|
237
|
+
\u2022 Use 'inkeep chat' to test your agents locally
|
|
142
238
|
`,
|
|
143
239
|
"Ready to go!"
|
|
144
240
|
);
|
|
@@ -178,10 +274,13 @@ async function setupPackageConfigurations(dirName) {
|
|
|
178
274
|
engines: {
|
|
179
275
|
node: ">=22.x"
|
|
180
276
|
},
|
|
181
|
-
packageManager: "
|
|
182
|
-
workspaces: ["apps/*"]
|
|
277
|
+
packageManager: "pnpm@10.10.0"
|
|
183
278
|
};
|
|
184
279
|
await fs.writeJson("package.json", rootPackageJson, { spaces: 2 });
|
|
280
|
+
const pnpmWorkspace = `packages:
|
|
281
|
+
- "apps/*"
|
|
282
|
+
`;
|
|
283
|
+
await fs.writeFile("pnpm-workspace.yaml", pnpmWorkspace);
|
|
185
284
|
rootPackageJson.dependencies = {
|
|
186
285
|
"@inkeep/agents-core": "^0.1.0",
|
|
187
286
|
"@inkeep/agents-sdk": "^0.1.0",
|
|
@@ -402,14 +501,15 @@ export const graph = agentGraph({
|
|
|
402
501
|
await fs.writeFile(`src/${config.projectId}/hello.graph.ts`, agentsGraph);
|
|
403
502
|
const inkeepConfig = `import { defineConfig } from '@inkeep/agents-cli/config';
|
|
404
503
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
504
|
+
const config = defineConfig({
|
|
505
|
+
tenantId: "${config.tenantId}",
|
|
506
|
+
projectId: "${config.projectId}",
|
|
507
|
+
agentsManageApiUrl: \`http://localhost:\${process.env.MANAGE_API_PORT || '3002'}\`,
|
|
508
|
+
agentsRunApiUrl: \`http://localhost:\${process.env.RUN_API_PORT || '3003'}\`,
|
|
509
|
+
modelSettings: ${JSON.stringify(config.modelSettings, null, 2)},
|
|
510
|
+
});
|
|
411
511
|
|
|
412
|
-
|
|
512
|
+
export default config;`;
|
|
413
513
|
await fs.writeFile(`src/${config.projectId}/inkeep.config.ts`, inkeepConfig);
|
|
414
514
|
const projectEnvContent = `# Environment
|
|
415
515
|
ENVIRONMENT=development
|
|
@@ -576,18 +676,22 @@ This project follows a workspace structure with the following services:
|
|
|
576
676
|
- Handles entity management and configuration endpoints.
|
|
577
677
|
- **Agents Run API** (Port 3003): Agent execution and chat processing
|
|
578
678
|
- Handles agent communication. You can interact with your agents either over MCP from an MCP client or through our React UI components library
|
|
579
|
-
- **Management Dashboard** (Port 3000): Web interface available via \`
|
|
679
|
+
- **Management Dashboard** (Port 3000): Web interface available via \`inkeep dev\`
|
|
580
680
|
- The agent framework visual builder. From the builder you can create, manage and visualize all your graphs.
|
|
581
681
|
|
|
582
682
|
## Quick Start
|
|
683
|
+
1. **Install the Inkeep CLI:**
|
|
684
|
+
\`\`\`bash
|
|
685
|
+
pnpm install -g @inkeep/agents-cli
|
|
686
|
+
\`\`\`
|
|
583
687
|
|
|
584
688
|
1. **Start services:**
|
|
585
689
|
\`\`\`bash
|
|
586
690
|
# Start Agents Management API and Agents Run API
|
|
587
|
-
|
|
691
|
+
pnpm run dev
|
|
588
692
|
|
|
589
693
|
# Start Dashboard
|
|
590
|
-
|
|
694
|
+
inkeep dev
|
|
591
695
|
\`\`\`
|
|
592
696
|
|
|
593
697
|
3. **Deploy your first agent graph:**
|
|
@@ -596,7 +700,7 @@ This project follows a workspace structure with the following services:
|
|
|
596
700
|
cd src/${config.projectId}/
|
|
597
701
|
|
|
598
702
|
# Push the hello graph to create it
|
|
599
|
-
|
|
703
|
+
inkeep push hello.graph.ts
|
|
600
704
|
\`\`\`
|
|
601
705
|
- Follow the prompts to create the project and graph
|
|
602
706
|
- Click on the "View graph in UI:" link to see the graph in the management dashboard
|
|
@@ -613,7 +717,8 @@ ${config.dirName}/
|
|
|
613
717
|
\u2502 \u2514\u2500\u2500 shared/ # Shared code between API services
|
|
614
718
|
\u2502 \u2514\u2500\u2500 credential-stores.ts # Shared credential store configuration
|
|
615
719
|
\u251C\u2500\u2500 turbo.json # Turbo configuration
|
|
616
|
-
\
|
|
720
|
+
\u251C\u2500\u2500 pnpm-workspace.yaml # pnpm workspace configuration
|
|
721
|
+
\u2514\u2500\u2500 package.json # Root package configuration
|
|
617
722
|
\`\`\`
|
|
618
723
|
|
|
619
724
|
## Configuration
|
|
@@ -645,7 +750,7 @@ RUN_API_PORT=3003
|
|
|
645
750
|
MANAGE_API_PORT
|
|
646
751
|
\`\`\`
|
|
647
752
|
|
|
648
|
-
After changing the API Service ports make sure that you modify the dashboard API urls from whichever directory you are running \`
|
|
753
|
+
After changing the API Service ports make sure that you modify the dashboard API urls from whichever directory you are running \`inkeep dev\`:
|
|
649
754
|
|
|
650
755
|
\`\`\`bash
|
|
651
756
|
# UI Configuration (for dashboard)
|
|
@@ -672,7 +777,7 @@ Your inkeep configuration is defined in \`src/${config.projectId}/inkeep.config.
|
|
|
672
777
|
### Updating Your Agents
|
|
673
778
|
|
|
674
779
|
1. Edit \`src/${config.projectId}/index.ts\`
|
|
675
|
-
2. Push the graph to the platform to update: \`
|
|
780
|
+
2. Push the graph to the platform to update: \`inkeep push hello.graph.ts\`
|
|
676
781
|
|
|
677
782
|
### API Documentation
|
|
678
783
|
|
|
@@ -695,7 +800,7 @@ Once services are running, view the OpenAPI documentation:
|
|
|
695
800
|
|
|
696
801
|
### Services won't start
|
|
697
802
|
|
|
698
|
-
1. Ensure all dependencies are installed: \`
|
|
803
|
+
1. Ensure all dependencies are installed: \`pnpm install\`
|
|
699
804
|
2. Check that ports 3000-3003 are available
|
|
700
805
|
|
|
701
806
|
### Agents won't respond
|
|
@@ -705,11 +810,11 @@ Once services are running, view the OpenAPI documentation:
|
|
|
705
810
|
await fs.writeFile("README.md", readme);
|
|
706
811
|
}
|
|
707
812
|
async function installDependencies() {
|
|
708
|
-
await execAsync("
|
|
813
|
+
await execAsync("pnpm install");
|
|
709
814
|
}
|
|
710
815
|
async function setupDatabase() {
|
|
711
816
|
try {
|
|
712
|
-
await execAsync("
|
|
817
|
+
await execAsync("pnpm db:push");
|
|
713
818
|
} catch (error) {
|
|
714
819
|
throw new Error(
|
|
715
820
|
`Failed to setup database: ${error instanceof Error ? error.message : "Unknown error"}`
|