Skip to content

feat(cli): manage webhooks and their deliveries - #429

Open
gregberge wants to merge 3 commits into
mainfrom
claude/cli-webhooks-9fc171
Open

gregberge wants to merge 3 commits into
mainfrom
claude/cli-webhooks-9fc171

Conversation

@gregberge

@gregberge gregberge commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Adds webhook management to the argos CLI, on the REST endpoints from argos-ci/argos#2787.

Important

Merge and release this after argos-ci/argos#2787 is deployed. Until then every webhook command gets a 404.

Commands

All of them take --account <slug> (or ARGOS_ACCOUNT), --token and --json, and need a personal access token or an argos login session with Admin access (account:admin), like the other account commands.

Command What it does
argos webhook list List the account's webhooks, newest first
argos webhook get <webhookId> Fetch one webhook
argos webhook create --url <url> --events <events...> [--projects <names...>] Create a webhook and print its signing secret, once. Events: build.completed, build.reviewed, deployment.created, deployment.ready. Without --projects, the webhook gets every project, including future ones
argos webhook delete <webhookId> Delete a webhook. Prints { deleted: true, webhookId } with --json
argos webhook delivery list <webhookId> [--status pending|success|failed] [--event-id <id>] [--limit <n>] List deliveries, most recent first, following pagination up to --limit (100 by default)
argos webhook delivery get <webhookId> <deliveryId> Show a delivery with the request body Argos sent and the start of the response
argos webhook delivery resend <webhookId> <deliveryId> Send the event again as a new delivery

--events and --projects take several values after one flag (--events build.completed build.reviewed) or a repeated flag. --projects follows argos account project-token create; it is not --project, which means owner/project everywhere else in the CLI.

webhook is a top-level command, like automation, rather than account webhook, so the delivery commands stay three words deep.

Sample output of argos webhook delivery get:

Delivery 300 [failed]
Event: build.completed · 4f1c2b
Attempts: 3
Last attempt: 2026-11-20T10:05:00.000Z
Response: HTTP 502 in 341 ms
Failure: Endpoint answered HTTP 502
Created: 2026-11-20T10:00:00.000Z

Request body:
  {
    "id": "4f1c2b",
    "type": "build.completed",
    ...
  }

Response body:
  <html>
  <body>Bad gateway</body>
  </html>

The response body and failure reason come from the endpoint, and the request body carries branch names and other user text, so they go through a new sanitizeTerminalBlock: it strips escape sequences like sanitizeTerminalText but keeps line breaks.

API types

packages/api-client/src/schema.ts is generated from the argos branch claude/arg-539-webhook-support-a3eaa7, since production does not serve these endpoints yet. Besides the webhook endpoints, it brings:

No existing schema changes: next to production, the file only adds. The first regeneration (c542e75) briefly had …Output copies of shared schemas from a bug in argos-ci/argos#2787; 3144d16 regenerates without them, so c542e75's message still mentions them. Squash-merge, or reword c542e75 before merging, to keep that out of main.

Docs

Tests

  • commands/webhook/index.test.ts runs each command through Commander against a stubbed fetch and checks the method, path, query and body sent, plus the output.
  • format.test.ts covers every formatter; terminal.test.ts covers sanitizeTerminalBlock.
  • I also ran the built CLI against a local mock of the API, including a scope error. Not tried against the real backend.

Refs ARG-539

🤖 Generated with Claude Code

gregberge and others added 2 commits November 20, 2026 12:42
Regenerate the schema from argos-ci/argos#2787 (branch
claude/arg-539-webhook-support-a3eaa7), which is not deployed yet. It
adds the account webhook endpoints: list, create, get and delete a
webhook, list and get its deliveries, and resend one. It also adds
that PR's project events feed (`listProjectEvents`) and the payload of
each event under `webhooks`.

Because the event payloads are used as request bodies, the generator
now emits output variants of a few shared schemas (`UserOutput`,
`AccountOutput`, `AgentOutput`, ...), and `Comment`, `Project`,
`TeamMember`, `ProjectContributor` and `BuildReviewers` reference those.
Both variants have the same shape.

The regeneration also picks up fields production already serves:
`description` on screenshots and `githubDeploymentEnabled` on projects.

Refs ARG-539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`argos webhook list|get|create|delete` manage an account's webhooks on
`/accounts/{accountSlug}/webhooks`. `create` takes `--url`, `--events`
(one or more of build.completed, build.reviewed, deployment.created,
deployment.ready) and `--projects` (every project, including future
ones, by default), and prints the signing secret: Argos returns it once.

`argos webhook delivery list|get|resend` inspect what Argos sent:
`list` filters on `--status` and `--event-id` and follows pagination up
to `--limit`, `get` prints the request body and the start of the
response, and `resend` sends the event again as a new delivery.

Every command takes `--account` (or ARGOS_ACCOUNT) and needs a personal
access token or an `argos login` session with Admin access, like the
other account commands. Response bodies and failure reasons come from
the endpoint, so they are sanitized before reaching the terminal; a new
`sanitizeTerminalBlock` keeps their lines.

The argos-cli skill covers the commands, the secret and a debugging flow.

Needs argos-ci/argos#2787 deployed: the endpoints answer 404 until then.

Refs ARG-539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

ARG-539

@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:44 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:44 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:44 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:44 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:44 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:45 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:45 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:45 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 11:45 Inactive
gregberge added a commit to argos-ci/docs that referenced this pull request Nov 20, 2026
Follow argos-ci/argos-javascript#429: add a "Manage webhooks from the
CLI" section to the webhooks page (create, then find and resend failed
deliveries), and a "Managing webhooks" section to the CLI reference,
with the commands in its table and webhook delivery list among the
paginated lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
argos-ci/argos#2787 no longer splits the schemas shared with the event
payloads into input and `…Output` copies (fixed in its commit
802637754), so `UserOutput`, `AccountOutput`, `AgentOutput` and the
other copies are gone. `Comment`, `Project`, `TeamMember`,
`ProjectContributor` and `BuildReviewers` reference `User`, `Account`
and `Agent` again, as in production.

The webhook endpoints and their schemas are unchanged. Next to
production, the schema now only adds the webhook endpoints, the project
events feed and the event payloads.

Refs ARG-539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:13 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:14 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:14 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:15 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:15 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:15 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:15 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 20, 2026 12:16 Inactive

This branch was successfully deployed

1 active deployment
argos-javascript/preview — 3144d16b Deployed Nov 20, 2026 by argos-ci[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant