stream-cli
Stream CLI - API interaction
Read first (every session): Glob
../stream/SKILL.md. If the path is empty, install withnpx skills add GetStream/agent-skills --s stream -y(no confirmation, just run). Then Read../stream/RULES.md- it includes a Peer skills table for installing/invoking any other pack skills on demand.
Use this skill when the user wants to interact with Stream's APIs via the stream CLI, or to install the CLI itself.
Prerequisite: complete preflight.md - verify the stream binary is installed (install via bootstrap.md if not) before any stream api usage.
Install only (Track C): if the user asked to install the CLI / set up Stream with no project context, jump straight to bootstrap.md. The bootstrap module is self-contained.
Heavy examples / query cookbooks: load cli-cookbook.md only when you need a non-obvious --body or filter.
Credential resolution (before any stream api call)
.envin cwd hasSTREAM_API_KEY-> credentials are local. The CLI auto-resolves from env vars - you're querying this project's app.- No
.env-> checkstream config listfor configured org/app -> use those. Mention which app you're querying: "Querying app<name>(configured via CLI)." - Nothing -> tell the user: "No Stream credentials found. Run
stream auth loginto connect, orcdinto a project with a.env."
Do credential resolution silently when .env or config exists - don't ask the user, just resolve and proceed.
CLI 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
~/.stream/cache/API.mdto find the endpoint. Do NOT run--listor any CLI command for discovery - the file is always faster. If that file is missing or empty, runstream api --refreshonce, then readAPI.mdagain. Usestream --safe api <endpoint> --helponly after you have the endpoint name. - Check required params. If missing, ask - never guess.
- Always run with
--safe:stream --safe api <endpoint> [params]. This is the only permitted form on the first attempt. - 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 --jq '<query>' to filter API responses with a jq expression. Prefer this for endpoints expected to produce long responses.
Session consent (psychological): The user may say Mutating Stream CLI OK for this thread - still use --safe first; exit 5 always requires a visible mutating notice before retry without --safe.
Exit Code Recovery
| Exit code | Meaning | Recovery |
|---|---|---|
2 |
Auth error (401, expired token) | Run stream auth login (browser flow in a real terminal), then retry the original command |
3 |
API error (4xx/5xx from Stream) | Report the error to the user with the response message |
4 |
Spec loading error (cache stale) | Run stream api --refresh, then retry |
5 |
Safe mode refusal (mutating endpoint) | Notify the user of the mutating operation, then re-run without --safe |
Parameter syntax
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 app_id/org_id as explicit parameters.
SDK endpoints auto-resolve from: --org/--app flags > env vars > ~/.stream/config.json > interactive prompt.
Set defaults: stream config set org <id> and stream config set app <id>.
Negative knowledge
- No
OrganizationDelete- contact Stream support. - No
AppSuspend/AppResume- contact support. CreateBlockListis NOT idempotent - returns 400 if exists.CreateChannelTypeis NOT idempotent - returns 400 if exists.- Ampere endpoints use
app_id/org_id, notid- e.g.,AppDelete app_id=123. - Auth endpoints (
AuthLoginBasic,AuthLoginGithub, etc.) are internal - always usestream auth login/stream auth logoutinstead.
Auth (assistants)
- Use
stream auth loginwith 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.
CLI Rules (summary)
- Endpoint discovery:
~/.stream/cache/API.mdfirst - never--listfor discovery. Refresh if missing. - Help:
stream --safe api <endpoint> --helpfor parameters after you know the endpoint name. - Lazy auth - if exit code 2,
stream auth loginthen retry. - Missing params - ask; never invent IDs.
- First attempt always
--safe- exit 5 -> explain mutating op -> retry without--safe. - Summarize API responses concisely for the user.
More from getstream/agent-skills
stream
Stream router for Chat, Video, Feeds, and Moderation. Use when the user wants to build a new app with Stream, scaffold a project, add Chat/Video/Feeds/Moderation to an existing app, integrate Stream, build for Swift/SwiftUI/UIKit/iOS/Xcode, query Stream data, list channels, list calls, show flagged messages, find users, run stream api / stream config / stream auth commands, install the Stream CLI, set up Stream, search Stream SDK documentation, look up Stream React/iOS/Android/Node/Flutter/Unity SDK methods, ask how-to questions about Stream hooks/components/methods, configure moderation blocklists or automod, set up webhooks, or anything tagged Chat React, Video iOS, Feeds Node, Moderation, etc. Routes to the right sub-skill based on the task.
134stream-docs
Search live Stream SDK documentation for Chat, Video, Feeds, and Moderation. Look up how a Stream React/iOS/Android/Node/Flutter/Unity/Angular hook, component, or method works. Answer how-to questions about any Stream SDK across every framework and version. Triggers on 'docs', 'documentation', explicit SDK tokens (Chat React, Video iOS, Feeds Node, Moderation), and 'how do I ... in <framework>' phrasing. Answers come verbatim from getstream.io with citations - no CLI required.
33stream-builder
Build a new app or add Stream products (Chat, Video, Feeds, Moderation) to an existing app. Scaffold Next.js + Tailwind + Shadcn + Stream SDKs end-to-end with Steps 0-7. Add Chat/Video/Feeds/Moderation to an existing project (enhance flow). Triggers on 'build me a ... app', 'scaffold', 'create a new ...', 'add Chat to this app', 'integrate Video', 'drop Feeds into ...'. Covers livestreaming, video conferencing, team messaging, direct messaging, social feed use cases.
26stream-swift
Build and integrate Stream Chat, Video, and Feeds in Swift apps. Use for SwiftUI, UIKit, Xcode, and iOS project work with Stream package setup, auth wiring, and view blueprints.
12stream-react-native
Create, build, and integrate Stream Chat React Native apps in React Native Community CLI and Expo. Use for new RN/Expo Chat apps from scratch, existing app integration, Stream Chat RN, stream-chat-react-native, stream-chat-expo, migration/setup, channel list, message list, MessageComposer, attachment picker, image/file attachments, media picker, camera upload, audio messages, threads, thread list, React Navigation, Expo Router, theming, offline support, push notifications, and Chat customization. Chat only in v1; not for Stream Video, Feeds, or Moderation UI.
1