![Stream Cli](https://i.imgur.com/H8AScTq.png)
Stream Chat CLI
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.
![License](https://img.shields.io/npm/l/stream-cli.svg)
📌 Requirements
Only Node 8+ is supported. Node 6 will reach end-of-life April 2019. At that point we will continue to support the current LTS version of node. You can add the node package to your CLI to ensure users are on Node 8.
🗒 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 with zero run-time dependencies for your OS of choice, or install the CLI using NPM.
Homebrew (macOS only)
$ brew install stream-cli
Binaries
Note: Binaries are generally updated less frequently than Homebrew and NPM sources.
NPM
$ npm install -g getstream-cli
🚀 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
$ 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
Initialize, retrieve, and destroy configuration settings (for the CLI)
Manages the configuration file for Stream CLI
USAGE
$ stream config:COMMAND
COMMANDS
config:destroy Destroy config
config:get Get config
config:set Initialize the config with your Stream API key and secret
$ 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 channel:edit
Edit a specified channel
USAGE
$ stream channel:edit
OPTIONS
-d, --data=data Additional data as a JSON payload.
-i, --id=id (required) Channel ID.
-m, --members=members Comma separated list of members.
-n, --name=name (required) Name of 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 channel image.
$ stream channel:get
Get a specified channel
USAGE
$ stream channel:get
OPTIONS
-i, --id=id (required) Channel ID.
-t, --type=livestream|messaging|gaming|commerce|team (required) Type of channel.
$ stream channel:init
Initialize a new channel
USAGE
$ stream channel:init
OPTIONS
-d, --data=data Additional data as a JSON payload.
-i, --id=id (required) [default: <UUID>] Channel ID.
-m, --members=members Comma separated list of members.
-n, --name=name (required) Name of room.
-t, --type=livestream|messaging|gaming|commerce|team (required) Type of channel.
-u, --image=image URL to channel image.
$ stream channel:list
List all channels associated with your account
USAGE
$ stream channel:list
$ stream channel:query
Query for channels
USAGE
$ stream channel:query
OPTIONS
-f, --filter=filter Filters to apply.
-i, --id=id [default: <UUID>] Channel ID.
-s, --sort=sort Sort to apply.
-t, --type=livestream|messaging|gaming|commerce|team Type of channel.
$ stream message:send
Send a message to a specific channel
USAGE
$ stream message:send
OPTIONS
-a, --attachments=attachments JSON payload of attachments
-i, --id=id [default: <UUID>] Channel ID.
-m, --message=message (required) Message to send.
-t, --type=livestream|messaging|gaming|commerce|team (required) Type of channel.
-u, --user=user (required) [default: *] ID of user.
$ stream message:remove
Remove a message from a channel
USAGE
$ stream message:remove
OPTIONS
-i, --id=id (required) Channel ID.
$ stream moderate:ban
Ban a user from a channel forever or based on a per minute timeout
USAGE
$ stream moderate:ban
OPTIONS
-r, --reason=reason (required) Reason for timeout.
-t, --timeout=timeout (required) [default: 60] Timeout in minutes.
-u, --user=user (required) ID of user.
$ stream moderate:flag
Flag users and messages for inappropriate behavior or explicit content
USAGE
$ stream moderate:flag
OPTIONS
-m, --message=message ID of message.
-u, --user=user ID of user.
$ stream moderate:mute
Mute a user in a channel
USAGE
$ stream moderate:mute
OPTIONS
-u, --user=user (required) User ID.
$ stream user:add
Add a user to a channel and specify permissions
USAGE
$ stream 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 user:remove
Remove a user from a channel
USAGE
$ stream 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.