@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
package/docs/cloud-run.md DELETED
@@ -1,173 +0,0 @@
1
- # Cloud Run Mode
2
-
3
- Run agents as Cloud Run Jobs on GCP instead of local Docker containers. Agents get the same isolation guarantees with the added benefits of serverless scaling, managed infrastructure, and per-agent secret isolation via IAM.
4
-
5
- ## Prerequisites
6
-
7
- - GCP project with Cloud Run, Secret Manager, Artifact Registry, and Cloud Build APIs enabled
8
- - `gcloud` CLI authenticated (`gcloud auth login`)
9
-
10
- Local Docker is **not required** — images are built using Cloud Build.
11
-
12
- ## Configuration
13
-
14
- In your project's `config.toml`:
15
-
16
- ```toml
17
- [cloud]
18
- provider = "cloud-run"
19
- gcpProject = "my-gcp-project"
20
- region = "us-central1"
21
- artifactRegistry = "us-central1-docker.pkg.dev/my-gcp-project/al-images"
22
- serviceAccount = "al-runner@my-gcp-project.iam.gserviceaccount.com"
23
- # secretPrefix = "action-llama" # optional, default: "action-llama"
24
- ```
25
-
26
- | Key | Required | Description |
27
- |-----|----------|-------------|
28
- | `cloud.provider` | Yes | Set to `"cloud-run"` |
29
- | `cloud.gcpProject` | Yes | GCP project ID |
30
- | `cloud.region` | Yes | Cloud Run region (e.g. `us-central1`) |
31
- | `cloud.artifactRegistry` | Yes | Full Artifact Registry repo path |
32
- | `cloud.serviceAccount` | No | Runtime SA (for job creation). Per-agent SAs are used for job execution. |
33
- | `cloud.secretPrefix` | No | GSM secret name prefix (default: `"action-llama"`) |
34
-
35
- Local Docker settings (`[local]`) control resource limits:
36
-
37
- | Key | Default | Description |
38
- |-----|---------|-------------|
39
- | `local.memory` | `"4Gi"` | Memory per job |
40
- | `local.cpus` | `2` | CPUs per job |
41
- | `local.timeout` | `3600` | Max execution time in seconds |
42
-
43
- ## Quick Setup
44
-
45
- The fastest way to get started:
46
-
47
- ```bash
48
- al setup cloud -p .
49
- ```
50
-
51
- This interactive wizard prompts for all required fields, writes the `[cloud]` config, pushes credentials, and provisions IAM in one step.
52
-
53
- ## Manual Setup
54
-
55
- ### 1. Enable GCP APIs
56
-
57
- ```bash
58
- gcloud services enable \
59
- run.googleapis.com \
60
- secretmanager.googleapis.com \
61
- artifactregistry.googleapis.com \
62
- --project my-gcp-project
63
- ```
64
-
65
- ### 2. Create an Artifact Registry repository
66
-
67
- ```bash
68
- gcloud artifacts repositories create al-images \
69
- --repository-format=docker \
70
- --location=us-central1 \
71
- --project my-gcp-project
72
- ```
73
-
74
- ### 3. Configure Docker for Artifact Registry
75
-
76
- ```bash
77
- gcloud auth configure-docker us-central1-docker.pkg.dev
78
- ```
79
-
80
- ### 4. Push credentials and create per-agent service accounts
81
-
82
- ```bash
83
- al doctor -c -p .
84
- ```
85
-
86
- This pushes all local credentials to Google Secret Manager, then creates a service account for each agent (`al-{agentName}@{project}.iam.gserviceaccount.com`) and grants it `secretmanager.secretAccessor` on only the secrets that agent needs.
87
-
88
- > **Re-run after adding agents:** Whenever you add a new agent to your project, re-run `al doctor -c` to create the service account for the new agent. Without this, the new agent will fail to access its credentials at runtime.
89
-
90
- ### 5. Start
91
-
92
- ```bash
93
- al start -c -p .
94
- ```
95
-
96
- The scheduler will:
97
- 1. Build agent images locally
98
- 2. Push them to Artifact Registry
99
- 3. Create/update Cloud Run jobs with GSM secret volume mounts
100
- 4. Execute jobs on schedule or webhook trigger
101
- 5. Stream logs from Cloud Logging
102
-
103
- ## Cloud Build
104
-
105
- When running in Cloud Run mode, images are built using [Cloud Build](https://cloud.google.com/build) instead of local Docker. This means you don't need Docker installed on your machine or CI server — Cloud Build handles building and pushing to Artifact Registry in one step.
106
-
107
- Enable the Cloud Build API:
108
-
109
- ```bash
110
- gcloud services enable cloudbuild.googleapis.com --project my-gcp-project
111
- ```
112
-
113
- The scheduler automatically uses `gcloud builds submit` when the cloud provider is `cloud-run`. No additional configuration is needed.
114
-
115
- ## How it works
116
-
117
- ### Image lifecycle
118
-
119
- Images are built using Cloud Build and pushed to Artifact Registry. Each agent gets its own image tag (`al-{agentName}:latest`). The build happens on every `al start -c` to ensure the latest code is deployed. Cloud Build handles caching automatically.
120
-
121
- ### Secret mounting
122
-
123
- Cloud Run mounts secrets from Google Secret Manager as files at `/credentials/<type>/<instance>/<field>` — the same layout as local Docker mode. The container entry point reads credentials from this path identically in both modes.
124
-
125
- Secret names follow the convention: `{prefix}--{type}--{instance}--{field}` (e.g. `action-llama--github_token--default--token`).
126
-
127
- ### Per-agent service accounts
128
-
129
- Each agent runs as its own GCP service account:
130
-
131
- ```
132
- al-dev@my-project.iam.gserviceaccount.com → github_token, git_ssh, anthropic_key
133
- al-reviewer@my-project.iam.gserviceaccount.com → github_token, git_ssh, anthropic_key
134
- al-devops@my-project.iam.gserviceaccount.com → github_token, sentry_token, anthropic_key
135
- ```
136
-
137
- Each SA only has `secretmanager.secretAccessor` on its declared secrets. Even if an agent container is compromised and accesses the GCP metadata server to obtain the SA's token, it can only read its own secrets.
138
-
139
- Run `al doctor -c` to create these SAs and IAM bindings automatically.
140
-
141
- ### Gateway
142
-
143
- The gateway is **not required** for Cloud Run mode. Containers get their credentials via native GSM mounts (not the gateway's HTTP endpoint), and Cloud Run handles execution timeouts natively (no kill switch needed). The gateway still starts if you have webhooks configured, since webhooks are received by the scheduler process.
144
-
145
- ### Log streaming
146
-
147
- Logs are streamed from Cloud Logging by polling. There is a ~5-15 second ingestion delay inherent to Cloud Logging. The TUI displays a warning about this delay when running in Cloud Run mode.
148
-
149
- ## Comparison with local Docker
150
-
151
- | Aspect | Local Docker | Cloud Run |
152
- |--------|-------------|-----------|
153
- | Where containers run | Your machine | GCP |
154
- | Credential delivery | Volume mount from temp dir | GSM secret volume mount |
155
- | Secret isolation | Mount-level (same trust boundary) | IAM-enforced per-agent SAs |
156
- | Gateway needed | Yes (kill switch, cred serving) | No (optional for webhooks) |
157
- | Log latency | Real-time | ~5-15s delay |
158
- | Scaling | Limited by host resources | Serverless, managed |
159
- | Cost | Free (your hardware) | Pay per execution |
160
-
161
- ## Troubleshooting
162
-
163
- **"Cloud Run runtime requires cloud.gcpProject..."** — Ensure all required fields are set in `config.toml` under `[cloud]`.
164
-
165
- **"Failed to get GCP access token"** — Run `gcloud auth application-default login` or set `GCP_SERVICE_ACCOUNT_KEY` env var.
166
-
167
- **"Failed to push image"** — Run `gcloud auth configure-docker <region>-docker.pkg.dev` to configure Docker for Artifact Registry.
168
-
169
- **"Failed to create Cloud Run job"** — Check that Cloud Run API is enabled and the runtime SA has `run.jobs.create` permission.
170
-
171
- **Logs are delayed** — This is expected. Cloud Logging has a ~5-15 second ingestion delay. The TUI shows a warning when running in Cloud Run mode.
172
-
173
- **Agent can't access secrets** — Run `al doctor -c` to create per-agent SAs and IAM bindings. Verify with `gcloud secrets get-iam-policy <secret-name> --project <project>`.
package/docs/cloud.md DELETED
@@ -1,98 +0,0 @@
1
- # Cloud
2
-
3
- Running `al start` on your laptop works for development, but for production you want agents running 24/7 on managed infrastructure — no laptop required, automatic restarts, and IAM-enforced secret isolation so a compromised agent can only access its own credentials.
4
-
5
- Action Llama supports three cloud providers. All use the same project structure and agent configs — the only difference is the `[cloud]` section in `config.toml`.
6
-
7
- ## Quick start
8
-
9
- ```bash
10
- al setup cloud -p . # Interactive wizard: pick provider, configure, push creds, provision IAM
11
- al start -c -p . # Start on cloud
12
- ```
13
-
14
- ## Providers
15
-
16
- ### GCP (Cloud Run Jobs)
17
-
18
- Agents run as serverless Cloud Run Jobs. Images are built with Cloud Build (no local Docker needed). Credentials are stored in Google Secret Manager and mounted as files natively by Cloud Run.
19
-
20
- ```toml
21
- [cloud]
22
- provider = "cloud-run"
23
- gcpProject = "my-gcp-project"
24
- region = "us-central1"
25
- artifactRegistry = "us-central1-docker.pkg.dev/my-gcp-project/al-images"
26
- serviceAccount = "al-runner@my-gcp-project.iam.gserviceaccount.com"
27
- ```
28
-
29
- ```bash
30
- al doctor -c # Push creds + create per-agent service accounts
31
- al start -c # Start on Cloud Run
32
- ```
33
-
34
- If you add a new agent later, re-run `al doctor -c` to create its service account and IAM bindings.
35
-
36
- See [Cloud Run docs](cloud-run.md) for prerequisites, full setup walkthrough, and troubleshooting.
37
-
38
- ### AWS (ECS Fargate)
39
-
40
- Agents run as ECS Fargate tasks. Images are built locally and pushed to ECR. Credentials are stored in AWS Secrets Manager and injected as environment variables by ECS.
41
-
42
- ```toml
43
- [cloud]
44
- provider = "ecs"
45
- awsRegion = "us-east-1"
46
- ecsCluster = "al-cluster"
47
- ecrRepository = "123456789012.dkr.ecr.us-east-1.amazonaws.com/al-images"
48
- executionRoleArn = "arn:aws:iam::123456789012:role/ecsTaskExecutionRole"
49
- taskRoleArn = "arn:aws:iam::123456789012:role/al-default-task-role"
50
- subnets = ["subnet-abc123"]
51
- ```
52
-
53
- ```bash
54
- al doctor -c # Push creds + create per-agent IAM task roles
55
- al start -c # Start on ECS Fargate
56
- ```
57
-
58
- If you add a new agent later, re-run `al doctor -c` to create its task role and IAM policy.
59
-
60
- See [ECS docs](ecs.md) for prerequisites, full setup walkthrough, and troubleshooting.
61
-
62
- ### VPS (SSH + Docker)
63
-
64
- Agents run on any VPS or server you can SSH into. Images are built directly on the server via `tar | ssh docker build` — no container registry needed. Credentials are stored on the VPS filesystem over SSH.
65
-
66
- ```toml
67
- [cloud]
68
- provider = "vps"
69
- host = "your-vps-ip"
70
- ```
71
-
72
- ```bash
73
- al doctor -c # Push creds to VPS via SSH
74
- al start -c # Start on VPS
75
- ```
76
-
77
- Setup supports three paths:
78
- - **Connect to an existing server** — any provider, any server with Docker installed
79
- - **Provision a new Vultr VPS** — automated instance creation with cloud-init Docker install
80
- - **Provision a new Hetzner VPS** — automated server creation with cloud-init Docker install
81
-
82
- See [VPS docs](vps-deployment.md) for full setup.
83
-
84
- ## Provider comparison
85
-
86
- | | GCP Cloud Run | AWS ECS (Fargate + Lambda) | VPS (SSH + Docker) |
87
- |---|---|---|---|
88
- | Image builds | Cloud Build (no local Docker) | CodeBuild (no local Docker) | `tar \| ssh docker build` (on VPS) |
89
- | Credential store | Google Secret Manager | AWS Secrets Manager | Filesystem on VPS (over SSH) |
90
- | Credential delivery | File mount (native) | Env var injection | Volume mount |
91
- | Secret isolation | Per-agent service accounts | Per-agent IAM task/Lambda roles | SSH access = full access |
92
- | Setup command | `al doctor -c` | `al doctor -c` | `al doctor -c` |
93
- | Log latency | ~5-15s (Cloud Logging) | ~5-10s (CloudWatch) | Real-time (SSH) |
94
- | Cold start | ~10-30s | ~1-2s (Lambda, timeout<=900s) / ~30-60s (Fargate) | ~1-2s |
95
- | Cost | Pay-per-run | Pay-per-run | Fixed monthly ($5-24/mo) |
96
- | IAM reconciliation | Per-agent service accounts | Per-agent IAM roles | No-op |
97
-
98
- On AWS, agents with `timeout <= 900` automatically route to Lambda for faster cold starts. Agents with longer timeouts use ECS Fargate. See [ECS docs](ecs.md#per-agent-timeout-and-lambda-routing) for details.
package/docs/commands.md DELETED
@@ -1,286 +0,0 @@
1
- # CLI Commands
2
-
3
- ## `al new <name>`
4
-
5
- Creates a new Action Llama project. Runs interactive setup to configure credentials and LLM defaults.
6
-
7
- ```bash
8
- npx @action-llama/action-llama new my-project
9
- ```
10
-
11
- Creates:
12
- - `my-project/package.json` — with `@action-llama/action-llama` dependency
13
- - `my-project/.gitignore`
14
- - `my-project/.workspace/` — runtime state directory
15
- - Credential files in `~/.action-llama/credentials/`
16
-
17
- After setup, create agents by following [Creating Agents](creating-agents.md).
18
-
19
- ## `al doctor`
20
-
21
- 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 (used for dashboard and CLI authentication).
22
-
23
- Additionally validates webhook trigger field configurations to catch common errors like:
24
- - Using `repository` instead of `repos`
25
- - Misspelled field names
26
- - Invalid field types
27
-
28
- This helps catch configuration mistakes early and ensures webhook triggers are properly configured.
29
-
30
- ```bash
31
- al doctor -p .
32
- al doctor -p ./my-project
33
- al doctor -c # Also push creds to cloud + reconcile IAM
34
- ```
35
-
36
- | Option | Description |
37
- |--------|-------------|
38
- | `-p, --project <dir>` | Project directory (default: `.`) |
39
- | `-c, --cloud` | Push credentials to cloud and create per-agent IAM resources |
40
-
41
- ### `al doctor -c`
42
-
43
- In cloud mode, `al doctor` additionally:
44
- 1. Pushes all local credentials to the cloud secret manager configured in `[cloud]`
45
- 2. Creates per-agent IAM resources (service accounts for Cloud Run, task roles for ECS)
46
- 3. Grants each agent access to only its declared secrets
47
-
48
- **Cloud Run** (`cloud.provider = "cloud-run"`):
49
-
50
- For each agent, it:
51
- 1. Creates `al-{agentName}@{gcpProject}.iam.gserviceaccount.com`
52
- 2. Grants `secretmanager.secretAccessor` on that agent's declared credentials
53
- 3. Grants `iam.serviceAccountUser` for Cloud Run execution
54
-
55
- Requires `gcloud` CLI with project admin permissions. See [Cloud Run docs](cloud-run.md) for full setup.
56
-
57
- **ECS Fargate** (`cloud.provider = "ecs"`):
58
-
59
- For each agent, it:
60
- 1. Creates IAM role `al-{agentName}-task-role`
61
- 2. Attaches an inline policy granting `secretsmanager:GetSecretValue` on that agent's declared credentials
62
-
63
- Requires AWS CLI with IAM admin permissions. See [ECS docs](ecs.md) for full setup.
64
-
65
- **VPS** (`cloud.provider = "vps"`):
66
-
67
- Pushes all local credentials to the VPS filesystem over SSH. No IAM roles — SSH access implies full access. See [VPS docs](vps-deployment.md) for full setup.
68
-
69
- **Re-run after adding agents:** Whenever you add a new agent to your project, re-run `al doctor -c` to create IAM resources for the new agent (Cloud Run/ECS) or push credentials (VPS). Without this, the new agent won't have access to its credentials at runtime.
70
-
71
- ## `al creds ls`
72
-
73
- Lists all stored credentials grouped by type, showing field names but not values.
74
-
75
- ```bash
76
- al creds ls
77
- ```
78
-
79
- Example output:
80
-
81
- ```
82
- Anthropic API Key (anthropic_key)
83
- anthropic_key (token)
84
-
85
- GitHub Token (github_token)
86
- github_token (token)
87
-
88
- GitHub Webhook Secret (github_webhook_secret)
89
- github_webhook_secret:myapp (secret)
90
- github_webhook_secret:staging (secret)
91
- ```
92
-
93
- Default instances are shown without the `:default` suffix.
94
-
95
- ## `al creds add <ref>`
96
-
97
- Add or update a credential. Runs the interactive prompter with validation for the credential type.
98
-
99
- ```bash
100
- al creds add github_token # adds github_token:default
101
- al creds add github_webhook_secret:myapp
102
- al creds add git_ssh:prod
103
- ```
104
-
105
- The `<ref>` format is `type` or `type:instance`. If no instance is specified, defaults to `default`. If the credential already exists, you'll be prompted to update it.
106
-
107
- ## `al creds rm <ref>`
108
-
109
- Remove a credential from disk.
110
-
111
- ```bash
112
- al creds rm github_token # removes github_token:default
113
- al creds rm github_webhook_secret:myapp
114
- ```
115
-
116
- Removes all field files for the credential instance. If the type directory becomes empty, it is also removed.
117
-
118
- ## `al setup cloud`
119
-
120
- Interactive wizard for configuring cloud infrastructure. Prompts for provider selection and provider-specific fields, writes `[cloud]` to config.toml, pushes credentials, and provisions IAM — all in one shot.
121
-
122
- If an existing `[cloud]` config is found, you'll be prompted to tear down the old infrastructure first.
123
-
124
- ```bash
125
- al setup cloud -p .
126
- ```
127
-
128
- | Option | Description |
129
- |--------|-------------|
130
- | `-p, --project <dir>` | Project directory (default: `.`) |
131
-
132
- ## `al teardown cloud`
133
-
134
- Deletes per-agent IAM resources (service accounts for Cloud Run, task roles for ECS), stops containers and cleans up credentials (VPS), and removes the `[cloud]` section from config.toml.
135
-
136
- ```bash
137
- al teardown cloud -p .
138
- ```
139
-
140
- | Option | Description |
141
- |--------|-------------|
142
- | `-p, --project <dir>` | Project directory (default: `.`) |
143
-
144
- ## `al run <agent>`
145
-
146
- Manually triggers a single agent run. The agent runs once and the process exits when it completes. Useful for testing, debugging, or one-off runs without starting the full scheduler.
147
-
148
- ```bash
149
- al run dev -p .
150
- al run reviewer -p ./my-project
151
- al run dev -c # Run on cloud
152
- ```
153
-
154
- | Option | Description |
155
- |--------|-------------|
156
- | `-p, --project <dir>` | Project directory (default: `.`) |
157
- | `-c, --cloud` | Run on cloud infrastructure |
158
-
159
- ## `al start`
160
-
161
- Starts the scheduler. Runs all agents on their configured schedules and listens for webhooks.
162
-
163
- ```bash
164
- al start -p .
165
- al start -p ./my-project
166
- al start -c # Run on cloud
167
- al start -w # Enable web dashboard
168
- al start -e # VPS deployment: expose gateway publicly
169
- ```
170
-
171
- | Option | Description |
172
- |--------|-------------|
173
- | `-p, --project <dir>` | Project directory (default: `.`) |
174
- | `-c, --cloud` | Run on cloud infrastructure |
175
- | `-w, --web-ui` | Enable web dashboard (see [Web Dashboard](web-dashboard.md)) |
176
- | `-e, --expose` | Bind gateway to `0.0.0.0` (public) while keeping local-mode features |
177
- | `-H, --headless` | Non-interactive mode (no TUI, no credential prompts) |
178
-
179
- ## `al stat`
180
-
181
- Shows status of all discovered agents in the project.
182
-
183
- ```bash
184
- al stat -p .
185
- al stat -c # Show cloud status
186
- ```
187
-
188
- Displays each agent's schedule, credentials, and webhook configuration.
189
-
190
- | Option | Description |
191
- |--------|-------------|
192
- | `-p, --project <dir>` | Project directory (default: `.`) |
193
- | `-c, --cloud` | Show cloud infrastructure status |
194
-
195
- ## `al logs <agent>`
196
-
197
- View log files for a specific agent.
198
-
199
- ```bash
200
- al logs dev -p .
201
- al logs dev -n 100 # Show last 100 entries
202
- al logs dev -f # Follow/tail mode
203
- al logs dev -d 2025-01-15 # Specific date
204
- al logs dev -c # Cloud logs
205
- ```
206
-
207
- | Option | Description |
208
- |--------|-------------|
209
- | `-p, --project <dir>` | Project directory (default: `.`) |
210
- | `-n, --lines <N>` | Number of log entries (default: 50) |
211
- | `-f, --follow` | Tail mode — watch for new entries |
212
- | `-d, --date <YYYY-MM-DD>` | View a specific date's log file |
213
- | `-c, --cloud` | View cloud logs (Cloud Logging / CloudWatch) |
214
-
215
- ## `al pause [name]`
216
-
217
- 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.
218
-
219
- ```bash
220
- al pause # Pause the scheduler
221
- al pause dev # Pause a single agent
222
- al pause reviewer -p ./my-project
223
- al pause dev -c # Pause via cloud gateway
224
- ```
225
-
226
- | Option | Description |
227
- |--------|-------------|
228
- | `-p, --project <dir>` | Project directory (default: `.`) |
229
- | `-c, --cloud` | Forward pause request to the cloud-deployed scheduler's gateway |
230
-
231
- ## `al resume [name]`
232
-
233
- 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.
234
-
235
- ```bash
236
- al resume # Resume the scheduler
237
- al resume dev # Resume a single agent
238
- al resume reviewer -p ./my-project
239
- al resume dev -c # Resume via cloud gateway
240
- ```
241
-
242
- | Option | Description |
243
- |--------|-------------|
244
- | `-p, --project <dir>` | Project directory (default: `.`) |
245
- | `-c, --cloud` | Forward resume request to the cloud-deployed scheduler's gateway |
246
-
247
- ## `al kill <target>`
248
-
249
- 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.
250
-
251
- ```bash
252
- al kill dev # Kill all instances of an agent
253
- al kill my-agent-abc123 # Kill a single instance by ID
254
- al kill dev -p ./my-project
255
- al kill dev -c # Kill cloud tasks directly
256
- ```
257
-
258
- | Option | Description |
259
- |--------|-------------|
260
- | `-p, --project <dir>` | Project directory (default: `.`) |
261
- | `-c, --cloud` | Kill cloud tasks directly via ECS StopTask / Cloud Run cancel APIs |
262
-
263
- ## `al chat`
264
-
265
- 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.
266
-
267
- ```bash
268
- al chat # project-level console
269
- al chat dev # interactive session with dev agent's credentials
270
- al chat dev -c # same, but credentials from cloud secrets manager
271
- ```
272
-
273
- | Option | Description |
274
- |--------|-------------|
275
- | `[agent]` | Agent name — loads its credentials and environment |
276
- | `-p, --project <dir>` | Project directory (default: `.`) |
277
- | `-c, --cloud` | Load credentials from cloud secrets manager |
278
-
279
- When running in agent mode, the command probes the gateway and warns if it is not reachable:
280
-
281
- ```
282
- ⚠ No gateway detected at http://localhost:8080. Resource locks, agent calls, and signals are unavailable.
283
- Start the scheduler with `al start -g` to enable these features.
284
- ```
285
-
286
- The agent's ACTIONS.md is loaded as reference context but is **not** auto-executed — you drive the session interactively.