stream-cli
Original:🇺🇸 English
Translated
Query Stream data and run CLI operations against Chat, Video, Feeds, and Moderation: list channels, list calls, show flagged messages, find users, query any Stream resource. Run stream api / stream config / stream auth commands. Install the Stream CLI binary. Use when the user gives operational verbs ('list', 'show', 'find', 'check', 'query') with Stream nouns, or invokes the CLI literally.
15installs
Sourcegetstream/agent-skills
Added on
NPX Install
npx skill4agent add getstream/agent-skills stream-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Stream CLI - API interaction
Read first (every session): Glob. If the path is empty, install with../stream/SKILL.md(no confirmation, just run). Then Readnpx skills add GetStream/agent-skills --s stream -y- it includes a Peer skills table for installing/invoking any other pack skills on demand.../stream/RULES.md
Use this skill when the user wants to interact with Stream's APIs via the CLI, or to install the CLI itself.
streamPrerequisite: complete - verify the binary is installed (install via if not) before any usage.
preflight.mdstreambootstrap.mdstream apiInstall only (Track C): if the user asked to install the CLI / set up Stream with no project context, jump straight to . The bootstrap module is self-contained.
bootstrap.mdHeavy examples / query cookbooks: load only when you need a non-obvious or filter.
cli-cookbook.md--bodyCredential resolution (before any stream api
call)
stream api- in cwd has
.env-> credentials are local. The CLI auto-resolves from env vars - you're querying this project's app.STREAM_API_KEY - No -> check
.envfor configured org/app -> use those. Mention which app you're querying: "Querying appstream config list(configured via CLI)."<name> - Nothing -> tell the user: "No Stream credentials found. Run to connect, or
stream auth logininto a project with acd.".env
Do credential resolution silently when or config exists - don't ask the user, just resolve and proceed.
.envCLI Workflow
Support: If the user asks for support or how to contact someone, direct them to getstream.io/contact.
- Resolve credentials (see above). If none found, stop and guide the user.
- Read to find the endpoint. Do NOT run
~/.stream/cache/API.mdor any CLI command for discovery - the file is always faster. If that file is missing or empty, run--listonce, then readstream api --refreshagain. UseAPI.mdonly after you have the endpoint name.stream --safe api <endpoint> --help - Check required params. If missing, ask - never guess.
- Always run with :
--safe. This is the only permitted form on the first attempt.stream --safe api <endpoint> [params] - If exit code 5 (safe mode refusal): the endpoint is mutating. Notify the user that you're about to execute a mutating Stream CLI operation, then re-run without .
--safe - If the command fails, check exit code and recover (see below).
- Summarize the response concisely.
Focused output: Use to filter API responses with a jq expression. Prefer this for endpoints expected to produce long responses.
--jq '<query>'Session consent (psychological): The user may say Mutating Stream CLI OK for this thread - still use first; exit 5 always requires a visible mutating notice before retry without .
--safe--safeExit Code Recovery
| Exit code | Meaning | Recovery |
|---|---|---|
| Auth error (401, expired token) | Run |
| API error (4xx/5xx from Stream) | Report the error to the user with the response message |
| Spec loading error (cache stale) | Run |
| Safe mode refusal (mutating endpoint) | Notify the user of the mutating operation, then re-run without |
Parameter syntax
bash
stream api <EndpointName> key=value key2=value2- Simple values:
name=general limit=10 type=messaging - Booleans:
is_development=true - JSON objects/arrays: use
--body '{"key": "value"}'
Context resolution (org/app)
Ampere endpoints require / as explicit parameters.
SDK endpoints auto-resolve from: / flags > env vars > > interactive prompt.
Set defaults: and .
app_idorg_id--org--app~/.stream/config.jsonstream config set org <id>stream config set app <id>Negative knowledge
- No - contact Stream support.
OrganizationDelete - No /
AppSuspend- contact support.AppResume - is NOT idempotent - returns 400 if exists.
CreateBlockList - is NOT idempotent - returns 400 if exists.
CreateChannelType - Ampere endpoints use /
app_id, notorg_id- e.g.,id.AppDelete app_id=123 - Auth endpoints (,
AuthLoginBasic, etc.) are internal - always useAuthLoginGithub/stream auth logininstead.stream auth logout
Auth (assistants)
- Use with no extra flags, in a terminal where a browser window can open. The CLI uses PKCE with the dashboard - that is the supported sign-in path.
stream auth login
CLI Rules (summary)
- Endpoint discovery: first - never
~/.stream/cache/API.mdfor discovery. Refresh if missing.--list - Help: for parameters after you know the endpoint name.
stream --safe api <endpoint> --help - Lazy auth - if exit code 2, then retry.
stream auth login - Missing params - ask; never invent IDs.
- First attempt always - exit 5 -> explain mutating op -> retry without
--safe.--safe - Summarize API responses concisely for the user.