File size: 3,701 Bytes
4e909c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# `laddr`

**Usage**:

```console
$ laddr [OPTIONS] COMMAND [ARGS]...
```

**Options**:

* `--help`: Show this message and exit.

**Commands**:

* `init`: Initialize a new laddr project
* `add agent`: Add a new agent to your project
* `add tool`: Add a new tool to an existing agent
* `run`: Run an agent or coordinator locally
* `check`: Validate project structure and configuration
* `infra up`: Start infrastructure services
* `infra down`: Stop infrastructure services
* `worker`: Start a worker process for an agent
* `prompt view`: View an agent’s system prompt
* `prompt edit`: Edit an agent’s system prompt

---

## `laddr init`

Initialize a new laddr project.

**Usage**:
```console
$ laddr init my-project
$ cd my-project
```

**Creates:**
- `laddr.yml` – Main config  
- `.env` – Environment variables (Redis, Postgres, MinIO)  
- `agents/` – Agent folders  
- `workers/` – Worker modules  

**Options:**
- Project is created in a subdirectory with the given name.

---

## `laddr add agent`

Add a new agent to your project.

**Usage**:
```console
$ laddr add agent researcher
```

**Creates:**
- `agents/researcher/handler.py` – Agent handler with tools  
- `agents/researcher/prompt.md` – System prompt  

**Options:**
- Agent name must be lowercase, `snake_case`.

---

## `laddr add tool`

Add a new tool to an existing agent.

**Usage**:
```console
$ laddr add tool researcher
```

**Creates:**
Tool files inside the specified agent directory and updates `handler.py`.

**Options:**
- Tool name must be lowercase, `snake_case`.

---

## `laddr run`

Run an agent or coordinator locally (without Redis/Postgres).

**Usage**:
```console
$ laddr run researcher "Search for latest AI news"
```

**Options:**
- `--trace` – Enable tracing output  
- `--trace-mask <tool1,tool2>` – Mask specific tools from traces  

**Environment:**
- Uses in-memory implementations (no Redis/Postgres required)  
- Loads `.env` for LLM credentials.

---

## `laddr check`

Validate project structure and configuration.

**Usage**:
```console
$ laddr check
```

**Verifies:**
- All agents have `handler.py` and `prompt.md`  
- All tools are valid Python modules  
- Environment variables are set correctly  
- `laddr.yml` structure is valid.

---

## `laddr infra up`

Start infrastructure services (Redis, Postgres, MinIO) via Docker Compose.

**Usage**:
```console
$ laddr infra up
```

**Options:**
- `-d`, `--detach` – Run in background.

---

## `laddr infra down`

Stop infrastructure services.

**Usage**:
```console
$ laddr infra down
```

---

## `laddr worker`

Start a worker process for an agent.

**Usage**:
```console
$ laddr worker researcher
```

**Options:**
- Connects to Redis queue specified in `laddr.yml`  
- Loads agent from `agents/researcher/handler.py`  
- Processes tasks from the coordinator.

---

## `laddr prompt view`

View an agent’s system prompt.

**Usage**:
```console
$ laddr prompt view researcher
```

---

## `laddr prompt edit`

Edit an agent’s system prompt.

**Usage**:
```console
$ laddr prompt edit researcher
```

**Behavior:**
- Opens `prompt.md` in your default editor.

---

## Edge Cases

### Running without infrastructure
For local testing without Redis/Postgres:
```console
$ laddr run researcher "test query"
```
Uses in-memory implementations and does not require `laddr infra up`.

### Tracing specific agents
Enable tracing for debugging:
```console
$ laddr run researcher "query" --trace
```
Mask noisy tools:
```console
$ laddr run researcher "query" --trace --trace-mask web_search,file_read
```

### Custom environment file
Use a custom `.env` file:
```console
$ export LADDR_ENV_FILE=.env.production
$ laddr check
```