Is there a command line interface for slack? [closed]
Solution 1:
There is no full-fledged command line interface that I know of, but there is an API, so in principle anybody could start writing one. Slackcat is a first step in that direction.
A potential alternative approach might be installing a text-mode IRC or XMPP client on your servers, and using the Slack/IRC/XMPP gateway.
EDIT/UPDATE: This answer is clearly outdated now – see the comments and other answers.
Solution 2:
I use this one. Try https://github.com/candrholdings/slack-cli
To install, type
npm install -g slack-cli
To send a message,
slackcli -t <Slack token> -g <Slack group name> -m "Hello, World!"
To send a file,
slackcli -t <Slack token> -g <Slack group name> -f <File name>
To send from standard input,
cat anyFile.txt | slackcli -t <Slack token> -g <Slack group name> -c
You can even set the token as environment variable.
SET SLACK_TOKEN=<Slack token>
slackcli -g yourGroupName -m "Hello, World!"
Solution 3:
Here's Slacker, a CLI for Slack using PHP. You'll need your own Slack api token and adjust the configs: https://github.com/TidalLabs/Slacker