> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contactbutton.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact Button CLI

> Use the official Contact Button command-line interface for API exploration, repeatable setup, CI workflows, and coding-agent automation.

The Contact Button CLI wraps API v1 in one agent-friendly command. It is designed for quick operator tasks, shell automation, CI, and coding agents that need deterministic Contact Button setup without browser automation.

```bash theme={null}
contactbutton workspaces list --format json
contactbutton api get /workspaces/$WORKSPACE_ID/pages --format json
contactbutton api post /workspaces/$WORKSPACE_ID/pages \
  --data @page.json \
  --dry-run
```

> [!NOTE]
>
> The CLI is an early preview. The publish-ready package is named `@contactbutton/cli`; registry installation becomes available when the first public package release is promoted. See [Install the CLI](https://docs.contactbutton.com/cli/install.md) for the current release status.

## CLI or API?

| Use case | Recommended surface |
| - | - |
| Explore resources from a terminal | CLI |
| Let a coding agent perform a bounded setup | CLI or Product MCP |
| Repeat a short shell or CI workflow | CLI |
| Build a production application | REST API |
| Search Contact Button documentation | Documentation MCP |

The CLI does not replace the API. Its generic `api` command maps directly to documented API v1 methods and paths, so a request can move between CLI, `curl`, and application code without changing its resource model.

## First-pass capabilities

* Read API keys from `CONTACTBUTTON_TOKEN`, `CONTACTBUTTON_API_KEY`, or an owner-readable local file
* List and retrieve accessible workspaces
* Call every documented JSON API v1 endpoint with `api <method> <path>`
* Emit compact JSON, JSON Lines, pretty JSON, or raw response bodies
* Add repeatable query parameters and non-authentication headers
* Read JSON request bodies inline, from a file, or from stdin
* Generate request IDs and idempotency keys for mutations
* Require `--dry-run` or `--confirm` before sending a mutation
* Redact credentials and secret-like fields from dry-run and debug output
* Override the base URL for Appdev or local testing without allowing credentials to be sent to an arbitrary absolute request URL

## Safety model

`--confirm` means the operator or represented human has approved sending that mutation. It does not bypass API permissions or Contact Button confirmation rules. Publishing, paid actions, DNS changes, phone-number purchases, bookings, callbacks, and other consequential actions still require the approval described by their API contract.

The CLI never accepts an API key as a command-line argument because shell history and process listings can expose it.

> [card] [Install](https://docs.contactbutton.com/cli/install.md)
>
> Install the preview and verify the binary.

> [card] [Authentication](https://docs.contactbutton.com/cli/authentication.md)
>
> Configure a scoped API key without exposing it to chat or shell history.

> [card] [Command reference](https://docs.contactbutton.com/cli/commands.md)
>
> Review commands, flags, formats, and exit codes.

> [card] [Automation](https://docs.contactbutton.com/cli/automation.md)
>
> Use dry runs, JSON output, and explicit confirmation with coding agents and CI.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.