Is there a command line interface for slack?

48

8

I am a user of slack https://slack.com/

I think the desktop client is useful, but sometimes I am working on servers. There is also a browser interface and android and iPhone Clients. My objective is to read and write messages form a command line, for example inside a server environment.

So is there a command line interface frontend for slack?

Alojz Janez

Posted 2014-04-28T23:27:57.560

Reputation: 691

Question was closed 2015-05-17T19:18:31.167

Can we migrate this to https://softwarerecs.stackexchange.com/?

– d4nyll – 2018-02-05T15:11:31.177

Answers

13

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.

d0gb3r7

Posted 2014-04-28T23:27:57.560

Reputation: 281

There is a basic client called Yfiton: https://github.com/yfiton/yfiton

– Laurent – 2016-01-11T20:06:50.883

2

There is also slacktee, which runs from the command line and the only requirement is curl: https://github.com/course-hero/slacktee

– ltn100 – 2016-07-01T10:47:29.470

1If you're just looking to send a simple message, you're probably better off using Slack's incoming webhook and curl. No cli necessary. – brianpeiris – 2017-07-14T10:52:39.290

22

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!"

Juan Kris

Posted 2014-04-28T23:27:57.560

Reputation: 221

Does this support attachments? – Michael – 2016-10-21T02:27:14.053

2

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

jojo

Posted 2014-04-28T23:27:57.560

Reputation: 121

2

A possible alternative: https://github.com/erroneousboat/slack-term

– 0x4a50 – 2018-01-29T10:39:57.763