Skip to content

reverbc/slack-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-cli

Send message to Slack channel in cli as a Slack app.

Prerequisites

  • Python 3.6+
  • Slack App OAuth Access Token

Usage

$ 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.

Installation

Pip

$ pip3 install git+ssh://[email protected]/reverbc/slack-cli.git
$ pipsi install --python python3.6 git+ssh://[email protected]/reverbc/slack-cli.git

How-To

  1. Copy slack-cli.json.template to ~/.slack-cli.json
  2. Create Slack App
    1. Go to https://api.slack.com/apps?new_app=1 to create a new app
    2. After creation, go directly to Features/OAuth & Permissions page
    3. Add the following scopes
      • channels:read
      • chat:write:bot
    4. Install Slack app to your workspace
  3. Under Features/OAuth & Permissions page, copy the OAuth Access Token and put to TOKEN of ~/.slack-cli.json
  4. (Optional) Limit available channels in CHANNELS of ~/.slack-cli.json
  5. Say hello, world
$ slack hello, world!

About

Send Slack message in cli

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published