Stream CLI
Note: The Stream CLI is currently in beta and may contain bugs. This should not be used against a production environment at this time. To report bugs, please follow the instructions below. Thank you for your support!
Stream's Command Line Interface (CLI) makes it easy to create and manage your Stream apps directly from the terminal. Currently, only Chat is supported; however, the ability to manage Feeds will be coming soon.
🗒 Issues
If you're experiencing problems directly related to the CLI, please add an issue on GitHub.
For other issues, submit a support ticket.
📚 Changelog
As with any project, things are always changing. If you're interested in seeing what's changed in the Stream CLI, the changelog for this project can be found here.
🏗 Installation
The Stream CLI is easy to install. You have the option to use homebrew (preferred) if you're on macOS, download a single binary for your OS of choice, or download via npm.
Homebrew
$ brew install stream
NPM
$ npm install -g getstream-cli
Binaries
Note: Binaries are generally updated less frequently than Homebrew.
🚀 Getting Started
In order to initialize the CLI, please have your Stream API key and secret ready. Run the following command:
$ stream config:set
You will then be prompted to enter your API key and secret.
$ ? What's your API key? 🔒
$ ? What's your API secret? 🔒
Now, you're good to go!
$ Your config has been generated! 🚀
Note: Your API key and secret can be found on the Stream Dashboard and is specific to your application.
🔨 Commands
Basic commands use the following syntax:
$ stream command:COMMAND --arg1 "foo" --arg2 "bar"
Whereas commands for specific products use subcommands:
$ stream command:COMMAND:SUBCOMMAND --arg1 "foo" --arg2 "bar"
Root Commands
Config Commands
Chat Commands
$ stream chat:channel
$ stream chat:message
$ stream chat:moderate
$ stream chat:user
$ stream autocomplete
Initialize autocomplete for the CLI (recommended)
$ stream autocomplete
$ stream commands
Display all commands
$ stream commands
$ stream help
Get help with the CLI
$ stream help
$ stream config:set
Initialize a new configuration file.
USAGE
$ stream config:set
$ stream config:get
Retrieve your configuration settings.
USAGE
$ stream config:get
$ stream config:destroy
Destroy your configuration file
USAGE
$ stream config:destroy
Note: The command stream config:set
must be called to re-initialize the configuration.
$ stream chat:channel:edit
Edit a specific channel.
USAGE
$ stream chat:channel:edit
OPTIONS
-d, --data=data Additional data as JSON.
-i, --id=id (required) The ID of the channel you wish to edit.
-m, --members=members Comma separated list of members.
-n, --name=name (required) Name of the channel room.
-r, --reason=reason (required) Reason for changing channel.
-t, --type=livestream|messaging|gaming|commerce|team (required) Type of channel.
-u, --url=url URL to the channel image. URL to channel image.
$ stream chat:channel:get
Get a specific channel by ID.
USAGE
$ stream chat:channel:get
OPTIONS
-i, --id=id (required) The channel ID you wish to get.
-t, --type=livestream|messaging|gaming|commerce|team (required) Type of channel.
$ stream chat:channel:init
Create a new channel.
USAGE
$ stream chat:channel:init
OPTIONS
-d, --data=data Additional data as a JSON.
-i, --id=id (required) [default: 1d4b7547-17ae-4956-b60e-d674a72173e0] A unique ID for the channel you wish to create.
-m, --members=members Comma separated list of members to add to the channel.
-n, --name=name (required) Name of the channel room.
-t, --type=livestream|messaging|gaming|commerce|team (required) Type of channel.
-u, --image=image URL to channel image.
$ stream chat:channel:list
List all channels associated with your config credentials.
USAGE
$ stream chat:channel:list
$ stream chat:channel:query
Query a channel.
USAGE
$ stream chat:channel:query
OPTIONS
-f, --filter=filter Filters to apply to the query.
-i, --id=id (required) The channel ID you wish to query.
-s, --sort=sort Sort to apply to the query.
-t, --type=livestream|messaging|gaming|commerce|team Type of channel.
$ stream chat:message:send
Send messages to a channel.
USAGE
$ stream chat:message:send
OPTIONS
-a, --attachments=attachments A JSON payload of attachments to send with the message.
-i, --id=id The channel ID that you would like to send a message to.
-m, --message=message (required) The message you would like to send as plaintext.
-t, --type=livestream|messaging|gaming|commerce|team (required) The type of channel.
-u, --user=user (required) [default: *] The ID of the acting user sending the message.
$ stream chat:message:remove
Remove messages from a channel.
USAGE
$ stream chat:message:remove
OPTIONS
-i, --id=id (required) The channel ID that you would like to remove.
$ stream chat:moderate:ban
Ban users from a channel indefinitely or based on a per minute timeout.
USAGE
$ stream chat:moderate:ban
OPTIONS
-r, --reason=reason (required) A reason for adding a timeout.
-t, --timeout=timeout (required) [default: 60] Duration of timeout in minutes.
-u, --user=user (required) The ID of the offending user.
$ stream chat:moderate:flag
Flag users and messages within a channel.
USAGE
$ stream chat:moderate:flag
OPTIONS
-m, --message=message The ID of the message you want to flag.
-u, --user=user The ID of the offending user.
$ stream chat:moderate:mute
Mute users within a channel.
USAGE
$ stream chat:moderate:mute
OPTIONS
-u, --user=user (required) The ID of the offending user.
$ stream chat:user:add
Add a user to a channel.
USAGE
$ stream chat:user:add
OPTIONS
-i, --id=id (required) Channel name.
-m, --moderators=moderators (required) Comma separated list of moderators to add.
-t, --type=type (required) Channel type.
$ stream chat:user:remove
Remove a user from a channel.
USAGE
$ stream chat:user:remove
OPTIONS
-i, --id=id (required) Channel name.
-m, --moderators=moderators (required) Comma separated list of moderators to remove.
-t, --type=type (required) Channel type.
📣 Feedback
If you have any suggestions or just want to let us know what you think of the Stream CLI, please send us a message at support@getstream.io or create a GitHub Issue.