CLI (rcs)
The rcs CLI is a thin, scriptable mirror of the gateway. Every command prints
JSON, so it composes with jq, drops into CI, or runs as a step inside a
shell-driven agent loop.
The CLI ships in the @rcs-campaigns/agent-toolkit package and is a
Pro-plan feature.
Authenticate
The CLI reads two environment variables — the same pair the MCP server uses:
export RCS_GATEWAY_URL=https://your-server
export RCS_AGENT_KEY=rcsk_live_…Run it via npx (or install @rcs-campaigns/agent-toolkit globally to get the
rcs binary on your PATH):
npx -y -p @rcs-campaigns/agent-toolkit rcs capabilitiesCommands
The CLI covers the common path. Some gateway calls — audience management, template update/duplicate/delete, and a few survey verbs — are reachable over HTTP and MCP but have no CLI command yet; the API reference marks which.
Templates
| Command | Scope | Does |
|---|---|---|
rcs capabilities | any key | Print the gateway map + the scopes your key holds |
rcs search [query] | templates:read | Discover templates by query, channel, category |
rcs get <id> | templates:read | Fetch one template’s content + metadata |
rcs render <id> | templates:read | Render with sample variables; inspect the payload + SMS fallback |
rcs create --file <f> | templates:write | Author a new template from a content object |
rcs clone <id> | marketplace:clone | Clone a marketplace listing into your org |
rcs submit <id> | templates:submit | Submit a draft to the provider for approval |
rcs send <blueprintId> | messages:send | Broadcast to an E.164 list (RCS-first, SMS fallback) |
Surveys
| Command | Scope | Does |
|---|---|---|
rcs surveys [query] | surveys:read | List/search the surveys your org owns |
rcs survey get <id> | surveys:read | Fetch one survey’s full definition |
rcs survey create --file <f> | surveys:write | Author a survey from a question set |
rcs survey update <id> --file <f> | surveys:write | Patch questions, branching, or metadata |
rcs survey submit <id> | surveys:submit | Submit for provider approval |
rcs survey send-test <id> --to +1… | surveys:send | Rehearse on your own number first |
rcs survey send <id> | surveys:send | Run against recipients or an audience |
rcs survey sends <id> | surveys:read | Read the send history |
rcs survey results <id> | results:read | Pull responses back as structured data |
Media and grounding knowledge
| Command | Scope | Does |
|---|---|---|
rcs upload-image --file <img> | surveys:write | Host an image for use as rich-card media |
rcs knowledge <id> --get | templates:read | Read a template’s grounding doc |
rcs knowledge <id> --set-file <f> | templates:write | Attach or replace the grounding doc |
rcs knowledge <id> --delete | templates:write | Remove the grounding doc |
rcs knowledge <id> --enable|--disable | templates:write | Toggle grounding without deleting the doc |
Account
| Command | Scope | Does |
|---|---|---|
rcs usage | usage:read | Read month-to-date metered usage |
Run rcs --help for the authoritative list — it is printed by the same build
you installed.
Compose it
Because output is JSON, pipe it straight into jq:
# Top 5 highest-rated hospitality templates, names only
rcs search --channel rcs --category hospitality \
| jq -r '.data.templates | sort_by(-.rating)[:5][].name'# Render a template and read back the SMS fallback text
rcs render --id tmpl_123 --vars '{"first_name":"Sam"}' \
| jq '.data.fallback.text'rcs send broadcasts real messages and is metered. Gate it behind a human
confirmation step in any autonomous loop, and mint send-capable keys sparingly.