@standardagents/cli 0.8.1
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 +81 -0
- package/dist/index.js +1328 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @standardagents/cli
|
|
2
|
+
|
|
3
|
+
CLI tool for Standard Agents initialization.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add -D @standardagents/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Initialize AgentBuilder Configuration
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm exec agents init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This command will:
|
|
20
|
+
- Detect your `wrangler.jsonc` or `wrangler.json` file
|
|
21
|
+
- Add the required Durable Object bindings (`AGENT_BUILDER_THREAD`, `AGENT_BUILDER`)
|
|
22
|
+
- Configure Durable Object migrations
|
|
23
|
+
|
|
24
|
+
If no wrangler config is found, it will provide an example configuration.
|
|
25
|
+
|
|
26
|
+
#### Options
|
|
27
|
+
|
|
28
|
+
- `--force` - Overwrite existing Standard Agents configuration
|
|
29
|
+
|
|
30
|
+
### Scaffold Project Structure
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm exec agents scaffold
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Creates the `agents/` directory structure with documentation files.
|
|
37
|
+
|
|
38
|
+
## Manual Configuration
|
|
39
|
+
|
|
40
|
+
If you prefer to configure manually, add the following to your `wrangler.jsonc`:
|
|
41
|
+
|
|
42
|
+
```jsonc
|
|
43
|
+
{
|
|
44
|
+
"durable_objects": {
|
|
45
|
+
"bindings": [
|
|
46
|
+
{
|
|
47
|
+
"name": "AGENT_BUILDER_THREAD",
|
|
48
|
+
"class_name": "DurableThread"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "AGENT_BUILDER",
|
|
52
|
+
"class_name": "DurableAgentBuilder"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
"migrations": [
|
|
58
|
+
{
|
|
59
|
+
"tag": "v1",
|
|
60
|
+
"new_sqlite_classes": ["DurableThread", "DurableAgentBuilder"]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## TypeScript Types
|
|
67
|
+
|
|
68
|
+
To get proper TypeScript types for the bindings, regenerate your worker types:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm cf-typegen
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This will update your `worker-configuration.d.ts` file with:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
interface Env {
|
|
78
|
+
AGENT_BUILDER_THREAD: DurableObjectNamespace<DurableThread>;
|
|
79
|
+
AGENT_BUILDER: DurableObjectNamespace<DurableAgentBuilder>;
|
|
80
|
+
}
|
|
81
|
+
```
|