Send message to Slack channel in cli as a Slack app.
- Python 3.6+
- Slack App OAuth Access Token
$ slack --help
Usage: slack [OPTIONS] [SOMETHING]...
Options:
-t, --target TEXT Post message to target channel
-u, --user TEXT Send as user [USER]
-c, --config FILENAME Path to config file
--help Show this message and exit.
$ pip3 install git+ssh://[email protected]/reverbc/slack-cli.git
$ pipsi install --python python3.6 git+ssh://[email protected]/reverbc/slack-cli.git
- Copy
slack-cli.json.template
to~/.slack-cli.json
- Create Slack App
- Go to https://api.slack.com/apps?new_app=1 to create a new app
- After creation, go directly to Features/OAuth & Permissions page
- Add the following scopes
channels:read
chat:write:bot
- Install Slack app to your workspace
- Under Features/OAuth & Permissions page, copy the OAuth Access Token and put to
TOKEN
of~/.slack-cli.json
- (Optional) Limit available channels in
CHANNELS
of~/.slack-cli.json
- Say hello, world
$ slack hello, world!