You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Describe what you intend to contribute. This avoids duplicate work and gives mai
14
14
15
15
### 2. Set up your environment
16
16
17
-
Follow the [Quick Start](./docs/guides/QUICK_START.md) to clone, install, and build the project. See the [Developer guide](./docs/guides/DEVELOPER_GUIDE.md) for local testing and the development workflow.
17
+
Follow the [Quick Start](./docs/guides/QUICK_START.mdx) to clone, install, and build the project. See the [Developer guide](./docs/guides/DEVELOPER_GUIDE.md) for local testing and the development workflow.
18
18
19
19
Use **[AGENTS.md](./AGENTS.md)** to understand where to make changes (CDK vs CLI vs agent vs docs), which tests to extend, and common pitfalls (generated docs, mirrored API types, `mise` tasks).
# Or pass fields explicitly / use --from-bundle from `admin invite-user`
32
+
33
+
# 4. Log in with your Cognito credentials
39
34
bgagent login --username you@example.com
40
35
41
-
#4. Submit a task
36
+
#5. Submit a task
42
37
bgagent submit --repo owner/repo --issue 42
43
38
44
-
#5. Check status
39
+
#6. Check status
45
40
bgagent list
46
41
bgagent status <task-id>
47
42
```
48
43
44
+
Operator commands (`platform`, `repo`, `github set-token`) use **operator AWS credentials** directly — Cognito login is not required.
45
+
49
46
## Commands
50
47
51
48
### `bgagent configure`
@@ -54,12 +51,16 @@ Save API endpoint and Cognito settings to `~/.bgagent/config.json`.
54
51
55
52
```
56
53
bgagent configure \
57
-
--api-url <url> API Gateway base URL (required)
58
-
--region <region> AWS region (required)
59
-
--user-pool-id <id> Cognito User Pool ID (required)
60
-
--client-id <id> Cognito App Client ID (required)
54
+
--stack-name <name> Read ApiUrl, UserPoolId, AppClientId from CloudFormation
55
+
--from-bundle <base64> All four fields from `bgagent admin invite-user`
56
+
--api-url <url> API Gateway base URL (override or manual configure)
57
+
--region <region> AWS region (required with --stack-name if unset in env)
58
+
--user-pool-id <id> Cognito User Pool ID
59
+
--client-id <id> Cognito App Client ID
61
60
```
62
61
62
+
First-time configure needs all four core fields. The easiest paths are `--stack-name backgroundagent-dev --region …` (same outputs as `bgagent platform outputs`) or `--from-bundle` after `admin invite-user`. Individual flags override stack-derived values.
63
+
63
64
### `bgagent login`
64
65
65
66
Authenticate with Cognito and cache tokens locally.
--output <text|json> Output format (default: text)
166
167
```
167
168
169
+
## Operator commands
170
+
171
+
These commands support day-2 operations using **operator AWS credentials** (IAM profile or environment). They read CloudFormation outputs, DynamoDB, and Secrets Manager directly — no Cognito login required. The read-only and introspection commands (`platform`, `repo`, `runtime`, `ops`, `webhook test`, `admin list-users`) support `--output json` for scripting; the credential-writing commands (`github set-token`/`set-webhook-secret`, `admin invite-user`/`delete-user`/`reset-password`) do not.
172
+
173
+
Shared flags:
174
+
175
+
| Flag | Description |
176
+
|------|-------------|
177
+
|`--region <region>`| AWS region (defaults to `bgagent configure` region or `AWS_REGION`) |
178
+
|`--stack-name <name>`| CloudFormation stack name (default: `backgroundagent-dev`) |
--output <text|json> Output format (default: text)
187
+
```
188
+
189
+
### `bgagent platform doctor`
190
+
191
+
Smoke-check deployed platform readiness: Task API reachable, Cognito pool/client valid, platform GitHub token populated, at least one active onboarded repo, Bedrock model visible.
192
+
193
+
```
194
+
bgagent platform doctor \
195
+
--output <text|json> Output format (default: text)
196
+
```
197
+
198
+
Exits with code 1 when any check fails (warnings are acceptable).
199
+
200
+
### `bgagent repo list`
201
+
202
+
List repositories onboarded via Blueprint constructs (reads `RepoTable`).
203
+
204
+
```
205
+
bgagent repo list \
206
+
--status <active|removed> Filter by status
207
+
--output <text|json> Output format (default: text)
208
+
```
209
+
210
+
### `bgagent repo show <owner/repo>`
211
+
212
+
Show full `RepoConfig` for a repository. Secret ARNs are redacted. When no per-blueprint token is configured, the output shows that the repo uses the **platform default** GitHub PAT (`GitHubTokenSecretArn`), not an empty/missing token.
213
+
214
+
```
215
+
bgagent repo show owner/repo \
216
+
--output <text|json> Output format (default: text)
217
+
```
218
+
219
+
### `bgagent repo onboard <owner/repo>`
220
+
221
+
Register or re-activate a repository in `RepoTable` without a CDK redeploy. With no overrides, tasks use the platform `RuntimeArn` and `GitHubTokenSecretArn` (IAM already granted at deploy). Custom `--runtime-arn` / `--token-secret-arn` values require matching `TaskOrchestrator` IAM via CDK — the command prints notes explaining this. Prefer CDK `Blueprint` constructs for durable lifecycle, Cedar policies, and egress validation.
--poll-interval <ms> Default agent poll interval in milliseconds \
231
+
--output <text|json>
232
+
```
233
+
234
+
### `bgagent repo offboard <owner/repo>`
235
+
236
+
Soft-delete a repository (`status=removed` + TTL), matching Blueprint delete semantics. An existing Blueprint will re-activate the repo on the next CDK deploy.
237
+
238
+
```
239
+
bgagent repo offboard owner/repo \
240
+
--output <text|json>
241
+
```
242
+
243
+
### `bgagent runtime status`
244
+
245
+
Show **per-blueprint** effective compute substrate and runtime ARN (merged with platform `RuntimeArn`), then probe unique AgentCore runtimes via the control-plane API. ECS blueprints are listed separately — they use the platform ECS cluster/task definition, not per-repo `runtime_arn`.
246
+
247
+
```
248
+
bgagent runtime status \
249
+
--repo <owner/repo> Limit to one repository \
250
+
--output <text|json>
251
+
```
252
+
253
+
### `bgagent ops stuck-tasks`
254
+
255
+
List tasks in `SUBMITTED`, `HYDRATING`, or `AWAITING_APPROVAL` older than the stranded-task reconciler thresholds (defaults: 1200s / 7200s). Text output includes Cognito email plus username UUID.
256
+
257
+
```
258
+
bgagent ops stuck-tasks \
259
+
--stranded-timeout <seconds> \
260
+
--approval-timeout <seconds> \
261
+
--output <text|json>
262
+
```
263
+
264
+
### `bgagent ops concurrency`
265
+
266
+
Compare `UserConcurrencyTable` counters with live active task counts per user. Resolves Cognito usernames to email (same as `bgagent admin list-users`).
267
+
268
+
```
269
+
bgagent ops concurrency \
270
+
--limit <n> Per-user limit (default: 3) \
271
+
--output <text|json>
272
+
```
273
+
274
+
### `bgagent webhook test <webhook-id>`
275
+
276
+
Send a signed sample payload to `POST /v1/webhooks/tasks` (creates a real task — cancel afterward if this was only a connectivity check).
277
+
278
+
```
279
+
bgagent webhook test <webhook-id> \
280
+
--secret <secret> From `webhook create` output \
281
+
--fetch-secret Read secret from Secrets Manager (operator IAM) \
282
+
--repo <owner/repo> Target repo (defaults to first active repo) \
283
+
--api-url <url> Defaults to configure api_url or stack ApiUrl \
284
+
--output <text|json>
285
+
```
286
+
287
+
### `bgagent github set-token`
288
+
289
+
Store a GitHub personal access token in Secrets Manager (interactive masked prompt).
290
+
291
+
```
292
+
bgagent github set-token \
293
+
--repo <owner/repo> Target a blueprint's per-repo token secret (when configured)
294
+
--secret-arn <arn> Write to an explicit Secrets Manager ARN
295
+
--region <region> AWS region (defaults to configured region)
296
+
--stack-name <name> CloudFormation stack name (default: backgroundagent-dev)
297
+
```
298
+
299
+
With no flags, writes to the platform default `GitHubTokenSecretArn` stack output. When `--repo` is used, the CLI reads `github_token_secret_arn` from `RepoTable` if the Blueprint configured `credentials.githubTokenSecretArn`; otherwise it falls back to the platform default with a notice.
Manage Cognito users with operator AWS credentials (`cognito-idp:Admin*` on the deployment user pool). Works **before**`bgagent configure` when `--stack-name` is passed (reads `UserPoolId` from CloudFormation).
308
+
309
+
```
310
+
bgagent admin invite-user <email> \
311
+
--stack-name backgroundagent-dev \
312
+
--password <pwd> # optional; auto-generated if omitted
313
+
314
+
bgagent admin list-users \
315
+
--output <text|json>
316
+
317
+
bgagent admin delete-user <email>
318
+
319
+
bgagent admin reset-password <email> \
320
+
--password <pwd> # optional; auto-generated if omitted
321
+
```
322
+
323
+
`invite-user` creates the user, sets a permanent password, and writes credentials plus an optional configure bundle to `~/.bgagent/invites/<email>.txt` (mode 0600). Replaces Quick Start Step 5 raw `aws cognito-idp` commands.
324
+
168
325
## Output formats
169
326
170
327
**Text mode** (default) prints human-readable output:
0 commit comments