@action-llama/action-llama 0.13.5 → 0.13.7
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 +5 -27
- package/agent-docs/AGENTS.md +125 -664
- package/dist/build-info.json +1 -1
- package/dist/cli/commands/push.d.ts +1 -0
- package/dist/cli/commands/push.d.ts.map +1 -1
- package/dist/cli/commands/push.js +6 -1
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +7 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/main.js +1 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +6 -7
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/routes/dashboard.d.ts +1 -1
- package/dist/gateway/routes/dashboard.d.ts.map +1 -1
- package/dist/gateway/routes/dashboard.js +4 -2
- package/dist/gateway/routes/dashboard.js.map +1 -1
- package/dist/remote/push.d.ts.map +1 -1
- package/dist/remote/push.js +39 -4
- package/dist/remote/push.js.map +1 -1
- package/dist/scheduler/gateway-setup.d.ts.map +1 -1
- package/dist/scheduler/gateway-setup.js +3 -0
- package/dist/scheduler/gateway-setup.js.map +1 -1
- package/dist/shared/credential-refs.d.ts +7 -0
- package/dist/shared/credential-refs.d.ts.map +1 -1
- package/dist/shared/credential-refs.js +16 -0
- package/dist/shared/credential-refs.js.map +1 -1
- package/package.json +2 -1
package/agent-docs/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Action Llama Reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI for running LLM agents on cron/webhooks. Docker isolation, ACTIONS.md prompt, credentials. Gateway: webhooks, locking, agent calls, dashboard.
|
|
4
4
|
|
|
5
5
|
Package: `@action-llama/action-llama`. CLI binary: `al`.
|
|
6
6
|
|
|
@@ -19,38 +19,23 @@ my-project/
|
|
|
19
19
|
Dockerfile # Custom Docker image for this agent (optional)
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Agent names
|
|
23
|
-
|
|
24
|
-
## Agent Docs
|
|
25
|
-
|
|
26
|
-
| File | Scope | Purpose |
|
|
27
|
-
|------|-------|---------|
|
|
28
|
-
| `ACTIONS.md` | Per-agent (required) | System prompt injected as the LLM's system message at runtime |
|
|
29
|
-
| `AGENTS.md` | Project root | Shared instructions loaded by `al chat` (interactive console only — not injected into automated runs) |
|
|
30
|
-
| `CLAUDE.md` | Project root | Instructions for AI development tools (Claude Code, etc.). Not read by Action Llama at runtime. |
|
|
22
|
+
Agent names derive from directory name. `"default"` is reserved.
|
|
31
23
|
|
|
32
24
|
### ACTIONS.md — Writing Tips
|
|
33
25
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
- Reference `<agent-config>` for parameter values instead of hardcoding repo names, labels, etc.
|
|
37
|
-
- Handle both trigger types if the agent uses both schedule and webhooks
|
|
38
|
-
- Use `al-status` at natural milestones so operators can see progress in the TUI/dashboard
|
|
39
|
-
- Use `al-rerun` when the agent completed work and there may be more items in the backlog
|
|
40
|
-
- Keep it concise — the system prompt consumes tokens every run
|
|
26
|
+
- Direct LLM instructions; numbered steps; reference `<agent-config>` for params
|
|
27
|
+
- `al-status` at milestones, `al-rerun` when backlog remains; keep concise
|
|
41
28
|
|
|
42
29
|
## Prompt Assembly
|
|
43
30
|
|
|
44
|
-
|
|
31
|
+
The LLM receives two messages:
|
|
45
32
|
|
|
46
33
|
### System message
|
|
47
34
|
|
|
48
|
-
|
|
35
|
+
`ACTIONS.md` is the system prompt. With gateway, **skill blocks** appended:
|
|
49
36
|
|
|
50
37
|
#### Locking skill block (injected when gateway is available)
|
|
51
38
|
|
|
52
|
-
The following is prepended when the agent may need resource locking:
|
|
53
|
-
|
|
54
39
|
```xml
|
|
55
40
|
<skill-lock>
|
|
56
41
|
## Skill: Resource Locking
|
|
@@ -99,8 +84,6 @@ rlock-heartbeat "github issue acme/app#42"
|
|
|
99
84
|
|
|
100
85
|
#### Calling skill block (injected when gateway is available)
|
|
101
86
|
|
|
102
|
-
The following is prepended when agent-to-agent calling is available:
|
|
103
|
-
|
|
104
87
|
```xml
|
|
105
88
|
<skill-call>
|
|
106
89
|
## Skill: Agent-to-Agent Calls
|
|
@@ -150,11 +133,9 @@ echo "Line 1\nLine 2" | al-return
|
|
|
150
133
|
|
|
151
134
|
### User message
|
|
152
135
|
|
|
153
|
-
|
|
136
|
+
Static skeleton + dynamic suffix. Static blocks:
|
|
154
137
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
**`<agent-config>`** — JSON of the `[params]` table from `agent-config.toml`:
|
|
138
|
+
**`<agent-config>`** — `[params]` as JSON:
|
|
158
139
|
|
|
159
140
|
```xml
|
|
160
141
|
<agent-config>
|
|
@@ -162,7 +143,7 @@ The static skeleton contains these XML blocks in order:
|
|
|
162
143
|
</agent-config>
|
|
163
144
|
```
|
|
164
145
|
|
|
165
|
-
**`<credential-context>`** —
|
|
146
|
+
**`<credential-context>`** — env vars, tools, anti-exfiltration:
|
|
166
147
|
|
|
167
148
|
```xml
|
|
168
149
|
<credential-context>
|
|
@@ -183,7 +164,7 @@ Use standard tools directly: `gh` CLI, `git`, `curl`.
|
|
|
183
164
|
</credential-context>
|
|
184
165
|
```
|
|
185
166
|
|
|
186
|
-
**`<environment>`** — Filesystem
|
|
167
|
+
**`<environment>`** — Filesystem:
|
|
187
168
|
|
|
188
169
|
```xml
|
|
189
170
|
<environment>
|
|
@@ -194,7 +175,7 @@ All write operations (git clone, file creation, etc.) must target `/tmp`.
|
|
|
194
175
|
</environment>
|
|
195
176
|
```
|
|
196
177
|
|
|
197
|
-
**Dynamic suffix** —
|
|
178
|
+
**Dynamic suffix** — by trigger type:
|
|
198
179
|
|
|
199
180
|
| Trigger | Suffix |
|
|
200
181
|
|---------|--------|
|
|
@@ -203,7 +184,7 @@ All write operations (git clone, file creation, etc.) must target `/tmp`.
|
|
|
203
184
|
| Webhook | `<webhook-trigger>` block with event JSON, then `"A webhook event just fired. Review the trigger context above and take appropriate action."` |
|
|
204
185
|
| Agent call | `<agent-call>` block with caller/context JSON, then `"You were called by the "<name>" agent. Review the call context above, do the requested work, and use al-return to send back your result."` |
|
|
205
186
|
|
|
206
|
-
**`<webhook-trigger>`** example
|
|
187
|
+
**`<webhook-trigger>`** example:
|
|
207
188
|
|
|
208
189
|
```json
|
|
209
190
|
{
|
|
@@ -225,7 +206,7 @@ All write operations (git clone, file creation, etc.) must target `/tmp`.
|
|
|
225
206
|
}
|
|
226
207
|
```
|
|
227
208
|
|
|
228
|
-
**`<agent-call>`** example
|
|
209
|
+
**`<agent-call>`** example:
|
|
229
210
|
|
|
230
211
|
```json
|
|
231
212
|
{
|
|
@@ -236,7 +217,7 @@ All write operations (git clone, file creation, etc.) must target `/tmp`.
|
|
|
236
217
|
|
|
237
218
|
## config.toml
|
|
238
219
|
|
|
239
|
-
|
|
220
|
+
Project root. All sections optional — sensible defaults apply.
|
|
240
221
|
|
|
241
222
|
### Full Annotated Example
|
|
242
223
|
|
|
@@ -302,7 +283,7 @@ endpoint = "https://telemetry.example.com/v1" # OpenTelemetry endpoint
|
|
|
302
283
|
|
|
303
284
|
### `[model]` — Default LLM
|
|
304
285
|
|
|
305
|
-
Default
|
|
286
|
+
Default for agents without `[model]` in agent-config.
|
|
306
287
|
|
|
307
288
|
| Field | Type | Required | Description |
|
|
308
289
|
|-------|------|----------|-------------|
|
|
@@ -313,7 +294,7 @@ Default model configuration inherited by all agents that don't define their own
|
|
|
313
294
|
|
|
314
295
|
### `[local]` — Docker Container Settings
|
|
315
296
|
|
|
316
|
-
|
|
297
|
+
Local Docker container settings.
|
|
317
298
|
|
|
318
299
|
| Field | Type | Default | Description |
|
|
319
300
|
|-------|------|---------|-------------|
|
|
@@ -324,7 +305,7 @@ Controls local Docker container isolation.
|
|
|
324
305
|
|
|
325
306
|
### `[gateway]` — HTTP Server
|
|
326
307
|
|
|
327
|
-
|
|
308
|
+
Starts automatically when Docker mode or webhooks enabled.
|
|
328
309
|
|
|
329
310
|
| Field | Type | Default | Description |
|
|
330
311
|
|-------|------|---------|-------------|
|
|
@@ -333,14 +314,14 @@ The gateway starts automatically when Docker mode or webhooks are enabled. It ha
|
|
|
333
314
|
|
|
334
315
|
### `[webhooks.<name>]` — Webhook Sources
|
|
335
316
|
|
|
336
|
-
Named
|
|
317
|
+
Named sources agents reference in `[[webhooks]]` triggers.
|
|
337
318
|
|
|
338
319
|
| Field | Type | Required | Description |
|
|
339
320
|
|-------|------|----------|-------------|
|
|
340
321
|
| `type` | string | Yes | Provider type: `"github"`, `"sentry"`, `"linear"`, or `"mintlify"` |
|
|
341
|
-
| `credential` | string | No |
|
|
322
|
+
| `credential` | string | No | Instance name for HMAC validation (e.g. `"MyOrg"` -> `github_webhook_secret:MyOrg`). Omit for unsigned. |
|
|
342
323
|
|
|
343
|
-
Agents reference
|
|
324
|
+
Agents reference by name:
|
|
344
325
|
|
|
345
326
|
```toml
|
|
346
327
|
[[webhooks]]
|
|
@@ -356,7 +337,7 @@ events = ["issues"]
|
|
|
356
337
|
|
|
357
338
|
## agent-config.toml
|
|
358
339
|
|
|
359
|
-
|
|
340
|
+
Per-agent config. Name derives from directory.
|
|
360
341
|
|
|
361
342
|
### Full Annotated Example
|
|
362
343
|
|
|
@@ -458,41 +439,25 @@ sentryProjects = ["web-app", "api"]
|
|
|
458
439
|
| `preflight` | array | No | Array of preflight steps that run before the LLM session. |
|
|
459
440
|
| `params` | table | No | Custom key-value params injected into the prompt as `<agent-config>` |
|
|
460
441
|
|
|
461
|
-
*
|
|
442
|
+
*Need `schedule` or `webhooks` (unless `scale=0`). *Required in `[model]` if defined.
|
|
462
443
|
|
|
463
444
|
### Scale
|
|
464
445
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
- **Default**: 1 (only one instance can run at a time)
|
|
468
|
-
- **Minimum**: 0 (disables the agent — no runners, cron jobs, or webhook bindings are created)
|
|
469
|
-
- **Maximum**: No hard limit, but consider system resources and model API rate limits
|
|
470
|
-
|
|
471
|
-
How it works:
|
|
472
|
-
|
|
473
|
-
1. **Scheduled runs**: If a cron trigger fires but all agent instances are busy, the scheduled run is skipped with a warning
|
|
474
|
-
2. **Webhook events**: If a webhook arrives but all instances are busy, the event is queued (up to `workQueueSize` limit in global config, default: 100)
|
|
475
|
-
3. **Agent calls**: If one agent calls another but all target instances are busy, the call is queued in the same work queue
|
|
476
|
-
|
|
477
|
-
Each parallel instance uses a separate Docker container, has independent logging, and may consume LLM API quota concurrently.
|
|
446
|
+
Default: 1. Set 0 to disable. Busy: scheduled skipped, webhooks/calls queued.
|
|
478
447
|
|
|
479
448
|
### Timeout
|
|
480
449
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
**Resolution order:** `agent-config.toml timeout` → `config.toml [local].timeout` → `900` (default)
|
|
450
|
+
Max runtime per invocation. Container terminated with exit 124 on expiry.
|
|
484
451
|
|
|
485
|
-
|
|
452
|
+
Resolves: agent -> project `[local].timeout` -> `900`.
|
|
486
453
|
|
|
487
454
|
### Preflight
|
|
488
455
|
|
|
489
|
-
|
|
456
|
+
Stage data after credentials load, before LLM session.
|
|
490
457
|
|
|
491
|
-
|
|
458
|
+
Sequential, inside container. `${VAR_NAME}` interpolation in params.
|
|
492
459
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
Each `[[preflight]]` entry has these fields:
|
|
460
|
+
Fields:
|
|
496
461
|
|
|
497
462
|
| Field | Type | Required | Description |
|
|
498
463
|
|-------|------|----------|-------------|
|
|
@@ -502,7 +467,7 @@ Each `[[preflight]]` entry has these fields:
|
|
|
502
467
|
|
|
503
468
|
#### `shell` provider
|
|
504
469
|
|
|
505
|
-
Runs a command via `/bin/sh`.
|
|
470
|
+
Runs a command via `/bin/sh`.
|
|
506
471
|
|
|
507
472
|
| Param | Type | Required | Description |
|
|
508
473
|
|-------|------|----------|-------------|
|
|
@@ -519,7 +484,7 @@ output = "/tmp/context/issues.json"
|
|
|
519
484
|
|
|
520
485
|
#### `http` provider
|
|
521
486
|
|
|
522
|
-
Fetches a URL
|
|
487
|
+
Fetches a URL, writes response to file.
|
|
523
488
|
|
|
524
489
|
| Param | Type | Required | Description |
|
|
525
490
|
|-------|------|----------|-------------|
|
|
@@ -541,7 +506,7 @@ headers = { Authorization = "Bearer ${INTERNAL_TOKEN}" }
|
|
|
541
506
|
|
|
542
507
|
#### `git-clone` provider
|
|
543
508
|
|
|
544
|
-
|
|
509
|
+
`"owner/repo"` expands to `git@github.com:owner/repo.git`.
|
|
545
510
|
|
|
546
511
|
| Param | Type | Required | Description |
|
|
547
512
|
|-------|------|----------|-------------|
|
|
@@ -560,14 +525,11 @@ branch = "main"
|
|
|
560
525
|
depth = 1
|
|
561
526
|
```
|
|
562
527
|
|
|
563
|
-
|
|
564
|
-
- The `shell` provider is the escape hatch — anything a built-in provider doesn't cover can be expressed as a shell command
|
|
565
|
-
- There is no per-step timeout — steps are bounded by the container-level timeout
|
|
566
|
-
- Environment variables set inside `shell` child processes do not propagate back to the agent's `process.env`
|
|
528
|
+
`shell` is the escape hatch. No per-step timeout. Shell env vars don't propagate back (see [Environment variable persistence](#environment-variable-persistence) for a workaround).
|
|
567
529
|
|
|
568
530
|
### Webhook Trigger Fields
|
|
569
531
|
|
|
570
|
-
|
|
532
|
+
Required `source` from `config.toml`. Filters optional (AND logic).
|
|
571
533
|
|
|
572
534
|
| Field | Type | Required | Description |
|
|
573
535
|
|-------|------|----------|-------------|
|
|
@@ -614,68 +576,19 @@ Each `[[webhooks]]` entry has a required `source` field referencing a named webh
|
|
|
614
576
|
| `actions` | string[] | Event actions: failed, succeeded, etc. |
|
|
615
577
|
| `branches` | string[] | Only for these branches |
|
|
616
578
|
|
|
617
|
-
### TOML Syntax Reminders
|
|
618
|
-
|
|
619
|
-
- Strings: `key = "value"`
|
|
620
|
-
- Arrays: `key = ["a", "b"]`
|
|
621
|
-
- Tables (objects): `[tableName]` on its own line, followed by key-value pairs
|
|
622
|
-
- Array of tables: `[[arrayName]]` on its own line — each block is one entry in the array
|
|
623
|
-
- Inline tables: `headers = { Authorization = "Bearer ${TOKEN}" }`
|
|
624
|
-
- Comments: `# comment`
|
|
625
|
-
|
|
626
|
-
Example with multiple webhooks (each `[[webhooks]]` is a separate trigger):
|
|
627
|
-
|
|
628
|
-
```toml
|
|
629
|
-
[[webhooks]]
|
|
630
|
-
source = "my-github"
|
|
631
|
-
events = ["issues"]
|
|
632
|
-
actions = ["labeled"]
|
|
633
|
-
labels = ["agent"]
|
|
634
|
-
|
|
635
|
-
[[webhooks]]
|
|
636
|
-
source = "my-github"
|
|
637
|
-
events = ["pull_request"]
|
|
638
|
-
|
|
639
|
-
[[webhooks]]
|
|
640
|
-
source = "my-sentry"
|
|
641
|
-
resources = ["error", "event_alert"]
|
|
642
|
-
```
|
|
643
|
-
|
|
644
579
|
### Model Configuration
|
|
645
580
|
|
|
646
|
-
|
|
581
|
+
Optional. If defined, fully overrides project default (no merging).
|
|
647
582
|
|
|
648
583
|
## Credentials
|
|
649
584
|
|
|
650
|
-
|
|
585
|
+
Path: `~/.action-llama/credentials/<type>/<instance>/<field>`.
|
|
651
586
|
|
|
652
|
-
**
|
|
587
|
+
**Agents MUST NEVER ask for credentials or run `al doctor`. Missing = report and stop.**
|
|
653
588
|
|
|
654
589
|
### How credentials work
|
|
655
590
|
|
|
656
|
-
|
|
657
|
-
```toml
|
|
658
|
-
credentials = ["github_token", "git_ssh"]
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
2. **Storage**: Credential values live in `~/.action-llama/credentials/<type>/<instance>/<field>`. Each field is a plain text file.
|
|
662
|
-
|
|
663
|
-
3. **Injection**: When an agent runs, the credentials it requires are mounted into the container at `/credentials/<type>/<instance>/<field>` and key values are injected as environment variables.
|
|
664
|
-
|
|
665
|
-
4. **Git identity**: The `git_ssh` credential includes `username` and `email` fields. These are injected as `GIT_AUTHOR_NAME`/`GIT_AUTHOR_EMAIL` and `GIT_COMMITTER_NAME`/`GIT_COMMITTER_EMAIL` env vars at runtime, so `git commit` works without requiring `git config`.
|
|
666
|
-
|
|
667
|
-
5. **LLM credentials**: The LLM credential (e.g. `anthropic_key`) does not need to be listed in the agent's `credentials` array — it is loaded automatically based on the `[model]` config.
|
|
668
|
-
|
|
669
|
-
### Named instances
|
|
670
|
-
|
|
671
|
-
Each credential type supports named instances. Reference `"git_ssh"` for the default instance, or `"git_ssh:botty"` for a named instance:
|
|
672
|
-
|
|
673
|
-
```
|
|
674
|
-
~/.action-llama/credentials/git_ssh/default/id_rsa
|
|
675
|
-
~/.action-llama/credentials/git_ssh/default/username
|
|
676
|
-
~/.action-llama/credentials/git_ssh/botty/id_rsa
|
|
677
|
-
~/.action-llama/credentials/git_ssh/botty/username
|
|
678
|
-
```
|
|
591
|
+
List in `agent-config.toml`. Mounted at `/credentials/...`, key values as env vars. `git_ssh` sets `GIT_AUTHOR_*`/`GIT_COMMITTER_*`. LLM creds auto-loaded from `[model]`.
|
|
679
592
|
|
|
680
593
|
### Agent runtime credentials
|
|
681
594
|
|
|
@@ -710,11 +623,11 @@ Each credential type supports named instances. Reference `"git_ssh"` for the def
|
|
|
710
623
|
| `linear_webhook_secret` | `secret` | Shared secret for Linear webhook verification |
|
|
711
624
|
| `mintlify_webhook_secret` | `secret` | Shared secret for Mintlify webhook verification |
|
|
712
625
|
|
|
713
|
-
|
|
626
|
+
Gateway only — not in agent containers.
|
|
714
627
|
|
|
715
628
|
### Infrastructure credentials
|
|
716
629
|
|
|
717
|
-
|
|
630
|
+
CLI only (provisioning, deployment).
|
|
718
631
|
|
|
719
632
|
| Type | Fields | Description |
|
|
720
633
|
|------|--------|-------------|
|
|
@@ -734,7 +647,7 @@ These are used by CLI commands (provisioning, deployment) and are not injected i
|
|
|
734
647
|
|
|
735
648
|
## Models
|
|
736
649
|
|
|
737
|
-
|
|
650
|
+
8 providers. Default in `config.toml [model]`, override per agent.
|
|
738
651
|
|
|
739
652
|
| Provider | Credential | Example Models | Auth Types |
|
|
740
653
|
|----------|-----------|---------------|------------|
|
|
@@ -758,94 +671,37 @@ Action Llama supports 8 LLM providers. Each agent can use a different provider a
|
|
|
758
671
|
| `high` | Deep reasoning |
|
|
759
672
|
| `xhigh` | Maximum reasoning budget |
|
|
760
673
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
### Model inheritance
|
|
764
|
-
|
|
765
|
-
Agents without a `[model]` section inherit from the project `config.toml`. If an agent defines its own `[model]`, it fully overrides the project default — there is no field-level merging between the two.
|
|
766
|
-
|
|
767
|
-
```
|
|
768
|
-
config.toml → [model] provider = "anthropic", model = "claude-sonnet-4-20250514"
|
|
769
|
-
dev/agent-config.toml → (no [model] section — inherits Claude Sonnet)
|
|
770
|
-
reviewer/agent-config.toml → [model] provider = "openai", model = "gpt-4o"
|
|
771
|
-
devops/agent-config.toml → [model] provider = "groq", model = "llama-3.3-70b-versatile"
|
|
772
|
-
```
|
|
773
|
-
|
|
774
|
-
The LLM credential does not need to be listed in the agent's `credentials` array — it is loaded automatically based on the `[model]` config.
|
|
674
|
+
Non-Anthropic providers ignore `thinkingLevel`.
|
|
775
675
|
|
|
776
676
|
## Webhooks
|
|
777
677
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
### Defining webhook sources
|
|
781
|
-
|
|
782
|
-
Webhook sources are defined once in the project's `config.toml`. Each source has a name, a provider type, and an optional credential for signature validation:
|
|
783
|
-
|
|
784
|
-
```toml
|
|
785
|
-
[webhooks.my-github]
|
|
786
|
-
type = "github"
|
|
787
|
-
credential = "MyOrg" # credential instance name (github_webhook_secret:MyOrg)
|
|
788
|
-
|
|
789
|
-
[webhooks.my-sentry]
|
|
790
|
-
type = "sentry"
|
|
791
|
-
credential = "SentryProd" # credential instance name (sentry_client_secret:SentryProd)
|
|
792
|
-
|
|
793
|
-
[webhooks.my-linear]
|
|
794
|
-
type = "linear"
|
|
795
|
-
credential = "LinearMain" # credential instance name (linear_webhook_secret:LinearMain)
|
|
796
|
-
|
|
797
|
-
[webhooks.my-mintlify]
|
|
798
|
-
type = "mintlify"
|
|
799
|
-
credential = "MintlifyMain" # credential instance name (mintlify_webhook_secret:MintlifyMain)
|
|
800
|
-
```
|
|
678
|
+
Webhook triggers for agents.
|
|
801
679
|
|
|
802
680
|
### Runtime flow
|
|
803
681
|
|
|
804
|
-
|
|
805
|
-
2. It verifies the payload signature using secrets loaded from the credential instances defined in `config.toml` webhook sources
|
|
806
|
-
3. It parses the event into a `WebhookContext` (source, event, action, repo, etc.)
|
|
807
|
-
4. It matches the context against each agent's webhook triggers (AND logic — all specified filter fields must match; omitted fields are not checked)
|
|
808
|
-
5. Matching agents are triggered with the webhook context injected into their prompt as a `<webhook-trigger>` block
|
|
809
|
-
|
|
810
|
-
### Webhook endpoints
|
|
811
|
-
|
|
812
|
-
| Provider | Endpoint |
|
|
813
|
-
|----------|----------|
|
|
814
|
-
| GitHub | `/webhooks/github` |
|
|
815
|
-
| Sentry | `/webhooks/sentry` |
|
|
816
|
-
| Linear | `/webhooks/linear` |
|
|
817
|
-
| Mintlify | `/webhooks/mintlify` |
|
|
818
|
-
|
|
819
|
-
### Queue behavior
|
|
820
|
-
|
|
821
|
-
If all runners for a matching agent are busy, webhook events are queued (up to `workQueueSize`, default: 100). Scheduled runs are skipped if all busy.
|
|
822
|
-
|
|
823
|
-
### Hybrid agents
|
|
824
|
-
|
|
825
|
-
Agents can have both `schedule` and `webhooks`. Scheduled runs poll for work proactively; webhook runs respond to events immediately.
|
|
682
|
+
POST `/webhooks/<type>` -> verify -> match triggers (AND) -> trigger agent. Busy: queued.
|
|
826
683
|
|
|
827
684
|
## Agent Commands
|
|
828
685
|
|
|
829
|
-
|
|
686
|
+
At `/app/bin/` (in `PATH`). Skill blocks teach usage.
|
|
830
687
|
|
|
831
688
|
### Signal commands
|
|
832
689
|
|
|
833
|
-
|
|
690
|
+
Write signal files for scheduler.
|
|
834
691
|
|
|
835
692
|
#### `al-rerun`
|
|
836
693
|
|
|
837
|
-
Request
|
|
694
|
+
Request immediate rerun to drain backlog.
|
|
838
695
|
|
|
839
696
|
```bash
|
|
840
697
|
al-rerun
|
|
841
698
|
```
|
|
842
699
|
|
|
843
|
-
|
|
844
|
-
- Reruns continue until the agent completes without calling `al-rerun`, hits an error, or reaches the `maxReruns` limit (default: 10).
|
|
700
|
+
Scheduled only. Until no `al-rerun`, error, or `maxReruns` (10).
|
|
845
701
|
|
|
846
702
|
#### `al-status "<text>"`
|
|
847
703
|
|
|
848
|
-
Update
|
|
704
|
+
Update status text in TUI/dashboard.
|
|
849
705
|
|
|
850
706
|
```bash
|
|
851
707
|
al-status "reviewing PR #42"
|
|
@@ -854,85 +710,71 @@ al-status "found 3 issues to work on"
|
|
|
854
710
|
|
|
855
711
|
#### `al-return "<value>"`
|
|
856
712
|
|
|
857
|
-
Return a value to the calling agent
|
|
713
|
+
Return a value to the calling agent (when invoked via `al-call`).
|
|
858
714
|
|
|
859
715
|
```bash
|
|
860
716
|
al-return "PR looks good. Approved with minor suggestions."
|
|
861
717
|
al-return '{"approved": true, "comments": 2}'
|
|
862
718
|
```
|
|
863
719
|
|
|
864
|
-
For multiline
|
|
720
|
+
For multiline, pipe via stdin:
|
|
865
721
|
|
|
866
722
|
```bash
|
|
867
723
|
echo "Line 1\nLine 2" | al-return
|
|
868
724
|
```
|
|
869
725
|
|
|
870
|
-
The calling agent receives this value when it calls `al-wait`.
|
|
871
|
-
|
|
872
726
|
#### `al-exit [code]`
|
|
873
727
|
|
|
874
|
-
Terminate
|
|
728
|
+
Terminate with exit code (default: 15).
|
|
875
729
|
|
|
876
730
|
```bash
|
|
877
731
|
al-exit # exit code 15
|
|
878
732
|
al-exit 1 # exit code 1
|
|
879
733
|
```
|
|
880
734
|
|
|
881
|
-
|
|
735
|
+
Codes: 10=auth, 11=perm, 12=rate, 13=config, 14=dep, 15=unrecoverable, 16=abort.
|
|
882
736
|
|
|
883
737
|
### Call commands
|
|
884
738
|
|
|
885
|
-
|
|
739
|
+
Require gateway.
|
|
886
740
|
|
|
887
741
|
#### `al-call <agent>`
|
|
888
742
|
|
|
889
|
-
Call another agent. Pass context via stdin.
|
|
743
|
+
Call another agent. Pass context via stdin.
|
|
890
744
|
|
|
891
745
|
```bash
|
|
892
746
|
echo "Review PR #42 on acme/app" | al-call reviewer
|
|
893
747
|
```
|
|
894
748
|
|
|
895
|
-
**Response:**
|
|
896
|
-
|
|
897
749
|
```json
|
|
898
750
|
{"ok": true, "callId": "abc123"}
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
**Errors:**
|
|
902
|
-
|
|
903
|
-
```json
|
|
904
751
|
{"ok": false, "error": "self-call not allowed"}
|
|
905
752
|
{"ok": false, "error": "queue full"}
|
|
906
753
|
```
|
|
907
754
|
|
|
908
755
|
#### `al-check <callId>`
|
|
909
756
|
|
|
910
|
-
Non-blocking status check
|
|
757
|
+
Non-blocking status check.
|
|
911
758
|
|
|
912
759
|
```bash
|
|
913
760
|
al-check abc123
|
|
914
761
|
```
|
|
915
762
|
|
|
916
|
-
**Response:**
|
|
917
|
-
|
|
918
763
|
```json
|
|
919
764
|
{"status": "pending"}
|
|
920
|
-
{"status": "running"}
|
|
921
765
|
{"status": "completed", "returnValue": "PR approved."}
|
|
922
766
|
{"status": "error", "error": "timeout"}
|
|
923
767
|
```
|
|
924
768
|
|
|
925
769
|
#### `al-wait <callId> [...] [--timeout N]`
|
|
926
770
|
|
|
927
|
-
Wait for
|
|
771
|
+
Wait for calls. Polls every 5s. Default timeout: 900s.
|
|
928
772
|
|
|
929
773
|
```bash
|
|
930
774
|
al-wait abc123 --timeout 600
|
|
931
775
|
al-wait abc123 def456 --timeout 300
|
|
932
776
|
```
|
|
933
777
|
|
|
934
|
-
**Response:**
|
|
935
|
-
|
|
936
778
|
```json
|
|
937
779
|
{
|
|
938
780
|
"abc123": {"status": "completed", "returnValue": "PR approved."},
|
|
@@ -957,436 +799,123 @@ echo "$RESULTS" | jq ".\"$TEST_ID\".returnValue"
|
|
|
957
799
|
|
|
958
800
|
#### Call rules
|
|
959
801
|
|
|
960
|
-
-
|
|
961
|
-
- If all runners for the target agent are busy, the call is queued (up to `workQueueSize`, default: 100)
|
|
962
|
-
- Call chains are allowed (A calls B, B calls C) up to `maxCallDepth` (default: 3)
|
|
963
|
-
- Called runs do not re-run — they respond to the single call
|
|
964
|
-
- The called agent receives an `<agent-call>` block with the caller name and context
|
|
965
|
-
- To return a value, the called agent uses `al-return`
|
|
802
|
+
No self-calls. Chains up to `maxCallDepth` (3). Use `al-return` to respond.
|
|
966
803
|
|
|
967
804
|
### Lock commands
|
|
968
805
|
|
|
969
|
-
|
|
806
|
+
Prevent duplicate work across instances.
|
|
970
807
|
|
|
971
808
|
#### `rlock`
|
|
972
809
|
|
|
973
|
-
Acquire
|
|
810
|
+
Acquire exclusive lock.
|
|
974
811
|
|
|
975
812
|
```bash
|
|
976
813
|
rlock "github issue acme/app#42"
|
|
977
814
|
```
|
|
978
815
|
|
|
979
|
-
|
|
816
|
+
Responses:
|
|
980
817
|
|
|
981
818
|
```json
|
|
982
819
|
{"ok": true}
|
|
983
|
-
```
|
|
984
|
-
|
|
985
|
-
**Already held:**
|
|
986
|
-
|
|
987
|
-
```json
|
|
988
820
|
{"ok": false, "holder": "dev-abc123", "heldSince": "2025-01-15T10:30:00Z"}
|
|
989
|
-
```
|
|
990
|
-
|
|
991
|
-
**Already holding another lock:**
|
|
992
|
-
|
|
993
|
-
```json
|
|
994
821
|
{"ok": false, "reason": "already holding lock on ..."}
|
|
995
|
-
```
|
|
996
|
-
|
|
997
|
-
**Deadlock detected:**
|
|
998
|
-
|
|
999
|
-
```json
|
|
1000
822
|
{"ok": false, "reason": "possible deadlock detected", "cycle": ["dev-abc", "github pr acme/app#10", "dev-def", "deploy api-prod"]}
|
|
1001
823
|
```
|
|
1002
824
|
|
|
1003
825
|
#### `runlock`
|
|
1004
826
|
|
|
1005
|
-
Release a lock
|
|
827
|
+
Release a lock (holder only).
|
|
1006
828
|
|
|
1007
829
|
```bash
|
|
1008
830
|
runlock "github issue acme/app#42"
|
|
1009
831
|
```
|
|
1010
832
|
|
|
1011
|
-
**Success:**
|
|
1012
|
-
|
|
1013
833
|
```json
|
|
1014
834
|
{"ok": true}
|
|
1015
|
-
```
|
|
1016
|
-
|
|
1017
|
-
**Not holder:**
|
|
1018
|
-
|
|
1019
|
-
```json
|
|
1020
835
|
{"ok": false, "reason": "not the lock holder"}
|
|
1021
836
|
```
|
|
1022
837
|
|
|
1023
838
|
#### `rlock-heartbeat`
|
|
1024
839
|
|
|
1025
|
-
Reset
|
|
840
|
+
Reset TTL on held lock during long work.
|
|
1026
841
|
|
|
1027
842
|
```bash
|
|
1028
843
|
rlock-heartbeat "github issue acme/app#42"
|
|
1029
844
|
```
|
|
1030
845
|
|
|
1031
|
-
**Success:**
|
|
1032
|
-
|
|
1033
846
|
```json
|
|
1034
847
|
{"ok": true, "expiresAt": "2025-01-15T11:00:00Z"}
|
|
1035
848
|
```
|
|
1036
849
|
|
|
1037
850
|
#### Lock behavior
|
|
1038
851
|
|
|
1039
|
-
-
|
|
1040
|
-
- When a container exits — whether it finishes successfully, hits an error, or times out — all of its locks are released automatically by the scheduler.
|
|
1041
|
-
- An agent can hold **at most one lock at a time**. Release your current lock before acquiring another.
|
|
1042
|
-
- Locks expire automatically after `lockTimeout` seconds (default: 1800 / 30 minutes) if not refreshed via heartbeat.
|
|
1043
|
-
- Use descriptive keys: `"github issue acme/app#42"`, `"deploy api-prod"`
|
|
852
|
+
Per-run secret auth. Auto-release on exit. **One at a time**. Expire after `lockTimeout` (1800s).
|
|
1044
853
|
|
|
1045
854
|
#### Lock graceful degradation
|
|
1046
855
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
Call commands (`al-call`, `al-check`, `al-wait`) exit 5 when `GATEWAY_URL` is not set — they require a gateway.
|
|
856
|
+
No gateway: locks degrade gracefully (exit 0). Calls exit 5.
|
|
1050
857
|
|
|
1051
858
|
## CLI Commands
|
|
1052
859
|
|
|
1053
|
-
### `al new <name>`
|
|
1054
|
-
|
|
1055
|
-
Creates a new Action Llama project. Runs interactive setup to configure credentials and LLM defaults.
|
|
1056
|
-
|
|
1057
|
-
```bash
|
|
1058
|
-
npx @action-llama/action-llama new my-project
|
|
1059
|
-
```
|
|
1060
|
-
|
|
1061
|
-
Creates:
|
|
1062
|
-
- `my-project/package.json` — with `@action-llama/action-llama` dependency
|
|
1063
|
-
- `my-project/.gitignore`
|
|
1064
|
-
- `my-project/.workspace/` — runtime state directory
|
|
1065
|
-
- Credential files in `~/.action-llama/credentials/`
|
|
1066
|
-
|
|
1067
|
-
### `al doctor`
|
|
1068
|
-
|
|
1069
|
-
Checks all agent credentials and interactively prompts for any that are missing. Discovers agents in the project, collects their credential requirements (plus any webhook secret credentials), and ensures each one exists on disk. Also generates a gateway API key if one doesn't exist yet.
|
|
1070
|
-
|
|
1071
|
-
Additionally validates webhook trigger field configurations to catch common errors like using `repository` instead of `repos`, misspelled field names, or invalid field types.
|
|
1072
|
-
|
|
1073
|
-
```bash
|
|
1074
|
-
al doctor
|
|
1075
|
-
al doctor -E production
|
|
1076
|
-
```
|
|
860
|
+
### `al new <name>` — Create project
|
|
1077
861
|
|
|
1078
|
-
|
|
1079
|
-
|--------|-------------|
|
|
1080
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1081
|
-
| `-E, --env <name>` | Environment name — pushes credentials to server and reconciles IAM |
|
|
862
|
+
### `al doctor` — Check/prompt for missing credentials. `-E` pushes to server.
|
|
1082
863
|
|
|
1083
|
-
### `al run <agent>`
|
|
864
|
+
### `al run <agent>` — Single run for testing (`-H` headless)
|
|
1084
865
|
|
|
1085
|
-
|
|
866
|
+
### `al start` — Start scheduler (`-w` dashboard, `-e` expose, `-H` headless, `--port <N>`)
|
|
1086
867
|
|
|
1087
|
-
|
|
1088
|
-
al run dev
|
|
1089
|
-
al run reviewer -p ./my-project
|
|
1090
|
-
al run dev -E production
|
|
1091
|
-
al run dev --headless
|
|
1092
|
-
```
|
|
868
|
+
### `al stop` — Stop scheduler (in-flight runs finish)
|
|
1093
869
|
|
|
1094
|
-
|
|
1095
|
-
|--------|-------------|
|
|
1096
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1097
|
-
| `-E, --env <name>` | Environment name |
|
|
1098
|
-
| `-H, --headless` | Non-interactive mode (no TUI, no credential prompts) |
|
|
870
|
+
### `al stat` — Agent status overview
|
|
1099
871
|
|
|
1100
|
-
### `al
|
|
872
|
+
### `al logs <agent>` — View logs (`-n`, `-f`, `-d`, `-r`, `-i`)
|
|
1101
873
|
|
|
1102
|
-
|
|
874
|
+
### `al pause/resume [name]` — Pause/resume scheduler or agent
|
|
1103
875
|
|
|
1104
|
-
|
|
1105
|
-
al start
|
|
1106
|
-
al start -w # Enable web dashboard
|
|
1107
|
-
al start -e # VPS deployment: expose gateway publicly
|
|
1108
|
-
al start --port 3000 # Custom gateway port
|
|
1109
|
-
al start -H # Headless (no TUI)
|
|
1110
|
-
```
|
|
876
|
+
### `al kill <target>` — Kill agent or instance
|
|
1111
877
|
|
|
1112
|
-
|
|
1113
|
-
|--------|-------------|
|
|
1114
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1115
|
-
| `-E, --env <name>` | Environment name |
|
|
1116
|
-
| `-w, --web-ui` | Enable web dashboard |
|
|
1117
|
-
| `-e, --expose` | Bind gateway to `0.0.0.0` (public) while keeping local-mode features |
|
|
1118
|
-
| `-H, --headless` | Non-interactive mode (no TUI, no credential prompts) |
|
|
1119
|
-
| `--port <number>` | Gateway port (overrides `[gateway].port` in config) |
|
|
878
|
+
### `al chat [agent]` — Interactive console (with agent: credentials injected)
|
|
1120
879
|
|
|
1121
|
-
### `al
|
|
880
|
+
### `al push [agent]` — Deploy via SSH (full or hot-reload single agent)
|
|
1122
881
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
```bash
|
|
1126
|
-
al stop
|
|
1127
|
-
al stop -E production
|
|
1128
|
-
```
|
|
1129
|
-
|
|
1130
|
-
| Option | Description |
|
|
1131
|
-
|--------|-------------|
|
|
1132
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1133
|
-
| `-E, --env <name>` | Environment name |
|
|
1134
|
-
|
|
1135
|
-
### `al stat`
|
|
1136
|
-
|
|
1137
|
-
Shows status of all discovered agents in the project. Displays each agent's schedule, credentials, webhook configuration, and queue depth.
|
|
1138
|
-
|
|
1139
|
-
```bash
|
|
1140
|
-
al stat
|
|
1141
|
-
al stat -E production
|
|
1142
|
-
```
|
|
1143
|
-
|
|
1144
|
-
| Option | Description |
|
|
1145
|
-
|--------|-------------|
|
|
1146
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1147
|
-
| `-E, --env <name>` | Environment name |
|
|
1148
|
-
|
|
1149
|
-
### `al logs <agent>`
|
|
1150
|
-
|
|
1151
|
-
View log files for a specific agent.
|
|
1152
|
-
|
|
1153
|
-
```bash
|
|
1154
|
-
al logs dev
|
|
1155
|
-
al logs dev -n 100 # Show last 100 entries
|
|
1156
|
-
al logs dev -f # Follow/tail mode
|
|
1157
|
-
al logs dev -d 2025-01-15 # Specific date
|
|
1158
|
-
al logs dev -r # Raw JSON log output
|
|
1159
|
-
al logs dev -i abc123 # Specific instance
|
|
1160
|
-
al logs dev -E production # Remote agent logs
|
|
1161
|
-
```
|
|
1162
|
-
|
|
1163
|
-
| Option | Description |
|
|
1164
|
-
|--------|-------------|
|
|
1165
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1166
|
-
| `-E, --env <name>` | Environment name |
|
|
1167
|
-
| `-n, --lines <N>` | Number of log entries (default: 50) |
|
|
1168
|
-
| `-f, --follow` | Tail mode — watch for new entries |
|
|
1169
|
-
| `-d, --date <YYYY-MM-DD>` | View a specific date's log file |
|
|
1170
|
-
| `-r, --raw` | Raw JSON log output (no formatting) |
|
|
1171
|
-
| `-i, --instance <id>` | Filter to a specific instance ID |
|
|
1172
|
-
|
|
1173
|
-
### `al pause [name]`
|
|
1174
|
-
|
|
1175
|
-
Pause the scheduler or a single agent. Without a name, pauses the entire scheduler — all cron jobs stop firing. With a name, pauses that agent — its cron job stops firing and webhook events are ignored. In-flight runs continue until they finish. Requires the gateway.
|
|
1176
|
-
|
|
1177
|
-
```bash
|
|
1178
|
-
al pause # Pause the scheduler
|
|
1179
|
-
al pause dev # Pause a single agent
|
|
1180
|
-
al pause dev -E production
|
|
1181
|
-
```
|
|
1182
|
-
|
|
1183
|
-
| Option | Description |
|
|
1184
|
-
|--------|-------------|
|
|
1185
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1186
|
-
| `-E, --env <name>` | Environment name |
|
|
1187
|
-
|
|
1188
|
-
### `al resume [name]`
|
|
1189
|
-
|
|
1190
|
-
Resume the scheduler or a single agent. Without a name, resumes the entire scheduler. With a name, resumes that agent — its cron job resumes firing and webhooks are accepted again.
|
|
1191
|
-
|
|
1192
|
-
```bash
|
|
1193
|
-
al resume # Resume the scheduler
|
|
1194
|
-
al resume dev # Resume a single agent
|
|
1195
|
-
al resume dev -E production
|
|
1196
|
-
```
|
|
1197
|
-
|
|
1198
|
-
| Option | Description |
|
|
1199
|
-
|--------|-------------|
|
|
1200
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1201
|
-
| `-E, --env <name>` | Environment name |
|
|
1202
|
-
|
|
1203
|
-
### `al kill <target>`
|
|
1204
|
-
|
|
1205
|
-
Kill an agent (all running instances) or a single instance by ID. Tries the target as an agent name first; if not found, falls back to instance ID. This does **not** pause the agent — if it has a schedule, a new run will start at the next cron tick. To fully stop an agent, pause it first, then kill.
|
|
1206
|
-
|
|
1207
|
-
```bash
|
|
1208
|
-
al kill dev # Kill all instances of an agent
|
|
1209
|
-
al kill my-agent-abc123 # Kill a single instance by ID
|
|
1210
|
-
al kill dev -E production
|
|
1211
|
-
```
|
|
1212
|
-
|
|
1213
|
-
| Option | Description |
|
|
1214
|
-
|--------|-------------|
|
|
1215
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1216
|
-
| `-E, --env <name>` | Environment name |
|
|
1217
|
-
|
|
1218
|
-
### `al chat [agent]`
|
|
1219
|
-
|
|
1220
|
-
Open an interactive console. Without an agent name, opens the project-level console for creating and managing agents. With an agent name, opens an interactive session scoped to that agent's environment — credentials are loaded and injected as environment variables (e.g. `GITHUB_TOKEN`, `GIT_SSH_COMMAND`), and the working directory is set to the agent's directory.
|
|
1221
|
-
|
|
1222
|
-
```bash
|
|
1223
|
-
al chat # project-level console
|
|
1224
|
-
al chat dev # interactive session with dev agent's credentials
|
|
1225
|
-
```
|
|
1226
|
-
|
|
1227
|
-
| Option | Description |
|
|
1228
|
-
|--------|-------------|
|
|
1229
|
-
| `[agent]` | Agent name — loads its credentials and environment |
|
|
1230
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1231
|
-
|
|
1232
|
-
When running in agent mode, the command probes the gateway and warns if it is not reachable:
|
|
1233
|
-
|
|
1234
|
-
```
|
|
1235
|
-
Warning: No gateway detected at http://localhost:8080. Resource locks, agent calls, and signals are unavailable.
|
|
1236
|
-
Start the scheduler with `al start` to enable these features.
|
|
1237
|
-
```
|
|
1238
|
-
|
|
1239
|
-
The agent's ACTIONS.md is loaded as reference context but is **not** auto-executed — you drive the session interactively.
|
|
1240
|
-
|
|
1241
|
-
### `al push [agent]`
|
|
1242
|
-
|
|
1243
|
-
Deploy your project to a server over SSH. Requires a `[server]` section in your environment file.
|
|
1244
|
-
|
|
1245
|
-
```bash
|
|
1246
|
-
al push -E production # Full project push
|
|
1247
|
-
al push dev -E production # Push only the dev agent (hot-reloaded)
|
|
1248
|
-
al push --dry-run -E production # Preview what would be synced
|
|
1249
|
-
al push --creds-only -E production # Sync only credentials
|
|
1250
|
-
```
|
|
1251
|
-
|
|
1252
|
-
Without an agent name, pushes the entire project and can restart the remote service. With an agent name, pushes only that agent's files and credentials — the running scheduler detects the change and hot-reloads the agent without a full restart.
|
|
1253
|
-
|
|
1254
|
-
| Option | Description |
|
|
1255
|
-
|--------|-------------|
|
|
1256
|
-
| `[agent]` | Agent name — push only this agent (hot-reloaded, no restart) |
|
|
1257
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1258
|
-
| `-E, --env <name>` | Environment with `[server]` config |
|
|
1259
|
-
| `--dry-run` | Show what would be synced without making changes |
|
|
1260
|
-
| `--no-creds` | Skip credential sync |
|
|
1261
|
-
| `--creds-only` | Sync only credentials (skip project files) |
|
|
1262
|
-
| `--files-only` | Sync only project files (skip credentials) |
|
|
1263
|
-
| `-a, --all` | Sync project files, credentials, and restart service |
|
|
1264
|
-
| `--force-install` | Force `npm install` even if dependencies appear unchanged |
|
|
882
|
+
`--dry-run`, `--no-creds`, `--creds-only`, `--files-only`, `-a`, `--force-install`.
|
|
1265
883
|
|
|
1266
884
|
### Environment commands
|
|
1267
885
|
|
|
1268
|
-
#### `al env init <name>`
|
|
1269
|
-
|
|
1270
|
-
Create a new environment configuration file at `~/.action-llama/environments/<name>.toml`.
|
|
1271
|
-
|
|
1272
|
-
```bash
|
|
1273
|
-
al env init production --type server
|
|
1274
|
-
```
|
|
1275
|
-
|
|
1276
|
-
| Option | Description |
|
|
1277
|
-
|--------|-------------|
|
|
1278
|
-
| `--type <type>` | Environment type: `server` |
|
|
1279
|
-
|
|
1280
|
-
#### `al env list`
|
|
1281
|
-
|
|
1282
|
-
List all configured environments.
|
|
1283
|
-
|
|
1284
|
-
#### `al env show <name>`
|
|
1285
|
-
|
|
1286
|
-
Display the contents of an environment configuration file.
|
|
1287
|
-
|
|
1288
|
-
#### `al env set [name]`
|
|
1289
|
-
|
|
1290
|
-
Bind the current project to an environment by writing the environment name to `.env.toml`. Omit the name to unbind.
|
|
1291
|
-
|
|
1292
|
-
```bash
|
|
1293
|
-
al env set production # Bind project to "production"
|
|
1294
|
-
al env set # Unbind project from any environment
|
|
1295
|
-
```
|
|
1296
|
-
|
|
1297
|
-
| Option | Description |
|
|
1298
|
-
|--------|-------------|
|
|
1299
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1300
|
-
|
|
1301
|
-
#### `al env check <name>`
|
|
1302
|
-
|
|
1303
|
-
Verify that an environment is provisioned and configured correctly. Checks SSH connectivity, Docker availability, and server readiness.
|
|
1304
|
-
|
|
1305
|
-
#### `al env prov [name]`
|
|
1306
|
-
|
|
1307
|
-
Provision a new VPS and save it as an environment. Supports Vultr and Hetzner. If the name is omitted, you'll be prompted for one.
|
|
886
|
+
#### `al env init <name>` — Create at `~/.action-llama/environments/<name>.toml`
|
|
1308
887
|
|
|
1309
|
-
#### `al env
|
|
888
|
+
#### `al env list` / `al env show <name>` — List or show environments
|
|
1310
889
|
|
|
1311
|
-
|
|
890
|
+
#### `al env set [name]` — Bind/unbind project to environment (`.env.toml`)
|
|
1312
891
|
|
|
1313
|
-
|
|
1314
|
-
|--------|-------------|
|
|
1315
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1316
|
-
|
|
1317
|
-
#### `al env logs [name]`
|
|
892
|
+
#### `al env check <name>` — Verify SSH, Docker, server readiness
|
|
1318
893
|
|
|
1319
|
-
|
|
894
|
+
#### `al env prov [name]` — Provision VPS (Vultr/Hetzner)
|
|
1320
895
|
|
|
1321
|
-
|
|
1322
|
-
al env logs production
|
|
1323
|
-
al env logs production -n 200 # Last 200 lines
|
|
1324
|
-
al env logs production -f # Follow mode
|
|
1325
|
-
```
|
|
896
|
+
#### `al env deprov <name>` — Tear down environment
|
|
1326
897
|
|
|
1327
|
-
|
|
1328
|
-
|--------|-------------|
|
|
1329
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1330
|
-
| `-n, --lines <N>` | Number of log lines (default: 50) |
|
|
1331
|
-
| `-f, --follow` | Tail mode — watch for new entries |
|
|
898
|
+
#### `al env logs [name]` — Server logs via SSH (`-n`, `-f`)
|
|
1332
899
|
|
|
1333
900
|
### Credential commands
|
|
1334
901
|
|
|
1335
|
-
#### `al creds ls`
|
|
1336
|
-
|
|
1337
|
-
Lists all stored credentials grouped by type, showing field names but not values.
|
|
1338
|
-
|
|
1339
|
-
#### `al creds add <ref>`
|
|
1340
|
-
|
|
1341
|
-
Add or update a credential. Runs the interactive prompter with validation for the credential type.
|
|
902
|
+
#### `al creds ls` — List credentials (names, not values)
|
|
1342
903
|
|
|
1343
|
-
|
|
1344
|
-
al creds add github_token # adds github_token:default
|
|
1345
|
-
al creds add github_webhook_secret:myapp
|
|
1346
|
-
al creds add git_ssh:prod
|
|
1347
|
-
```
|
|
904
|
+
#### `al creds add <ref>` — Add/update (`github_token` or `git_ssh:prod`)
|
|
1348
905
|
|
|
1349
|
-
|
|
906
|
+
#### `al creds rm <ref>` — Remove credential
|
|
1350
907
|
|
|
1351
|
-
#### `al creds
|
|
1352
|
-
|
|
1353
|
-
Remove a credential from disk.
|
|
1354
|
-
|
|
1355
|
-
```bash
|
|
1356
|
-
al creds rm github_token # removes github_token:default
|
|
1357
|
-
al creds rm github_webhook_secret:myapp
|
|
1358
|
-
```
|
|
1359
|
-
|
|
1360
|
-
#### `al creds types`
|
|
1361
|
-
|
|
1362
|
-
Browse available credential types interactively. Presents a searchable list of all built-in credential types. On selection, shows the credential's fields, environment variables, and agent context, then offers to add it immediately.
|
|
908
|
+
#### `al creds types` — Browse credential types
|
|
1363
909
|
|
|
1364
910
|
### Agent commands
|
|
1365
911
|
|
|
1366
|
-
#### `al agent new`
|
|
1367
|
-
|
|
1368
|
-
Interactive wizard to create a new agent from a template. Prompts for agent type (dev, reviewer, devops, or custom), agent name, and then runs `al agent config` to configure the new agent.
|
|
1369
|
-
|
|
1370
|
-
| Option | Description |
|
|
1371
|
-
|--------|-------------|
|
|
1372
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1373
|
-
|
|
1374
|
-
#### `al agent config <name>`
|
|
912
|
+
#### `al agent new` — Create from template (dev, reviewer, devops, custom)
|
|
1375
913
|
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
| Option | Description |
|
|
1379
|
-
|--------|-------------|
|
|
1380
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
914
|
+
#### `al agent config <name>` — Configure agent interactively
|
|
1381
915
|
|
|
1382
916
|
### Global options
|
|
1383
917
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
| Option | Description |
|
|
1387
|
-
|--------|-------------|
|
|
1388
|
-
| `-p, --project <dir>` | Project directory (default: `.`) |
|
|
1389
|
-
| `-E, --env <name>` | Environment name (also `AL_ENV` env var or `environment` field in `.env.toml`) |
|
|
918
|
+
`-p <dir>` (project, default `.`) and `-E <name>` (env, also `AL_ENV` or `.env.toml`).
|
|
1390
919
|
|
|
1391
920
|
## Docker
|
|
1392
921
|
|
|
@@ -1400,11 +929,11 @@ al-project-base:latest ← project Dockerfile (skipped if unmodified from ba
|
|
|
1400
929
|
al-<agent>:latest ← per-agent Dockerfile (if present)
|
|
1401
930
|
```
|
|
1402
931
|
|
|
1403
|
-
|
|
932
|
+
Bare project Dockerfile skips middle layer.
|
|
1404
933
|
|
|
1405
934
|
### Base image contents
|
|
1406
935
|
|
|
1407
|
-
|
|
936
|
+
Built from `node:20-alpine`:
|
|
1408
937
|
|
|
1409
938
|
| Package | Purpose |
|
|
1410
939
|
|---------|---------|
|
|
@@ -1415,19 +944,11 @@ The base image (`al-agent:latest`) is built from `node:20-alpine` and includes:
|
|
|
1415
944
|
| `ca-certificates` | HTTPS for git, curl, npm |
|
|
1416
945
|
| `openssh-client` | SSH for `GIT_SSH_COMMAND` — git clone/push over SSH |
|
|
1417
946
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
Entry point: `node /app/dist/agents/container-entry.js`
|
|
1421
|
-
|
|
1422
|
-
Shell commands are baked into the image at `/app/bin/` (al-rerun, al-status, al-return, al-exit, al-call, al-check, al-wait, rlock, runlock, rlock-heartbeat).
|
|
947
|
+
Entry: `node /app/dist/agents/container-entry.js`. Commands at `/app/bin/`.
|
|
1423
948
|
|
|
1424
949
|
### Dockerfile conventions
|
|
1425
950
|
|
|
1426
|
-
|
|
1427
|
-
- Switch to `root` for package installs, back to `node` (uid 1000) for the entry point
|
|
1428
|
-
- Alpine base: use `apk add --no-cache`
|
|
1429
|
-
- Agent images are named `al-<agent-name>:latest` (e.g. `al-dev:latest`) and are rebuilt on every `al start`
|
|
1430
|
-
- The build context is the Action Llama package root (not the project directory), so `COPY` paths reference the package's `dist/`, `package.json`, etc.
|
|
951
|
+
`FROM al-agent:latest` (auto-rewritten). Images: `al-<name>:latest`.
|
|
1431
952
|
|
|
1432
953
|
#### Project Dockerfile example
|
|
1433
954
|
|
|
@@ -1453,11 +974,7 @@ USER node
|
|
|
1453
974
|
|
|
1454
975
|
#### Standalone Dockerfile (full control)
|
|
1455
976
|
|
|
1456
|
-
|
|
1457
|
-
1. Node.js 20+
|
|
1458
|
-
2. `/app/dist/agents/container-entry.js` must exist
|
|
1459
|
-
3. `ENTRYPOINT ["node", "/app/dist/agents/container-entry.js"]`
|
|
1460
|
-
4. `USER node` (uid 1000) for compatibility
|
|
977
|
+
Needs Node.js 20+, entry.js, `USER node`.
|
|
1461
978
|
|
|
1462
979
|
```dockerfile
|
|
1463
980
|
FROM node:20-alpine
|
|
@@ -1471,11 +988,11 @@ USER node
|
|
|
1471
988
|
ENTRYPOINT ["node", "/app/dist/agents/container-entry.js"]
|
|
1472
989
|
```
|
|
1473
990
|
|
|
1474
|
-
|
|
991
|
+
Reads `AGENT_CONFIG`, `PROMPT`, `GATEWAY_URL` from env.
|
|
1475
992
|
|
|
1476
993
|
### Container filesystem
|
|
1477
994
|
|
|
1478
|
-
|
|
995
|
+
Read-only root, non-root user, resource limits.
|
|
1479
996
|
|
|
1480
997
|
| Path | Mode | Contents |
|
|
1481
998
|
|------|------|----------|
|
|
@@ -1487,34 +1004,25 @@ All agents run in isolated containers with a read-only root filesystem, dropped
|
|
|
1487
1004
|
| `/workspace` | read-write (2GB) | Persistent workspace |
|
|
1488
1005
|
| `/home/node` | read-write (64MB) | Home directory |
|
|
1489
1006
|
|
|
1490
|
-
###
|
|
1491
|
-
|
|
1492
|
-
These go in `config.toml` under `[local]`:
|
|
1007
|
+
### Environment variable persistence
|
|
1493
1008
|
|
|
1494
|
-
|
|
1495
|
-
|-----|---------|-------------|
|
|
1496
|
-
| `local.image` | `"al-agent:latest"` | Base Docker image name |
|
|
1497
|
-
| `local.memory` | `"4g"` | Memory limit per container |
|
|
1498
|
-
| `local.cpus` | `2` | CPU limit per container |
|
|
1499
|
-
| `local.timeout` | `900` | Max container runtime in seconds |
|
|
1009
|
+
Write to `/tmp/env.sh` to persist environment variables across bash commands:
|
|
1500
1010
|
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
### Authentication
|
|
1011
|
+
```bash
|
|
1012
|
+
echo 'export REPO="owner/repo"' > /tmp/env.sh
|
|
1013
|
+
echo 'export ISSUE_NUMBER=42' >> /tmp/env.sh
|
|
1014
|
+
gh issue view $ISSUE_NUMBER --repo $REPO
|
|
1015
|
+
```
|
|
1508
1016
|
|
|
1509
|
-
|
|
1017
|
+
File is automatically sourced before each bash command.
|
|
1510
1018
|
|
|
1511
|
-
|
|
1019
|
+
See `[local]` in config.toml for Docker configuration options.
|
|
1512
1020
|
|
|
1513
|
-
|
|
1021
|
+
## Gateway API
|
|
1514
1022
|
|
|
1515
|
-
|
|
1023
|
+
Auto-starting HTTP server. Port: `[gateway].port`.
|
|
1516
1024
|
|
|
1517
|
-
|
|
1025
|
+
API key at `~/.action-llama/credentials/gateway_api_key/default/key`.
|
|
1518
1026
|
|
|
1519
1027
|
### Protected routes
|
|
1520
1028
|
|
|
@@ -1528,16 +1036,16 @@ The key is generated automatically by `al doctor` or on first `al start`. To vie
|
|
|
1528
1036
|
|
|
1529
1037
|
### Control API
|
|
1530
1038
|
|
|
1531
|
-
All
|
|
1039
|
+
All `POST`, require auth.
|
|
1532
1040
|
|
|
1533
|
-
**Scheduler
|
|
1041
|
+
**Scheduler:**
|
|
1534
1042
|
|
|
1535
1043
|
| Endpoint | Description |
|
|
1536
1044
|
|----------|-------------|
|
|
1537
1045
|
| `POST /control/pause` | Pause the scheduler (all cron jobs) |
|
|
1538
1046
|
| `POST /control/resume` | Resume the scheduler |
|
|
1539
1047
|
|
|
1540
|
-
**
|
|
1048
|
+
**Agents:**
|
|
1541
1049
|
|
|
1542
1050
|
| Endpoint | Description |
|
|
1543
1051
|
|----------|-------------|
|
|
@@ -1550,7 +1058,7 @@ All control endpoints use `POST` and require authentication.
|
|
|
1550
1058
|
|
|
1551
1059
|
### SSE Streams
|
|
1552
1060
|
|
|
1553
|
-
Live updates
|
|
1061
|
+
Live updates via **SSE**:
|
|
1554
1062
|
|
|
1555
1063
|
| Endpoint | Description |
|
|
1556
1064
|
|----------|-------------|
|
|
@@ -1566,31 +1074,9 @@ Live updates use **Server-Sent Events (SSE)**:
|
|
|
1566
1074
|
|
|
1567
1075
|
## Web Dashboard
|
|
1568
1076
|
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
### Enabling
|
|
1572
|
-
|
|
1573
|
-
Pass `-w` or `--web-ui` to `al start`:
|
|
1574
|
-
|
|
1575
|
-
```bash
|
|
1576
|
-
al start -w
|
|
1577
|
-
```
|
|
1578
|
-
|
|
1579
|
-
The dashboard URL is shown in the TUI header once the scheduler starts:
|
|
1580
|
-
|
|
1581
|
-
```
|
|
1582
|
-
Dashboard: http://localhost:8080/dashboard
|
|
1583
|
-
```
|
|
1077
|
+
Enable with `al start -w`. URL: `http://localhost:<port>/dashboard`. Login with gateway API key.
|
|
1584
1078
|
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
### Authentication
|
|
1588
|
-
|
|
1589
|
-
The dashboard is protected by the gateway API key. Navigate to `http://localhost:8080/dashboard` and you'll be redirected to a login page where you paste your API key. On success, an `al_session` cookie is set (HttpOnly, SameSite=Strict).
|
|
1590
|
-
|
|
1591
|
-
### Main Page — `/dashboard`
|
|
1592
|
-
|
|
1593
|
-
Displays a live overview of all agents:
|
|
1079
|
+
### `/dashboard`
|
|
1594
1080
|
|
|
1595
1081
|
| Column | Description |
|
|
1596
1082
|
|--------|-------------|
|
|
@@ -1602,24 +1088,13 @@ Displays a live overview of all agents:
|
|
|
1602
1088
|
| Next Run | When the next scheduled run will happen |
|
|
1603
1089
|
| Actions | **Run** (trigger an immediate run) and **Enable/Disable** (toggle the agent) |
|
|
1604
1090
|
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
All data updates in real time via Server-Sent Events (SSE) — no manual refresh needed.
|
|
1608
|
-
|
|
1609
|
-
### Agent Logs — `/dashboard/agents/<name>/logs`
|
|
1610
|
-
|
|
1611
|
-
Displays a live-streaming log view for a single agent. Logs follow automatically by default (new entries scroll into view as they arrive). Features:
|
|
1612
|
-
|
|
1613
|
-
- **Follow mode** — enabled by default, auto-scrolls. Scrolling up pauses follow; scrolling back to the bottom re-enables it.
|
|
1614
|
-
- **Clear** — clears the log display (does not delete log files).
|
|
1615
|
-
- **Connection status** — shows whether the SSE connection is active.
|
|
1616
|
-
- **Log levels** — color-coded: green for INFO, yellow for WARN, red for ERROR.
|
|
1091
|
+
Pause/Resume, Recent Activity. SSE updates.
|
|
1617
1092
|
|
|
1618
|
-
|
|
1093
|
+
### `/dashboard/agents/<name>/logs` — Live streaming agent logs
|
|
1619
1094
|
|
|
1620
1095
|
## Environments
|
|
1621
1096
|
|
|
1622
|
-
|
|
1097
|
+
Three-layer config merge (later wins):
|
|
1623
1098
|
|
|
1624
1099
|
| Layer | File | Scope | Contents |
|
|
1625
1100
|
|-------|------|-------|----------|
|
|
@@ -1627,15 +1102,9 @@ Projects are portable — cloud infrastructure details live outside the project
|
|
|
1627
1102
|
| 2 | `.env.toml` | Project (gitignored) | `environment` field to select env, can override any config value |
|
|
1628
1103
|
| 3 | `~/.action-llama/environments/<name>.toml` | Machine | `[server]` (SSH push deploy), `gateway.url`, `telemetry.endpoint` |
|
|
1629
1104
|
|
|
1630
|
-
`[cloud]
|
|
1105
|
+
`[cloud]`/`[server]` must be Layer 3. Mutually exclusive.
|
|
1631
1106
|
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
`-E`/`--env <name>` flag > `AL_ENV` env var > `.env.toml` `environment` field.
|
|
1635
|
-
|
|
1636
|
-
### Environment types
|
|
1637
|
-
|
|
1638
|
-
For `al env init`: `server`.
|
|
1107
|
+
Priority: `-E` flag > `AL_ENV` env var > `.env.toml`. Type: `server`.
|
|
1639
1108
|
|
|
1640
1109
|
### Server environment example
|
|
1641
1110
|
|
|
@@ -1651,23 +1120,21 @@ expose = true
|
|
|
1651
1120
|
|
|
1652
1121
|
### VPS credential sync
|
|
1653
1122
|
|
|
1654
|
-
|
|
1123
|
+
Credentials synced via SSH.
|
|
1655
1124
|
|
|
1656
1125
|
## Running Agents
|
|
1657
1126
|
|
|
1658
|
-
|
|
1127
|
+
`al start` runs all agents. No per-agent start.
|
|
1659
1128
|
|
|
1660
1129
|
### Automatic re-runs
|
|
1661
1130
|
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
Webhook-triggered and agent-triggered runs do not re-run — they respond to a single event.
|
|
1131
|
+
`al-rerun` triggers re-run until done/error/`maxReruns`. Webhook/call runs don't re-run.
|
|
1665
1132
|
|
|
1666
1133
|
## Exit Codes
|
|
1667
1134
|
|
|
1668
1135
|
### Shell command exit codes
|
|
1669
1136
|
|
|
1670
|
-
|
|
1137
|
+
**Always check exit codes.**
|
|
1671
1138
|
|
|
1672
1139
|
| Exit | Meaning | HTTP | When |
|
|
1673
1140
|
|------|---------|------|------|
|
|
@@ -1697,10 +1164,4 @@ All gateway-calling shell commands (`rlock`, `runlock`, `rlock-heartbeat`, `al-c
|
|
|
1697
1164
|
| 15 | Unrecoverable (default) |
|
|
1698
1165
|
| 16 | User abort |
|
|
1699
1166
|
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
**Lock commands** (`rlock`, `runlock`, `rlock-heartbeat`) exit 0 with `{"ok":true}` when `GATEWAY_URL` is unset (graceful degradation for local/non-containerized runs).
|
|
1703
|
-
|
|
1704
|
-
**Call commands** (`al-call`, `al-check`, `al-wait`) exit 5 when `GATEWAY_URL` is unset — they require a gateway.
|
|
1705
|
-
|
|
1706
|
-
**Timeout:** Container terminated by timeout exits with code 124.
|
|
1167
|
+
Timeout: exit 124.
|