# CLI

`signapi` is a single binary for macOS, Linux and Windows. It is built for scripts and coding
agents: every command prints newline-delimited JSON, ending with exactly one `result` line, and
exits `0` on success, `1` on a failure or partial result, and `2` on a usage error, when nothing
was sent.

## Sign in and set up

```sh
signapi login        # opens the dashboard to approve this device
signapi init         # copies the account's test key into .env as SIGNAPI_KEY
```

`login` stores a sign-in token, never an API key, in the system keychain (or a private file with
`--credential-store file`). `init --mode live` creates a live key instead. The CLI never prints a
key's value.

## Keys

Resource commands use an API key from the environment: the variable named by `--api-key-var`,
else `SIGNAPI_KEY`, else `SIGNATUREAPI_KEY`. Without one they use your sign-in. The key's mode
decides whether the command works on test or live data.

## Commands

| Command | What it does |
|---|---|
| `envelopes` | Create, list, get, cancel and delete envelopes |
| `recipients` | Replace a recipient, resend a request, create a ceremony |
| `deliverables`, `events` | Read deliverables and events |
| `uploads` | Upload PDF, DOCX, PNG, Markdown and HTML files, and inspect them |
| `emails` | Read the emails stored for test envelopes |
| `api-keys` | Create, list, roll, reveal and revoke keys |
| `webhooks` | Copy an endpoint's signing secret into an env file, or rotate it |
| `listen --forward-to <url>` | Forward test webhook deliveries to a local handler |
| `trigger <event>` | Send a sample event to your listeners |
| `run -- <command>` | Run a command with the test key in its environment, masked in its output |
| `agent setup` | Add the Sign API skill and MCP server to your coding agents |

Run `signapi <command> --help` for each command's options, or see the [CLI command reference](https://docs.signapi.dev/cli-reference)
for every command with its options and examples.
