Slackcat is a simple commandline utility to post snippets to Slack.
Pipe command output:
$ echo -e "hi\nthere" | slackcat --channel general --filename hello
file hello uploaded to general
Post an existing file:
$ slackcat -c general /home/user/bot.png
file bot.png uploaded to general
Download the latest release for your platform:
curl -Lo slackcat https://github.com/vektorlab/slackcat/releases/download/v0.7/slackcat-0.7-darwin-amd64
sudo mv slackcat /usr/local/bin/
sudo chmod +x /usr/local/bin/slackcat
wget https://github.com/vektorlab/slackcat/releases/download/v0.7/slackcat-0.7-linux-amd64 -O slackcat
sudo mv slackcat /usr/local/bin/
sudo chmod +x /usr/local/bin/slackcat
Generate a new Slack token with:
slackcat --configure
A new browser window will be opened for you to confirm the request via Slack, and you'll be returned a token.
Create a Slackcat config file and you're ready to go!
echo '<your-slack-token>' > ~/.slackcat
Option | Description |
---|---|
--tee, -t | Print stdin to screen before posting |
--noop | Skip posting file to Slack. Useful for testing |
--channel, -c | Slack channel or group to post to |
--filename, -n | Filename for upload. Defaults to given filename or current timestamp if reading from stdin. |