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.
Files changed (2) hide show
  1. package/README.md +194 -134
  2. package/package.json +7 -1
package/README.md CHANGED
@@ -1,210 +1,270 @@
1
1
  # create-bk-agent
2
2
 
3
- **Status: stable** — works and is maintained; will not be expanded during the pilot phase.
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
- Scaffold a new [BackendKit agent](https://github.com/BackendKit-labs/backendkit-agent-framework) project in seconds — or add capabilities to an existing one.
6
-
7
- ## Create a project
5
+ ## Usage
8
6
 
9
7
  ```bash
10
- npx create-bk-agent my-project
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
- ? Project name: my-project
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
- Creating Multi-agent — MCP Server (HTTP) agent in ./my-project...
24
- Installing dependencies...
17
+ ## Interactive setup
25
18
 
26
- ✅ Done! Your agent is ready.
19
+ The CLI asks three questions:
27
20
 
28
- cd my-project
29
- cp .env.example .env # add your API key
30
- npm run server # starts HTTP MCP on port 3001
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
- | Architecture | What it gives you | Best for |
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
- ## Deploy modes
31
+ A routing orchestrator that delegates tasks to specialized sub-agents. Best for complex domains with distinct request types.
44
32
 
45
- Available for `multi-agent` and `single` architectures:
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
- | Mode | Entry point | Use case |
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
- ## Providers
43
+ ### `single` — Single-agent assistant
56
44
 
57
- Anthropic (Claude), OpenAI, DeepSeek / any OpenAI-compatible endpoint, and Ollama (local).
45
+ One agent with a custom system prompt and your tools.
58
46
 
59
- ## Model configuration
47
+ ```
48
+ src/
49
+ ├── tools/
50
+ ├── agent.ts
51
+ └── index.ts
52
+ ```
60
53
 
61
- Generated projects read three env vars for model selection:
54
+ ### `coding` — Coding assistant
62
55
 
63
- | Variable | Default | Description |
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
- If `LLM_MODEL_FAST` and `LLM_MODEL_SMART` are not set, all agents use `LLM_MODEL` — fully backwards compatible.
58
+ ```
59
+ src/
60
+ └── index.ts ← createCodingEngine() + readline REPL
61
+ AGENT.md ← project context injected into every LLM call
62
+ ```
70
63
 
71
- Example `.env` for DeepSeek with smart/fast split:
64
+ **Use case:** A project-specific coding assistant with your team's conventions in `AGENT.md`.
72
65
 
73
- ```env
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
- The split is wired in `src/engine.ts` — specialists get `llmModelFast`, orchestrator gets `llmModelSmart`. To assign a model directly on a profile instead of via env vars, uncomment the `model:` field in the agent file:
68
+ Runs on a schedule without user interaction. Pre-wired with `createAutonomousAgent` + cron trigger.
82
69
 
83
- ```ts
84
- // src/agents/orchestrator.ts
85
- export const ORCHESTRATOR_PROFILE: AgentProfile = {
86
- id: 'orchestrator',
87
- model: 'deepseek-reasoner', // uncomment and set explicitly
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
- ## Add capabilities to an existing project
79
+ ### `minimal` — Minimal / embedded
95
80
 
96
- Once a project is created, use `add` to extend it without editing code manually:
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
- ```bash
99
- npx create-bk-agent add <module> [options]
83
+ ```
84
+ src/
85
+ └── index.ts ← AgentEngine, bare minimum
100
86
  ```
101
87
 
102
- ### `add server` — expose the agent as an HTTP MCP server
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
- - Generates `src/server.ts` wired to the existing engine
110
- - Adds `@backendkit-labs/mcp-server` to `dependencies`
111
- - Adds `"server"` script to `package.json`
101
+ ## Deploy modes
112
102
 
113
- ### `add specialist <name>` — add a specialist agent (multi-agent projects)
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
- ```bash
116
- npx create-bk-agent add specialist data-analyst
117
- npx create-bk-agent add specialist git-expert
118
- ```
112
+ ---
119
113
 
120
- - Creates `src/agents/<name>.ts` with an `AgentProfile` stub
121
- - Patches `src/engine.ts`: adds the import and `agents.register()`
114
+ ## Provider options
122
115
 
123
- ### `add tools <domain>` — add a tool file for a new domain
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
- ```bash
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
- - Creates `src/tools/<domain>-tools.ts` with two stub tools (action + query)
131
- - Patches `src/engine.ts`: adds the import and `tools.register()`
125
+ ---
132
126
 
133
- ### `add mcp-client <url>` — connect to a remote MCP server
127
+ ## Scaffolded project structure
134
128
 
135
- ```bash
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
- - Patches `src/engine.ts`: adds the entry to `mcpServers: [...]` inside `AgentEngine`
141
- - Creates the `mcpServers` array if it doesn't exist yet
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
- All `add` commands are **idempotent** — running the same command twice won't duplicate entries.
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
- ## Multi-project workspaces
146
+ ## Tech stack
147
+ Node.js 20, TypeScript 5, Express 4, PostgreSQL 15
148
148
 
149
- Group related projects (e.g. microservices) into a workspace so the agent can navigate all of them from a single shared root — no more switching context manually.
149
+ ## Conventions
150
+ - All functions must have JSDoc
151
+ - Tests use Jest + Supertest
152
+ - Never use `any` — use `unknown`
150
153
 
151
- ### Setup
154
+ ## Architecture
155
+ REST API with repository pattern. DB access only via src/repositories/.
156
+ ```
152
157
 
153
- Use the built-in `/workspace` slash commands from inside the running agent:
158
+ ### Enterprise web server (most complete)
154
159
 
155
160
  ```
156
- /workspace create my-system
157
- /workspace add my-system ~/dev/my-system/auth-service
158
- /workspace add my-system ~/dev/my-system/api-gateway
159
- /workspace add my-system ~/dev/my-system/user-service
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
- When a second project is added, a **common root** is auto-detected (`~/dev/my-system/`). The next `/workspace switch` sets that directory as the agent's working directory, giving it access to all services at once.
170
+ ---
163
171
 
164
- ### Commands
172
+ ## Examples
165
173
 
166
- | Command | Description |
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
- ### Shared root (microservices)
176
+ ```bash
177
+ npx create-bk-agent my-dev-assistant
178
+ # → coding → repl → deepseek
178
179
 
179
- For a system with multiple services under a common parent:
180
+ cd my-dev-assistant
181
+ cp .env.example .env
182
+ # Edit .env: add DEEPSEEK_API_KEY
180
183
 
181
- ```
182
- ~/dev/my-system/ ← shared root (agent workingDir)
183
- ├── auth-service/
184
- ├── api-gateway/
185
- └── user-service/
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
- The agent can read and edit files across all services using relative paths:
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
- auth-service/src/middleware.ts
192
- api-gateway/src/routes/auth.ts
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
- To override the auto-detected root:
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
- /workspace set-root my-system ~/dev/my-system
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
- ## Requirements
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
- - Node.js >= 20
206
- - An API key for your chosen provider (Anthropic, OpenAI, DeepSeek, or Ollama)
260
+ ---
207
261
 
208
- ## License
262
+ ## Scripts in scaffolded projects
209
263
 
210
- MIT © [BackendKit Labs](https://github.com/BackendKit-labs)
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.0",
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
  },