@action-llama/action-llama 0.12.2 → 0.13.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.
Files changed (168) hide show
  1. package/{docs/agent-reference → agent-docs}/AGENTS.md +31 -15
  2. package/{docs/agent-reference → agent-docs}/skills/README.md +1 -0
  3. package/agent-docs/skills/calls.md +82 -0
  4. package/{docs/agent-reference → agent-docs}/skills/resource-locks.md +13 -7
  5. package/{docs/agent-reference → agent-docs}/skills/signals.md +1 -1
  6. package/dist/agents/container-runner.d.ts +3 -2
  7. package/dist/agents/container-runner.d.ts.map +1 -1
  8. package/dist/agents/container-runner.js +12 -12
  9. package/dist/agents/container-runner.js.map +1 -1
  10. package/dist/agents/prompt.d.ts.map +1 -1
  11. package/dist/agents/prompt.js +3 -2
  12. package/dist/agents/prompt.js.map +1 -1
  13. package/dist/agents/runner.d.ts +3 -2
  14. package/dist/agents/runner.d.ts.map +1 -1
  15. package/dist/agents/runner.js +14 -14
  16. package/dist/agents/runner.js.map +1 -1
  17. package/dist/build-info.json +1 -1
  18. package/dist/cli/commands/doctor.d.ts +1 -0
  19. package/dist/cli/commands/doctor.d.ts.map +1 -1
  20. package/dist/cli/commands/doctor.js +53 -15
  21. package/dist/cli/commands/doctor.js.map +1 -1
  22. package/dist/cli/commands/env.d.ts +4 -0
  23. package/dist/cli/commands/env.d.ts.map +1 -1
  24. package/dist/cli/commands/env.js +41 -0
  25. package/dist/cli/commands/env.js.map +1 -1
  26. package/dist/cli/commands/kill.js +2 -2
  27. package/dist/cli/commands/kill.js.map +1 -1
  28. package/dist/cli/commands/logs.d.ts.map +1 -1
  29. package/dist/cli/commands/logs.js +25 -20
  30. package/dist/cli/commands/logs.js.map +1 -1
  31. package/dist/cli/commands/pause.js +2 -2
  32. package/dist/cli/commands/pause.js.map +1 -1
  33. package/dist/cli/commands/push.d.ts +1 -0
  34. package/dist/cli/commands/push.d.ts.map +1 -1
  35. package/dist/cli/commands/push.js +2 -1
  36. package/dist/cli/commands/push.js.map +1 -1
  37. package/dist/cli/commands/resume.js +2 -2
  38. package/dist/cli/commands/resume.js.map +1 -1
  39. package/dist/cli/commands/run.d.ts.map +1 -1
  40. package/dist/cli/commands/run.js +21 -46
  41. package/dist/cli/commands/run.js.map +1 -1
  42. package/dist/cli/commands/start.d.ts.map +1 -1
  43. package/dist/cli/commands/start.js +62 -2
  44. package/dist/cli/commands/start.js.map +1 -1
  45. package/dist/cli/commands/status.d.ts.map +1 -1
  46. package/dist/cli/commands/status.js +23 -7
  47. package/dist/cli/commands/status.js.map +1 -1
  48. package/dist/cli/commands/stop.d.ts +1 -0
  49. package/dist/cli/commands/stop.d.ts.map +1 -1
  50. package/dist/cli/commands/stop.js +3 -2
  51. package/dist/cli/commands/stop.js.map +1 -1
  52. package/dist/cli/gateway-client.d.ts +6 -0
  53. package/dist/cli/gateway-client.d.ts.map +1 -1
  54. package/dist/cli/gateway-client.js +19 -0
  55. package/dist/cli/gateway-client.js.map +1 -1
  56. package/dist/cli/main.js +12 -0
  57. package/dist/cli/main.js.map +1 -1
  58. package/dist/cloud/vps/constants.d.ts +1 -1
  59. package/dist/cloud/vps/constants.d.ts.map +1 -1
  60. package/dist/cloud/vps/constants.js +9 -0
  61. package/dist/cloud/vps/constants.js.map +1 -1
  62. package/dist/cloud/vps/hetzner-api.d.ts +14 -3
  63. package/dist/cloud/vps/hetzner-api.d.ts.map +1 -1
  64. package/dist/cloud/vps/hetzner-api.js +24 -11
  65. package/dist/cloud/vps/hetzner-api.js.map +1 -1
  66. package/dist/cloud/vps/provision.js +29 -6
  67. package/dist/cloud/vps/provision.js.map +1 -1
  68. package/dist/cloud/vps/ssh.d.ts +7 -0
  69. package/dist/cloud/vps/ssh.d.ts.map +1 -1
  70. package/dist/cloud/vps/ssh.js +15 -1
  71. package/dist/cloud/vps/ssh.js.map +1 -1
  72. package/dist/credentials/builtins/index.d.ts.map +1 -1
  73. package/dist/credentials/builtins/index.js +2 -0
  74. package/dist/credentials/builtins/index.js.map +1 -1
  75. package/dist/credentials/builtins/reddit-oauth.d.ts +4 -0
  76. package/dist/credentials/builtins/reddit-oauth.d.ts.map +1 -0
  77. package/dist/credentials/builtins/reddit-oauth.js +71 -0
  78. package/dist/credentials/builtins/reddit-oauth.js.map +1 -0
  79. package/dist/docker/local-runtime.d.ts +1 -0
  80. package/dist/docker/local-runtime.d.ts.map +1 -1
  81. package/dist/docker/local-runtime.js +9 -6
  82. package/dist/docker/local-runtime.js.map +1 -1
  83. package/dist/gateway/index.d.ts.map +1 -1
  84. package/dist/gateway/index.js +5 -4
  85. package/dist/gateway/index.js.map +1 -1
  86. package/dist/gateway/routes/logs.d.ts.map +1 -1
  87. package/dist/gateway/routes/logs.js +29 -111
  88. package/dist/gateway/routes/logs.js.map +1 -1
  89. package/dist/remote/bootstrap.d.ts +2 -0
  90. package/dist/remote/bootstrap.d.ts.map +1 -1
  91. package/dist/remote/bootstrap.js +7 -11
  92. package/dist/remote/bootstrap.js.map +1 -1
  93. package/dist/remote/push.d.ts +6 -0
  94. package/dist/remote/push.d.ts.map +1 -1
  95. package/dist/remote/push.js +172 -91
  96. package/dist/remote/push.js.map +1 -1
  97. package/dist/remote/ssh.d.ts +1 -0
  98. package/dist/remote/ssh.d.ts.map +1 -1
  99. package/dist/remote/ssh.js +8 -0
  100. package/dist/remote/ssh.js.map +1 -1
  101. package/dist/scheduler/index.d.ts.map +1 -1
  102. package/dist/scheduler/index.js +56 -7
  103. package/dist/scheduler/index.js.map +1 -1
  104. package/dist/scheduler/watcher.d.ts +1 -1
  105. package/dist/scheduler/watcher.d.ts.map +1 -1
  106. package/dist/scheduler/watcher.js +5 -6
  107. package/dist/scheduler/watcher.js.map +1 -1
  108. package/dist/setup/scaffold.js +2 -2
  109. package/dist/setup/scaffold.js.map +1 -1
  110. package/dist/shared/config.d.ts +1 -0
  111. package/dist/shared/config.d.ts.map +1 -1
  112. package/dist/shared/config.js.map +1 -1
  113. package/dist/shared/credentials.d.ts +8 -18
  114. package/dist/shared/credentials.d.ts.map +1 -1
  115. package/dist/shared/credentials.js +8 -62
  116. package/dist/shared/credentials.js.map +1 -1
  117. package/dist/shared/server.d.ts +2 -0
  118. package/dist/shared/server.d.ts.map +1 -1
  119. package/dist/shared/server.js.map +1 -1
  120. package/dist/tui/App.d.ts.map +1 -1
  121. package/dist/tui/App.js +1 -1
  122. package/dist/tui/App.js.map +1 -1
  123. package/dist/webhooks/definitions/github.d.ts.map +1 -1
  124. package/dist/webhooks/definitions/github.js +13 -0
  125. package/dist/webhooks/definitions/github.js.map +1 -1
  126. package/dist/webhooks/providers/github.d.ts.map +1 -1
  127. package/dist/webhooks/providers/github.js +6 -0
  128. package/dist/webhooks/providers/github.js.map +1 -1
  129. package/dist/webhooks/registry.d.ts.map +1 -1
  130. package/dist/webhooks/registry.js +9 -3
  131. package/dist/webhooks/registry.js.map +1 -1
  132. package/dist/webhooks/types.d.ts +3 -1
  133. package/dist/webhooks/types.d.ts.map +1 -1
  134. package/docker/bin/_http-exit +17 -0
  135. package/docker/bin/al-call +10 -4
  136. package/docker/bin/al-check +9 -3
  137. package/docker/bin/al-status +1 -1
  138. package/docker/bin/al-wait +11 -3
  139. package/docker/bin/rlock +9 -2
  140. package/docker/bin/rlock-heartbeat +9 -2
  141. package/docker/bin/runlock +9 -2
  142. package/package.json +2 -2
  143. package/docs/agent-config-reference.md +0 -313
  144. package/docs/agents.md +0 -256
  145. package/docs/cloud-run.md +0 -173
  146. package/docs/cloud.md +0 -98
  147. package/docs/commands.md +0 -286
  148. package/docs/config-reference.md +0 -241
  149. package/docs/creating-agents.md +0 -147
  150. package/docs/credentials.md +0 -167
  151. package/docs/docker.md +0 -323
  152. package/docs/ecs.md +0 -795
  153. package/docs/examples/dev/ACTIONS.md +0 -75
  154. package/docs/examples/dev/README.md +0 -28
  155. package/docs/examples/dev/agent-config.toml +0 -18
  156. package/docs/examples/devops/ACTIONS.md +0 -33
  157. package/docs/examples/devops/README.md +0 -23
  158. package/docs/examples/devops/agent-config.toml +0 -13
  159. package/docs/examples/index.md +0 -15
  160. package/docs/examples/reviewer/ACTIONS.md +0 -37
  161. package/docs/examples/reviewer/README.md +0 -22
  162. package/docs/examples/reviewer/agent-config.toml +0 -11
  163. package/docs/models.md +0 -191
  164. package/docs/vps-deployment.md +0 -285
  165. package/docs/web-dashboard.md +0 -113
  166. package/docs/webhooks.md +0 -152
  167. /package/{docs/agent-reference → agent-docs}/skills/credentials.md +0 -0
  168. /package/{docs/agent-reference → agent-docs}/skills/environment.md +0 -0
@@ -1,241 +0,0 @@
1
- # config.toml Reference
2
-
3
- The project-level `config.toml` lives at the root of your Action Llama project. All sections and fields are optional — sensible defaults are used for anything you omit. If the file doesn't exist at all, an empty config is assumed.
4
-
5
- ## Full Annotated Example
6
-
7
- ```toml
8
- # Default model for all agents (agents can override in their own agent-config.toml)
9
- [model]
10
- provider = "anthropic"
11
- model = "claude-sonnet-4-20250514"
12
- thinkingLevel = "medium"
13
- authType = "api_key"
14
-
15
- # Local Docker container settings
16
- [local]
17
- image = "al-agent:latest" # Base image name (default: "al-agent:latest")
18
- memory = "4g" # Memory limit per container (default: "4g")
19
- cpus = 2 # CPU limit per container (default: 2)
20
- timeout = 900 # Default max container runtime in seconds (default: 900, overridable per-agent)
21
-
22
- # Cloud provider config (optional — only needed for `al start -c`)
23
- [cloud]
24
- provider = "cloud-run" # "cloud-run", "ecs", or "vps"
25
- # ... provider-specific fields (see below)
26
-
27
- # Gateway HTTP server settings
28
- [gateway]
29
- port = 8080 # Gateway port (default: 8080)
30
- lockTimeout = 1800 # Lock TTL in seconds (default: 1800 / 30 minutes)
31
-
32
- # Webhook sources — named webhook endpoints with provider type and credential
33
- [webhooks.my-github]
34
- type = "github"
35
- credential = "MyOrg" # credential instance for HMAC validation
36
-
37
- # Scheduler settings
38
- maxReruns = 10 # Max consecutive reruns for successful agent runs (default: 10)
39
- maxCallDepth = 3 # Max depth for agent-to-agent call chains (default: 3)
40
- workQueueSize = 100 # Max queued work items (webhooks + calls) per agent (default: 100)
41
- ```
42
-
43
- ## Field Reference
44
-
45
- ### Top-level fields
46
-
47
- | Field | Type | Default | Description |
48
- |-------|------|---------|-------------|
49
- | `maxReruns` | number | `10` | Maximum consecutive reruns when an agent requests a rerun via `al-rerun` before stopping |
50
- | `maxCallDepth` | number | `3` | Maximum depth for agent-to-agent call chains (A calls B calls C = depth 2) |
51
- | `workQueueSize` | number | `100` | Maximum queued work items (webhook events + agent calls) per agent when all runners are busy |
52
-
53
- ### `[model]` — Default LLM
54
-
55
- Default model configuration inherited by all agents that don't define their own `[model]` section in `agent-config.toml`.
56
-
57
- | Field | Type | Required | Description |
58
- |-------|------|----------|-------------|
59
- | `provider` | string | Yes | LLM provider: `"anthropic"`, `"openai"`, `"groq"`, `"google"`, `"xai"`, `"mistral"`, `"openrouter"`, or `"custom"` |
60
- | `model` | string | Yes | Model ID (e.g. `"claude-sonnet-4-20250514"`, `"gpt-4o"`, `"gemini-2.0-flash-exp"`) |
61
- | `authType` | string | Yes | Auth method: `"api_key"`, `"oauth_token"`, or `"pi_auth"` |
62
- | `thinkingLevel` | string | No | Thinking budget: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`. Only applies to Anthropic models with reasoning support. Ignored for other providers. |
63
-
64
- See [Models](models.md) for all supported providers, model IDs, auth types, and thinking levels.
65
-
66
- ### `[local]` — Docker Container Settings
67
-
68
- Controls local Docker container isolation. These settings also apply as resource limits for Cloud Run jobs and ECS Fargate tasks.
69
-
70
- | Field | Type | Default | Description |
71
- |-------|------|---------|-------------|
72
- | `image` | string | `"al-agent:latest"` | Base Docker image name |
73
- | `memory` | string | `"4g"` | Memory limit per container (e.g. `"4g"`, `"8g"`, `"4096"` for ECS in MiB) |
74
- | `cpus` | number | `2` | CPU limit per container |
75
- | `timeout` | number | `900` | Default max container runtime in seconds. Individual agents can override this with `timeout` in their `agent-config.toml`. On AWS ECS, agents with effective timeout <= 900s automatically route to Lambda for faster cold starts. See [agent timeout docs](agent-config-reference.md#timeout). |
76
-
77
- ### `[cloud]` — Cloud Provider
78
-
79
- Only needed when running agents on cloud infrastructure with `al start -c`. Configure using `al setup cloud` (interactive wizard) or manually.
80
-
81
- | Field | Type | Required | Description |
82
- |-------|------|----------|-------------|
83
- | `provider` | string | Yes | `"cloud-run"` (GCP), `"ecs"` (AWS), or `"vps"` (SSH + Docker) |
84
-
85
- #### Cloud Run fields (`provider = "cloud-run"`)
86
-
87
- | Field | Type | Required | Default | Description |
88
- |-------|------|----------|---------|-------------|
89
- | `gcpProject` | string | Yes | — | GCP project ID |
90
- | `region` | string | Yes | — | Cloud Run region (e.g. `"us-central1"`) |
91
- | `artifactRegistry` | string | Yes | — | Full Artifact Registry repo path (e.g. `"us-central1-docker.pkg.dev/my-project/al-images"`) |
92
- | `serviceAccount` | string | No | — | Runtime service account for job creation. Per-agent SAs are used for execution. |
93
- | `secretPrefix` | string | No | `"action-llama"` | Google Secret Manager name prefix |
94
-
95
- See [Cloud Run docs](cloud-run.md) for full setup.
96
-
97
- #### ECS Fargate fields (`provider = "ecs"`)
98
-
99
- | Field | Type | Required | Default | Description |
100
- |-------|------|----------|---------|-------------|
101
- | `awsRegion` | string | Yes | — | AWS region (e.g. `"us-east-1"`) |
102
- | `ecsCluster` | string | Yes | — | ECS cluster name or ARN |
103
- | `ecrRepository` | string | Yes | — | Full ECR repository URI (e.g. `"123456789012.dkr.ecr.us-east-1.amazonaws.com/al-images"`) |
104
- | `executionRoleArn` | string | Yes | — | IAM role ARN for task execution (ECR pull + CloudWatch Logs) |
105
- | `taskRoleArn` | string | Yes | — | Default IAM task role ARN (Secrets Manager access) |
106
- | `subnets` | string[] | Yes | — | VPC subnet IDs for Fargate tasks |
107
- | `securityGroups` | string[] | No | — | Security group IDs for Fargate tasks |
108
- | `awsSecretPrefix` | string | No | `"action-llama"` | AWS Secrets Manager name prefix |
109
- | `buildBucket` | string | No | auto-created | S3 bucket for CodeBuild source uploads |
110
- | `lambdaRoleArn` | string | No | auto-derived | Lambda execution role ARN. If omitted, per-agent roles (`al-{agentName}-lambda-role`) are derived automatically. |
111
- | `lambdaSubnets` | string[] | No | — | VPC subnet IDs for Lambda functions (only needed if Lambda must access VPC resources) |
112
- | `lambdaSecurityGroups` | string[] | No | — | Security group IDs for Lambda functions (only needed with `lambdaSubnets`) |
113
-
114
- See [ECS docs](ecs.md) for full setup.
115
-
116
- #### VPS fields (`provider = "vps"`)
117
-
118
- | Field | Type | Required | Default | Description |
119
- |-------|------|----------|---------|-------------|
120
- | `host` | string | Yes | — | Server IP address or hostname |
121
- | `sshUser` | string | No | `"root"` | SSH username |
122
- | `sshPort` | number | No | `22` | SSH port |
123
- | `sshKeyPath` | string | No | `"~/.ssh/id_rsa"` | Path to SSH private key |
124
- | `vultrInstanceId` | string | No | — | Vultr instance ID (set automatically if provisioned via `al setup cloud`) |
125
- | `vultrRegion` | string | No | — | Vultr region (set automatically if provisioned via `al setup cloud`) |
126
-
127
- See [VPS docs](vps-deployment.md) for full setup.
128
-
129
- ### `[gateway]` — HTTP Server
130
-
131
- The gateway starts automatically when Docker mode or webhooks are enabled. It handles health checks, webhook reception, credential serving (local Docker only), resource locking, and the shutdown kill switch.
132
-
133
- | Field | Type | Default | Description |
134
- |-------|------|---------|-------------|
135
- | `port` | number | `8080` | Port for the gateway HTTP server |
136
- | `lockTimeout` | number | `1800` | Default lock TTL in seconds. Locks expire automatically after this duration unless refreshed via heartbeat. |
137
-
138
- ### `[webhooks.*]` — Webhook Sources
139
-
140
- Named webhook sources that agents can reference in their `[[webhooks]]` triggers. Each source defines a provider type and an optional credential for signature validation.
141
-
142
- | Field | Type | Required | Description |
143
- |-------|------|----------|-------------|
144
- | `type` | string | Yes | Provider type: `"github"` or `"sentry"` |
145
- | `credential` | string | No | Credential instance name for HMAC signature validation (e.g. `"MyOrg"` maps to `github_webhook_secret:MyOrg`). Omit for unsigned webhooks. |
146
-
147
- ```toml
148
- [webhooks.my-github]
149
- type = "github"
150
- credential = "MyOrg" # uses github_webhook_secret:MyOrg for HMAC validation
151
-
152
- [webhooks.my-sentry]
153
- type = "sentry"
154
- credential = "SentryProd" # uses sentry_client_secret:SentryProd
155
-
156
- [webhooks.unsigned-github]
157
- type = "github" # no credential — accepts unsigned webhooks
158
- ```
159
-
160
- Agents reference these sources by name in their `agent-config.toml`:
161
-
162
- ```toml
163
- [[webhooks]]
164
- source = "my-github"
165
- events = ["issues"]
166
- ```
167
-
168
- ## Minimal Examples
169
-
170
- ### Anthropic with Docker (typical dev setup)
171
-
172
- ```toml
173
- [model]
174
- provider = "anthropic"
175
- model = "claude-sonnet-4-20250514"
176
- thinkingLevel = "medium"
177
- authType = "api_key"
178
- ```
179
-
180
- Everything else uses defaults: Docker enabled, 4GB memory, 2 CPUs, 15min timeout, gateway on port 8080.
181
-
182
- ### Cloud Run production
183
-
184
- ```toml
185
- [model]
186
- provider = "anthropic"
187
- model = "claude-sonnet-4-20250514"
188
- thinkingLevel = "medium"
189
- authType = "api_key"
190
-
191
- [local]
192
- memory = "8g"
193
- cpus = 4
194
- timeout = 7200
195
-
196
- [cloud]
197
- provider = "cloud-run"
198
- gcpProject = "my-gcp-project"
199
- region = "us-central1"
200
- artifactRegistry = "us-central1-docker.pkg.dev/my-gcp-project/al-images"
201
-
202
- [gateway]
203
- port = 3000
204
- ```
205
-
206
- ### ECS Fargate production
207
-
208
- ```toml
209
- [model]
210
- provider = "anthropic"
211
- model = "claude-sonnet-4-20250514"
212
- thinkingLevel = "medium"
213
- authType = "api_key"
214
-
215
- [cloud]
216
- provider = "ecs"
217
- awsRegion = "us-east-1"
218
- ecsCluster = "al-cluster"
219
- ecrRepository = "123456789012.dkr.ecr.us-east-1.amazonaws.com/al-images"
220
- executionRoleArn = "arn:aws:iam::123456789012:role/ecsTaskExecutionRole"
221
- taskRoleArn = "arn:aws:iam::123456789012:role/al-default-task-role"
222
- subnets = ["subnet-abc123"]
223
-
224
- maxReruns = 5
225
- maxCallDepth = 2
226
- ```
227
-
228
- ### VPS production
229
-
230
- ```toml
231
- [model]
232
- provider = "anthropic"
233
- model = "claude-sonnet-4-20250514"
234
- thinkingLevel = "medium"
235
- authType = "api_key"
236
-
237
- [cloud]
238
- provider = "vps"
239
- host = "5.6.7.8"
240
- sshUser = "root"
241
- ```
@@ -1,147 +0,0 @@
1
- # Creating Agents
2
-
3
- This guide walks you through creating an Action Llama agent from scratch.
4
-
5
- ## Prerequisites
6
-
7
- - An Action Llama project (created with `al new <name>`)
8
- - Credentials configured in `~/.action-llama/credentials/` (see [Credentials](credentials.md))
9
-
10
- ## Steps
11
-
12
- ### 1. Create the agent directory
13
-
14
- Inside your project directory, create a folder for your agent under the `agents/` directory:
15
-
16
- ```bash
17
- mkdir -p agents/my-agent
18
- ```
19
-
20
- ### 2. Write `agent-config.toml`
21
-
22
- Create `agents/my-agent/agent-config.toml`:
23
-
24
- ```toml
25
- credentials = ["github_token", "git_ssh"]
26
- schedule = "*/5 * * * *"
27
-
28
- [params]
29
- repos = ["your-org/your-repo"]
30
-
31
- [model]
32
- provider = "anthropic"
33
- model = "claude-sonnet-4-20250514"
34
- thinkingLevel = "medium"
35
- authType = "api_key"
36
- ```
37
-
38
- Supported providers: `anthropic`, `openai`, `groq`, `google`, `xai`, `mistral`, `openrouter`, `custom`. See [agent-config.toml Reference](agent-config-reference.md) for all available fields and provider examples.
39
-
40
- ### 3. Write `ACTIONS.md`
41
-
42
- Create `agents/my-agent/ACTIONS.md` — this is the system prompt that defines your agent's behavior:
43
-
44
- ```markdown
45
- # My Agent
46
-
47
- You are an automation agent. Your job is to ...
48
-
49
- Your configuration is in the `<agent-config>` block at the start of your prompt.
50
-
51
- `GITHUB_TOKEN` is already set in your environment. Use `gh` CLI and `git` directly.
52
-
53
- ## Workflow
54
-
55
- 1. **Step one** — ...
56
- 2. **Step two** — ...
57
-
58
- ## Rules
59
-
60
- - ...
61
- ```
62
-
63
- The ACTIONS.md is injected as the agent's system prompt at runtime. Write it as instructions to the LLM.
64
-
65
- ### 4. (Optional) Add preflight steps
66
-
67
- If your agent needs external context (repo contents, API data, issue lists), add `[[preflight]]` steps to `agent-config.toml`. Preflight runs after credentials are loaded but before the LLM session starts, so the agent begins with everything it needs:
68
-
69
- ```toml
70
- [[preflight]]
71
- provider = "git-clone"
72
- [preflight.params]
73
- repo = "your-org/your-repo"
74
- dest = "/tmp/repo"
75
- depth = 1
76
-
77
- [[preflight]]
78
- provider = "shell"
79
- [preflight.params]
80
- command = "gh issue list --repo your-org/your-repo --label bug --json number,title --limit 20"
81
- output = "/tmp/context/issues.json"
82
- ```
83
-
84
- Then reference the staged files in your ACTIONS.md:
85
-
86
- ```markdown
87
- ## Context
88
- - The repo is cloned at `/tmp/repo`
89
- - Open bug issues are at `/tmp/context/issues.json`
90
- ```
91
-
92
- See [Preflight](agent-config-reference.md#preflight) for the full reference.
93
-
94
- ### 5. Verify with `al stat`
95
-
96
- ```bash
97
- al stat -p .
98
- ```
99
-
100
- This should show your agent with its schedule and credentials.
101
-
102
- ### 6. Run with `al start`
103
-
104
- ```bash
105
- al start -p .
106
- ```
107
-
108
- Your agent will run on its configured schedule and/or respond to webhooks.
109
-
110
- ### 7. (Optional) Customize the project Dockerfile
111
-
112
- Every project has a `Dockerfile` at the root (created by `al new`) that defines the shared base image for all agents. If your agents need extra system packages, edit it:
113
-
114
- ```dockerfile
115
- FROM al-agent:latest
116
-
117
- # Shared tools for all agents
118
- RUN apk add --no-cache github-cli python3
119
- ```
120
-
121
- If only one specific agent needs extra tools, add a `Dockerfile` to that agent's directory instead:
122
-
123
- ```dockerfile
124
- FROM al-agent:latest
125
- USER root
126
- RUN apk add --no-cache github-cli
127
- USER node
128
- ```
129
-
130
- See [Docker docs](docker.md) for the full reference.
131
-
132
- ### 8. (Cloud only) Re-run `al doctor -c`
133
-
134
- If you're running agents on cloud infrastructure, re-run `al doctor -c` after adding a new agent. This creates the per-agent IAM resources (service account for Cloud Run, task role for ECS) and grants the new agent access to its declared secrets.
135
-
136
- ```bash
137
- al doctor -c -p .
138
- ```
139
-
140
- Without this step, the new agent will fail to access its credentials at runtime.
141
-
142
- ## Tips
143
-
144
- - Agent name is derived from the directory name — no need to put it in the config
145
- - Use `al-rerun` in your ACTIONS.md to tell the agent to run `al-rerun` when it did work and there may be more in the backlog
146
- - Params in the config are injected into the agent prompt as an `<agent-config>` XML block
147
- - See [Examples](examples/index.md) for complete working agents
@@ -1,167 +0,0 @@
1
- # Credentials
2
-
3
- Credentials are stored in `~/.action-llama/credentials/<type>/<instance>/<field>`. Each credential type is a directory containing one file per field. Reference them in `agent-config.toml` by type name (e.g. `"github_token"`). The instance is resolved automatically: agent-specific (`<agentName>`) first, then `default` as fallback.
4
-
5
- ## Built-in Credentials
6
-
7
- | Type | Fields | Description | Runtime Injection |
8
- |------|--------|-------------|-------------------|
9
- | `github_token` | `token` | GitHub PAT with repo and workflow scopes | `GITHUB_TOKEN` and `GH_TOKEN` env vars |
10
- | `anthropic_key` | `token` | Anthropic API key, OAuth token, or pi auth | _(read by SDK)_ |
11
- | `openai_key` | `token` | OpenAI API key | _(read by SDK)_ |
12
- | `groq_key` | `token` | Groq API key | _(read by SDK)_ |
13
- | `google_key` | `token` | Google Gemini API key | _(read by SDK)_ |
14
- | `xai_key` | `token` | xAI API key | _(read by SDK)_ |
15
- | `mistral_key` | `token` | Mistral API key | _(read by SDK)_ |
16
- | `openrouter_key` | `token` | OpenRouter API key | _(read by SDK)_ |
17
- | `custom_key` | `token` | Custom provider API key | _(read by SDK)_ |
18
- | `sentry_token` | `token` | Sentry auth token for error monitoring | `SENTRY_AUTH_TOKEN` env var |
19
- | `linear_token` | `token` | Linear personal API token for workspace access | `LINEAR_API_TOKEN` env var |
20
- | `linear_oauth` | `client_id`, `client_secret`, `access_token`, `refresh_token` | Linear OAuth2 credentials for workspace access | `LINEAR_CLIENT_ID`, `LINEAR_CLIENT_SECRET`, `LINEAR_ACCESS_TOKEN`, `LINEAR_REFRESH_TOKEN` env vars |
21
- | `bugsnag_token` | `token` | Bugsnag auth token for error monitoring and release management | `BUGSNAG_AUTH_TOKEN` env var |
22
- | `netlify_token` | `token` | Netlify Personal Access Token for site management | `NETLIFY_AUTH_TOKEN` env var |
23
- | `git_ssh` | `id_rsa`, `username`, `email` | SSH private key + git author identity | SSH key mounted as file; `GIT_AUTHOR_NAME`/`GIT_AUTHOR_EMAIL`/`GIT_COMMITTER_NAME`/`GIT_COMMITTER_EMAIL` set from `username`/`email` |
24
- | `gateway_api_key` | `key` | API key for dashboard and CLI access to the gateway | _(used by gateway + CLI)_ |
25
- | `github_webhook_secret` | `secret` | Shared secret for GitHub webhook verification | _(used by gateway)_ |
26
- | `sentry_client_secret` | `secret` | Client secret for Sentry webhook verification | _(used by gateway)_ |
27
- | `linear_webhook_secret` | `secret` | Shared secret for Linear webhook verification | _(used by gateway)_ |
28
- | `x_twitter_api` | `api_key`, `api_secret`, `bearer_token`, `access_token`, `access_token_secret` | X (Twitter) API credentials for platform access | `X_API_KEY`, `X_API_SECRET`, `X_BEARER_TOKEN`, `X_ACCESS_TOKEN`, `X_ACCESS_TOKEN_SECRET` env vars |
29
- | `aws` | `access_key_id`, `secret_access_key`, `default_region` | AWS credentials for managing AWS resources | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION` env vars |
30
- | `vultr_api_key` | `api_key` | Vultr API key for VPS provisioning (not needed at agent runtime) | `VULTR_API_KEY` env var |
31
-
32
- ## How Credentials Work
33
-
34
- 1. **Configuration**: List credential types in your agent's `agent-config.toml`:
35
- ```toml
36
- credentials = ["github_token", "git_ssh"]
37
- ```
38
-
39
- 2. **Storage**: Credential values live in `~/.action-llama/credentials/<type>/<instance>/<field>`. Each field is a plain text file.
40
-
41
- 3. **Injection**: When an agent runs, the credentials it requires are injected into the container.
42
-
43
- 4. **Git identity**: The `git_ssh` credential includes `username` and `email` fields (prompted during `al new`/`al doctor`). 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`.
44
-
45
- ## Named Instances
46
-
47
- Each credential type supports named instances. For example, you could have webhook secrets for multiple GitHub orgs:
48
-
49
- ```
50
- ~/.action-llama/credentials/github_webhook_secret/MyOrg/secret
51
- ~/.action-llama/credentials/github_webhook_secret/OtherOrg/secret
52
- ```
53
-
54
- Or multiple SSH keys:
55
-
56
- ```
57
- ~/.action-llama/credentials/git_ssh/default/id_rsa
58
- ~/.action-llama/credentials/git_ssh/default/username
59
- ~/.action-llama/credentials/git_ssh/botty/id_rsa
60
- ~/.action-llama/credentials/git_ssh/botty/username
61
- ```
62
-
63
- By default, just reference `"git_ssh"` — the instance is resolved automatically (agent-specific first, then `default`). To explicitly reference another agent's credential, use the cross-agent syntax: `"botty/git_ssh"`.
64
-
65
- ## Managing Credentials
66
-
67
- ### `al creds add`
68
-
69
- Add or update a credential interactively. Runs validation for the credential type (e.g. API key format, GitHub API check):
70
-
71
- ```bash
72
- al creds add github_token # adds github_token:default
73
- al creds add github_webhook_secret:myapp
74
- al creds add git_ssh:prod
75
- ```
76
-
77
- ### `al creds rm`
78
-
79
- Remove a credential:
80
-
81
- ```bash
82
- al creds rm github_token # removes github_token:default
83
- al creds rm github_webhook_secret:myapp
84
- ```
85
-
86
- ### `al creds ls`
87
-
88
- List all stored credentials grouped by type:
89
-
90
- ```bash
91
- al creds ls
92
- ```
93
-
94
- ### `al doctor`
95
-
96
- Scan all agents in a project and prompt for any missing credentials:
97
-
98
- ```bash
99
- al doctor -p .
100
- ```
101
-
102
- ### During `al new`
103
-
104
- The `al new` command prompts for the Anthropic credential during initial setup. Other credentials are configured per-agent by `al doctor` or `al creds add`.
105
-
106
- ### Manually
107
-
108
- Write credential files directly:
109
-
110
- ```bash
111
- mkdir -p ~/.action-llama/credentials/github_token/default
112
- echo "ghp_your_token_here" > ~/.action-llama/credentials/github_token/default/token
113
-
114
- mkdir -p ~/.action-llama/credentials/anthropic_key/default
115
- echo "sk-ant-api-your_key_here" > ~/.action-llama/credentials/anthropic_key/default/token
116
-
117
- mkdir -p ~/.action-llama/credentials/openai_key/default
118
- echo "sk-your_openai_key_here" > ~/.action-llama/credentials/openai_key/default/token
119
-
120
- mkdir -p ~/.action-llama/credentials/groq_key/default
121
- echo "gsk_your_groq_key_here" > ~/.action-llama/credentials/groq_key/default/token
122
-
123
- mkdir -p ~/.action-llama/credentials/bugsnag_token/default
124
- echo "your_bugsnag_token_here" > ~/.action-llama/credentials/bugsnag_token/default/token
125
-
126
- mkdir -p ~/.action-llama/credentials/netlify_token/default
127
- echo "your_netlify_token_here" > ~/.action-llama/credentials/netlify_token/default/token
128
- ```
129
-
130
- ### Anthropic Auth Methods
131
-
132
- Three auth methods are supported:
133
-
134
- - **`api_key`** — Standard API key (`sk-ant-api-...`). Set `authType = "api_key"` in model config.
135
- - **`oauth_token`** — OAuth token (`sk-ant-oat-...`). Set `authType = "oauth_token"`.
136
- - **`pi_auth`** — Use existing pi auth credentials (`~/.pi/agent/auth.json`). Set `authType = "pi_auth"`. No credential file needed.
137
-
138
- ## Webhook Secrets
139
-
140
- Webhook secrets use named credential instances. For example, to set up a GitHub webhook secret for your org:
141
-
142
- ```bash
143
- mkdir -p ~/.action-llama/credentials/github_webhook_secret/MyOrg
144
- echo "your-webhook-secret" > ~/.action-llama/credentials/github_webhook_secret/MyOrg/secret
145
- ```
146
-
147
- The gateway automatically loads secrets from all credential instances (e.g. `github_webhook_secret:MyOrg`, `sentry_client_secret:MyOrg`) and uses them to verify incoming webhook payloads. No global configuration is needed.
148
-
149
- ## Cloud Credential Sync
150
-
151
- When using cloud runtimes, credentials are automatically pushed to the cloud secret manager by `al doctor -c` or `al setup cloud`. See [Cloud Run docs](cloud-run.md) and [ECS docs](ecs.md) for details.
152
-
153
- ### Google Secret Manager (GSM)
154
-
155
- Secret naming: `{prefix}--{type}--{instance}--{field}` (dashes, since GSM disallows slashes).
156
-
157
- ### AWS Secrets Manager (ASM)
158
-
159
- Secret naming: `{prefix}/{type}/{instance}/{field}` (slashes).
160
-
161
- Requires `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` env vars or a configured AWS CLI (`aws configure`).
162
-
163
- ### VPS Filesystem (SSH)
164
-
165
- Secret naming: `~/.action-llama/credentials/{type}/{instance}/{field}` on the remote server (same layout as local).
166
-
167
- Credentials are transferred via SSH. No external secrets manager needed — same trust model as SSH access.