Skip to main content

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 capabilities

Commands

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

CommandScopeDoes
rcs capabilitiesany keyPrint the gateway map + the scopes your key holds
rcs search [query]templates:readDiscover templates by query, channel, category
rcs get <id>templates:readFetch one template’s content + metadata
rcs render <id>templates:readRender with sample variables; inspect the payload + SMS fallback
rcs create --file <f>templates:writeAuthor a new template from a content object
rcs clone <id>marketplace:cloneClone a marketplace listing into your org
rcs submit <id>templates:submitSubmit a draft to the provider for approval
rcs send <blueprintId>messages:sendBroadcast to an E.164 list (RCS-first, SMS fallback)

Surveys

CommandScopeDoes
rcs surveys [query]surveys:readList/search the surveys your org owns
rcs survey get <id>surveys:readFetch one survey’s full definition
rcs survey create --file <f>surveys:writeAuthor a survey from a question set
rcs survey update <id> --file <f>surveys:writePatch questions, branching, or metadata
rcs survey submit <id>surveys:submitSubmit for provider approval
rcs survey send-test <id> --to +1…surveys:sendRehearse on your own number first
rcs survey send <id>surveys:sendRun against recipients or an audience
rcs survey sends <id>surveys:readRead the send history
rcs survey results <id>results:readPull responses back as structured data

Media and grounding knowledge

CommandScopeDoes
rcs upload-image --file <img>surveys:writeHost an image for use as rich-card media
rcs knowledge <id> --gettemplates:readRead a template’s grounding doc
rcs knowledge <id> --set-file <f>templates:writeAttach or replace the grounding doc
rcs knowledge <id> --deletetemplates:writeRemove the grounding doc
rcs knowledge <id> --enable|--disabletemplates:writeToggle grounding without deleting the doc

Account

CommandScopeDoes
rcs usageusage:readRead 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.