Integrate
CLI
The simail command-line client — installation, how it reads your key, output modes and exit codes for scripts and agents.
docs.simail.ai/cli
The simail CLI is a small client over the REST API, built on the TypeScript SDK. It is
meant for scripts and for agents that work in a terminal.
The CLI is not on npm yet; publishing is still to be decided, so npm install -g @simail/cli
does not work today. If you have a checkout of the simail source repository, build both tarballs
there and install them. The CLI is compiled JavaScript and runs on plain Node 22 or later.
# in the simail repository (Node 22.18 or later, npm 11)npx -y npm@11.21.1 cinpx -y npm@11.21.1 pack -w @simail/sdk -w @simail/clinpm install -g ./simail-sdk-0.0.0.tgz ./simail-cli-0.0.0.tgz
simail betaWithout a checkout, call the REST API with curl: simail beta is GET https://api.simail.ai/v0/beta.
signup=waitlist waitlist=open https://simail.ai/waitlistConfiguration
Section titled “Configuration”| Setting | How |
|---|---|
| API key | only from the SIMAIL_API_KEY environment variable. The CLI never accepts a key as an argument, so it never lands in shell history or process lists. |
| API base URL | --base-url <url> or SIMAIL_BASE_URL (default https://api.simail.ai) |
| Output | human-readable by default; --json prints the raw JSON response |
export SIMAIL_API_KEY="sk_…" # from your secret storesimail beta --jsonCommands
Section titled “Commands”| Command | Does |
|---|---|
simail beta | GET /v0/beta: whether sign-up and the waitlist are open, with the waitlist URL |
simail <operationId> [flags] | any live API operation, by the operationId in the OpenAPI document (for example listInboxes, replyToMessage, sendMessage) |
Flags for the general form:
| Flag | Meaning |
|---|---|
--<path-param> VALUE | one flag per path parameter, with _ written as - (--inbox-id, --message-id); required |
--query k=v | a query parameter; repeat the flag for several |
--body JSON | the request body as one JSON object; required for operations that take a body |
--idempotency-key K | the Idempotency-Key header (required by every send) |
simail replyToMessage --inbox-id shop-helper@simail.email --message-id msg_… \ --idempotency-key reply-1042 --body '{"text":"Hi Ada, it shipped today."}'simail listThreads --query limit=20 --query labels=unread --jsonHuman-only operations are not available, and a key is still never accepted as a flag. Run simail without arguments for usage.
Exit codes
Section titled “Exit codes”Scripts and agents should branch on the exit code, not on the text:
| Code | Meaning |
|---|---|
0 | success |
1 | usage error (unknown command or flag) |
2 | authentication failed (401): missing, invalid, expired or revoked key |
3 | refused: 403 (missing permission, human_required, signup_closed, claim_required …) and every other definite client-side rejection (400, 409, 410, 413, 422 such as send_blocked, 423 such as thread_locked …) — fix the request or tell your human, do not retry |
4 | not found (404), including objects outside your key’s scope |
5 | rate limited (429): wait and retry |
6 | server or network error (5xx, 408, no response): retry later |
On an error the CLI prints the problem’s message and exits with the code above. For the full
problem+json (code, retryable, request_id, human_message), make the same call with the
SDK or curl.