# CLI webhooks, impersonation, and a refreshed experience

When we [released the CLI](https://clerk.com/changelog/2026-04-22-clerk-cli.md) and then shipped [`clerk deploy`](https://clerk.com/changelog/2026-06-10-clerk-deploy.md), the goal was a single tool that both developers and agents could use to run Clerk end to end. CLI 2.0 pushes further into day-to-day workflows: testing webhooks and debugging as a specific user, all without leaving your terminal.

## Test webhooks locally with `clerk webhooks`

A new command group gives you a self-contained, local webhooks toolkit — no linked project and no Platform API required:

- **`clerk webhooks listen`**: opens a relay tunnel and forwards deliveries to your local handler. Pass `--token` to pin a stable, shareable URL you can reuse across restarts.
- **`clerk webhooks verify`**: verifies a webhook signature offline (HMAC-SHA256), from a saved delivery or explicit header values — no network calls.
- **`clerk webhooks token`**: generates a relay token you can pipe straight into `listen`.

```bash
$ clerk webhooks listen --forward-to http://localhost:3000/api/webhooks
```

## Debug as any user with `clerk impersonate`

`clerk impersonate` (alias `clerk imp`) creates a short-lived sign-in URL that logs you in as another user, so you can reproduce a report from their exact session. Target a user by ID or email, add `--open` to launch the URL straight away, and every impersonation is stamped with your account for auditing.

```bash
$ # Impersonate a user by email and open the sign-in URL
$ clerk imp alice@example.com --open

$ # Revoke a pending token when you're done
$ clerk imp revoke act_29w9...
```

Run `clerk imp` with no arguments to pick a user interactively.

## A refreshed interactive experience

Prompts, lists, and spinners have a new visual style, and interactive commands now end by clearly reflecting success, failure, or a paused cancellation — so it's always obvious how a run finished.

## Built for agents

Every command in 2.0 respects the CLI's agent contract: stable error codes, `stdout` for data and `stderr` for UI, and no hidden interactive prompts in non-TTY contexts. `clerk webhooks token` prints a bare token to `stdout` so it pipes cleanly, and `clerk impersonate` resolves the target instance explicitly rather than silently defaulting.

## Get started

Update to the latest CLI, then try any of the new commands:

```bash
$ clerk webhooks listen --forward-to http://localhost:3000/api/webhooks
```

See the [CLI docs](https://clerk.com/docs/cli.md) for the full command reference.
