slackcat

command module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 16 Imported by: 0

README

slackcat

Slackcat is a simple commandline utility to post snippets to Slack.

slackcat

Quickstart

Installing

Download the latest release for your platform:

OS X
brew install slackcat

or

curl -Lo slackcat https://github.com/vektorlab/slackcat/releases/download/v1.2/slackcat-1.2-darwin-amd64
sudo mv slackcat /usr/local/bin/
sudo chmod +x /usr/local/bin/slackcat
Linux
wget https://github.com/vektorlab/slackcat/releases/download/v1.2/slackcat-1.2-linux-amd64 -O slackcat
sudo mv slackcat /usr/local/bin/
sudo chmod +x /usr/local/bin/slackcat
Configuration

Generate an initial config, or add a new team token with:

slackcat --configure

You'll be prompted for a team nickname and a new browser window will be opened for you to confirm the request via Slack. Provide the returned token to slackcat when prompted, and you're ready to go!

For configuring multiple teams and default channels, see Configuration Guide.

Usage

Pipe command output as a text snippet:

$ echo -e "hi\nthere" | slackcat --channel general --filename hello
*slackcat* file hello uploaded to general

Post an existing file:

$ slackcat --channel general /home/user/bot.png
*slackcat* file bot.png uploaded to general

Stream input continously:

$ tail -F -n0 /path/to/log | slackcat --channel general --stream
*slackcat* posted 5 message lines to general
*slackcat* posted 2 message lines to general
...

Options

Option Description
--tee, -t Print stdin to screen before posting
--stream, -s Stream messages to Slack continuously instead of uploading a single snippet
--noop Skip posting file to Slack. Useful for testing
--configure Configure Slackcat via oauth
--channel, -c Slack channel, group, or user to post to
--filename, -n Filename for upload. Defaults to given filename or current timestamp if reading from stdin
--filetype Specify filetype for synax highlighting. Defaults to autodetect
--comment Initial comment for snippet

Documentation

Overview

output/err convenience methods

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL