create-bk-agent 0.21.0 → 0.21.2
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 +194 -134
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,210 +1,270 @@
|
|
|
1
1
|
# create-bk-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI scaffolding tool for the BackendKit Labs agent framework. Generates a fully configured TypeScript agent project in seconds — choose your architecture, deployment mode, and LLM provider, and get a working project with all dependencies wired.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Create a project
|
|
5
|
+
## Usage
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
The CLI asks three questions and generates a production-ready project:
|
|
8
|
+
npm create bk-agent@latest my-agent
|
|
9
|
+
cd my-agent && npm install && npm run dev
|
|
14
10
|
|
|
11
|
+
# Or with npx:
|
|
12
|
+
npx create-bk-agent my-agent
|
|
15
13
|
```
|
|
16
|
-
✨ create-bk-agent v0.20.0
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
? Architecture: Multi-agent (orchestrator + specialists)
|
|
20
|
-
? Skill packs: Node.js / TypeScript
|
|
21
|
-
? How will it be used? MCP Server (HTTP)
|
|
15
|
+
---
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
Installing dependencies...
|
|
17
|
+
## Interactive setup
|
|
25
18
|
|
|
26
|
-
|
|
19
|
+
The CLI asks three questions:
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
1. **Architecture** — what kind of agent?
|
|
22
|
+
2. **Deploy mode** — how will it be used?
|
|
23
|
+
3. **Provider** — which LLM API?
|
|
24
|
+
|
|
25
|
+
---
|
|
32
26
|
|
|
33
27
|
## Architectures
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|---|---|---|
|
|
37
|
-
| `multi-agent` | Orchestrator + specialists with delegation | Domain agents (DevOps, finance, data, etc.) |
|
|
38
|
-
| `single` | One agent with a tool registry | Simple task automation |
|
|
39
|
-
| `coding` | 10 pre-built agents + all coding tools | Coding assistants, ready out of the box |
|
|
40
|
-
| `autonomous` | Trigger system (cron / webhook / event) | Scheduled or event-driven daemons |
|
|
41
|
-
| `minimal` | Bare engine, no entry point | Library embedding |
|
|
29
|
+
### `multi-agent` — Multi-agent orchestrator
|
|
42
30
|
|
|
43
|
-
|
|
31
|
+
A routing orchestrator that delegates tasks to specialized sub-agents. Best for complex domains with distinct request types.
|
|
44
32
|
|
|
45
|
-
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
├── agents/ ← agent profiles (JSON)
|
|
36
|
+
├── tools/ ← typed tool definitions
|
|
37
|
+
├── orchestrator.ts ← routes requests to sub-agents
|
|
38
|
+
└── index.ts
|
|
39
|
+
```
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|---|---|---|
|
|
49
|
-
| `repl` | `src/index.ts` — readline loop | Local terminal tool |
|
|
50
|
-
| `mcp-http` | `src/server.ts` — HTTP MCP server | Connect to Claude Desktop, Cursor, etc. |
|
|
51
|
-
| `mcp-stdio` | `src/server.ts` — stdio MCP server | Subprocess / pipe-based MCP |
|
|
52
|
-
| `hybrid` | Both `index.ts` + `server.ts` | REPL for dev, server for production |
|
|
53
|
-
| `library` | Only `src/engine.ts` exported | Import the engine in your own app |
|
|
41
|
+
**Use case:** A customer platform with separate agents for billing, support, and account management.
|
|
54
42
|
|
|
55
|
-
|
|
43
|
+
### `single` — Single-agent assistant
|
|
56
44
|
|
|
57
|
-
|
|
45
|
+
One agent with a custom system prompt and your tools.
|
|
58
46
|
|
|
59
|
-
|
|
47
|
+
```
|
|
48
|
+
src/
|
|
49
|
+
├── tools/
|
|
50
|
+
├── agent.ts
|
|
51
|
+
└── index.ts
|
|
52
|
+
```
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
### `coding` — Coding assistant
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
|---|---|---|
|
|
65
|
-
| `LLM_MODEL` | `gpt-4o` | Base model — used by all agents unless overridden |
|
|
66
|
-
| `LLM_MODEL_FAST` | `LLM_MODEL` | Execution agents (specialists, tool-calling loops) |
|
|
67
|
-
| `LLM_MODEL_SMART` | `LLM_MODEL` | Routing agents (orchestrator, reasoning-heavy tasks) |
|
|
56
|
+
Pre-configured with 10 coding agents, filesystem tools, persistent memory, and stack detection. Ready to use immediately.
|
|
68
57
|
|
|
69
|
-
|
|
58
|
+
```
|
|
59
|
+
src/
|
|
60
|
+
└── index.ts ← createCodingEngine() + readline REPL
|
|
61
|
+
AGENT.md ← project context injected into every LLM call
|
|
62
|
+
```
|
|
70
63
|
|
|
71
|
-
|
|
64
|
+
**Use case:** A project-specific coding assistant with your team's conventions in `AGENT.md`.
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
LLM_API_KEY=sk-...
|
|
75
|
-
LLM_BASE_URL=https://api.deepseek.com/v1
|
|
76
|
-
LLM_MODEL=deepseek-chat
|
|
77
|
-
LLM_MODEL_FAST=deepseek-chat
|
|
78
|
-
LLM_MODEL_SMART=deepseek-reasoner
|
|
79
|
-
```
|
|
66
|
+
### `autonomous` — Autonomous daemon
|
|
80
67
|
|
|
81
|
-
|
|
68
|
+
Runs on a schedule without user interaction. Pre-wired with `createAutonomousAgent` + cron trigger.
|
|
82
69
|
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
...
|
|
89
|
-
};
|
|
70
|
+
```
|
|
71
|
+
src/
|
|
72
|
+
├── triggers/
|
|
73
|
+
├── tools/
|
|
74
|
+
└── index.ts ← cron + event loop
|
|
90
75
|
```
|
|
91
76
|
|
|
92
|
-
|
|
77
|
+
**Use case:** Nightly reports, daily standups, automated monitoring.
|
|
93
78
|
|
|
94
|
-
|
|
79
|
+
### `minimal` — Minimal / embedded
|
|
95
80
|
|
|
96
|
-
|
|
81
|
+
Bare-bones template — just `AgentEngine`, one tool, one agent. Use when embedding an agent into an existing application or building a library.
|
|
97
82
|
|
|
98
|
-
```
|
|
99
|
-
|
|
83
|
+
```
|
|
84
|
+
src/
|
|
85
|
+
└── index.ts ← AgentEngine, bare minimum
|
|
100
86
|
```
|
|
101
87
|
|
|
102
|
-
### `
|
|
88
|
+
### `enterprise` — Enterprise (local LLM + RAG)
|
|
89
|
+
|
|
90
|
+
Full enterprise setup: Ollama LLM, Obsidian vault as knowledge base, six department agents (General, Support, HR, Sales, Finance, Ops), VaultWriter, and optionally an `AgentServer` web server.
|
|
103
91
|
|
|
104
|
-
```bash
|
|
105
|
-
npx create-bk-agent add server
|
|
106
|
-
npx create-bk-agent add server --port 4000 --name my-agent
|
|
107
92
|
```
|
|
93
|
+
src/
|
|
94
|
+
├── server.ts ← createEnterpriseSetup() + AgentServer
|
|
95
|
+
└── agents/ ← 6 department profiles
|
|
96
|
+
.env.example ← VAULT_PATH, JWT_SECRET, PORT, OLLAMA_HOST
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
108
100
|
|
|
109
|
-
|
|
110
|
-
- Adds `@backendkit-labs/mcp-server` to `dependencies`
|
|
111
|
-
- Adds `"server"` script to `package.json`
|
|
101
|
+
## Deploy modes
|
|
112
102
|
|
|
113
|
-
|
|
103
|
+
| Mode | Description |
|
|
104
|
+
|------|-------------|
|
|
105
|
+
| `repl` | Terminal REPL — stdin/stdout |
|
|
106
|
+
| `mcp-stdio` | MCP server over stdio (for Claude Desktop, agent-core) |
|
|
107
|
+
| `mcp-http` | MCP server over HTTP (`npm run server`) |
|
|
108
|
+
| `hybrid` | REPL + MCP server side-by-side |
|
|
109
|
+
| `library` | Exports an engine factory, no I/O |
|
|
110
|
+
| `web` | Fastify web server — chat + kanban (enterprise only) |
|
|
114
111
|
|
|
115
|
-
|
|
116
|
-
npx create-bk-agent add specialist data-analyst
|
|
117
|
-
npx create-bk-agent add specialist git-expert
|
|
118
|
-
```
|
|
112
|
+
---
|
|
119
113
|
|
|
120
|
-
|
|
121
|
-
- Patches `src/engine.ts`: adds the import and `agents.register()`
|
|
114
|
+
## Provider options
|
|
122
115
|
|
|
123
|
-
|
|
116
|
+
| Provider | Required env var |
|
|
117
|
+
|----------|-----------------|
|
|
118
|
+
| DeepSeek | `DEEPSEEK_API_KEY` |
|
|
119
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
120
|
+
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
121
|
+
| Ollama (local) | *(none — requires `ollama serve`)* |
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
npx create-bk-agent add tools github
|
|
127
|
-
npx create-bk-agent add tools my-database
|
|
128
|
-
```
|
|
123
|
+
The scaffolded `.env.example` lists all required variables.
|
|
129
124
|
|
|
130
|
-
|
|
131
|
-
- Patches `src/engine.ts`: adds the import and `tools.register()`
|
|
125
|
+
---
|
|
132
126
|
|
|
133
|
-
|
|
127
|
+
## Scaffolded project structure
|
|
134
128
|
|
|
135
|
-
|
|
136
|
-
npx create-bk-agent add mcp-client http://localhost:3001/mcp
|
|
137
|
-
npx create-bk-agent add mcp-client http://billing-agent/mcp --name billing
|
|
138
|
-
```
|
|
129
|
+
### Coding assistant (simplest)
|
|
139
130
|
|
|
140
|
-
|
|
141
|
-
-
|
|
131
|
+
```
|
|
132
|
+
my-agent/
|
|
133
|
+
├── src/
|
|
134
|
+
│ └── index.ts ← createCodingEngine() + readline REPL
|
|
135
|
+
├── AGENT.md ← project context (edit this!)
|
|
136
|
+
├── package.json
|
|
137
|
+
├── tsconfig.json
|
|
138
|
+
└── .env.example
|
|
139
|
+
```
|
|
142
140
|
|
|
143
|
-
|
|
141
|
+
**`AGENT.md`** is injected into every LLM call. Describe your project, stack, and conventions:
|
|
144
142
|
|
|
145
|
-
|
|
143
|
+
```markdown
|
|
144
|
+
# My Project
|
|
146
145
|
|
|
147
|
-
##
|
|
146
|
+
## Tech stack
|
|
147
|
+
Node.js 20, TypeScript 5, Express 4, PostgreSQL 15
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
## Conventions
|
|
150
|
+
- All functions must have JSDoc
|
|
151
|
+
- Tests use Jest + Supertest
|
|
152
|
+
- Never use `any` — use `unknown`
|
|
150
153
|
|
|
151
|
-
|
|
154
|
+
## Architecture
|
|
155
|
+
REST API with repository pattern. DB access only via src/repositories/.
|
|
156
|
+
```
|
|
152
157
|
|
|
153
|
-
|
|
158
|
+
### Enterprise web server (most complete)
|
|
154
159
|
|
|
155
160
|
```
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/
|
|
161
|
+
my-agent/
|
|
162
|
+
├── src/
|
|
163
|
+
│ ├── server.ts ← createEnterpriseSetup() + AgentServer
|
|
164
|
+
│ └── agents/ ← 6 department profiles
|
|
165
|
+
├── .env.example ← VAULT_PATH, OLLAMA_HOST, JWT_SECRET, PORT
|
|
166
|
+
├── package.json ← agent-enterprise + agent-web
|
|
167
|
+
└── tsconfig.json
|
|
160
168
|
```
|
|
161
169
|
|
|
162
|
-
|
|
170
|
+
---
|
|
163
171
|
|
|
164
|
-
|
|
172
|
+
## Examples
|
|
165
173
|
|
|
166
|
-
|
|
167
|
-
|---|---|
|
|
168
|
-
| `/workspace create <name>` | Create a workspace |
|
|
169
|
-
| `/workspace add <ws> <cwd> [name]` | Add a project |
|
|
170
|
-
| `/workspace import <cwd> [ws] [name]` | Add project (auto-creates workspace) |
|
|
171
|
-
| `/workspace switch <ws> [project]` | Switch to workspace (uses shared root if configured) |
|
|
172
|
-
| `/workspace set-root <ws> [path]` | Set shared root manually (auto-detected if no path) |
|
|
173
|
-
| `/workspace remove <ws> <project>` | Remove a project |
|
|
174
|
-
| `/workspace delete <name>` | Delete workspace |
|
|
175
|
-
| `/workspace list` | List all workspaces |
|
|
174
|
+
### Coding assistant
|
|
176
175
|
|
|
177
|
-
|
|
176
|
+
```bash
|
|
177
|
+
npx create-bk-agent my-dev-assistant
|
|
178
|
+
# → coding → repl → deepseek
|
|
178
179
|
|
|
179
|
-
|
|
180
|
+
cd my-dev-assistant
|
|
181
|
+
cp .env.example .env
|
|
182
|
+
# Edit .env: add DEEPSEEK_API_KEY
|
|
180
183
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
# Describe your project
|
|
185
|
+
nano AGENT.md
|
|
186
|
+
|
|
187
|
+
npm install && npm run dev
|
|
188
|
+
# > What can I help with?
|
|
186
189
|
```
|
|
187
190
|
|
|
188
|
-
|
|
191
|
+
### Enterprise on-premises assistant
|
|
189
192
|
|
|
193
|
+
```bash
|
|
194
|
+
npx create-bk-agent company-assistant
|
|
195
|
+
# → enterprise → web → ollama
|
|
196
|
+
|
|
197
|
+
cd company-assistant
|
|
198
|
+
cp .env.example .env
|
|
199
|
+
# Edit .env: VAULT_PATH=/path/to/obsidian-vault
|
|
200
|
+
|
|
201
|
+
ollama serve
|
|
202
|
+
ollama pull llama3.2
|
|
203
|
+
ollama pull nomic-embed-text
|
|
204
|
+
|
|
205
|
+
npm install && npm run dev
|
|
206
|
+
# → Indexing vault...
|
|
207
|
+
# → Server running on :4001
|
|
208
|
+
# Chat: http://localhost:4001/
|
|
209
|
+
# Kanban: http://localhost:4001/#kanban
|
|
190
210
|
```
|
|
191
|
-
|
|
192
|
-
|
|
211
|
+
|
|
212
|
+
### Autonomous cron agent
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
npx create-bk-agent standup-bot
|
|
216
|
+
# → autonomous → repl → deepseek
|
|
217
|
+
|
|
218
|
+
cd standup-bot
|
|
219
|
+
# Edit src/triggers/index.ts: schedule, prompt, output
|
|
220
|
+
npm install && npm run dev
|
|
193
221
|
```
|
|
194
222
|
|
|
195
|
-
|
|
223
|
+
### MCP server exposing your tools
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npx create-bk-agent my-tools-server
|
|
227
|
+
# → single → mcp-http → openai
|
|
196
228
|
|
|
229
|
+
cd my-tools-server
|
|
230
|
+
# Add tools to src/tools/
|
|
231
|
+
# Add agent to src/agents/
|
|
232
|
+
npm install && npm run server # MCP server on :3000
|
|
197
233
|
```
|
|
198
|
-
|
|
234
|
+
|
|
235
|
+
Claude Desktop config:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"mcpServers": {
|
|
240
|
+
"my-tools": {
|
|
241
|
+
"command": "npx",
|
|
242
|
+
"args": ["-y", "my-tools-server"]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
199
246
|
```
|
|
200
247
|
|
|
201
248
|
---
|
|
202
249
|
|
|
203
|
-
##
|
|
250
|
+
## `bk add` command
|
|
251
|
+
|
|
252
|
+
After scaffolding, add new components to your project:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
bk add tool lookup-order # creates src/tools/lookup-order.ts
|
|
256
|
+
bk add agent billing # creates src/agents/billing.json
|
|
257
|
+
bk add trigger daily-report # adds a cron trigger
|
|
258
|
+
```
|
|
204
259
|
|
|
205
|
-
|
|
206
|
-
- An API key for your chosen provider (Anthropic, OpenAI, DeepSeek, or Ollama)
|
|
260
|
+
---
|
|
207
261
|
|
|
208
|
-
##
|
|
262
|
+
## Scripts in scaffolded projects
|
|
209
263
|
|
|
210
|
-
|
|
264
|
+
| Script | Description |
|
|
265
|
+
|--------|-------------|
|
|
266
|
+
| `npm run dev` | Development with tsx / ts-node |
|
|
267
|
+
| `npm run build` | Compile TypeScript |
|
|
268
|
+
| `npm run start` | Run compiled output |
|
|
269
|
+
| `npm run server` | Start MCP or web server |
|
|
270
|
+
| `npm run typecheck` | TypeScript type-check only |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-bk-agent",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"description": "Create a new BackendKit agent project",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
"prepack": "node scripts/copy-templates.js && npm run build",
|
|
23
23
|
"typecheck": "tsc --noEmit"
|
|
24
24
|
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@backendkit-labs/agent-core": "^0.22.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependenciesMeta": {
|
|
29
|
+
"@backendkit-labs/agent-core": { "optional": true }
|
|
30
|
+
},
|
|
25
31
|
"dependencies": {
|
|
26
32
|
"prompts": "^2.4.2"
|
|
27
33
|
},
|