Giter VIP home page Giter VIP logo

slackcat's Introduction

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.0/slackcat-1.0-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.0/slackcat-1.0-linux-amd64 -O slackcat
sudo mv slackcat /usr/local/bin/
sudo chmod +x /usr/local/bin/slackcat

Configuration

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

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 as a formatted message:

$ 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
--plain, -p When streaming, write messages as plain text instead of code blocks
--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

slackcat's People

Contributors

bcicen avatar lindgrenj6 avatar dataf3l avatar jamespullar avatar khaelou avatar nicwaller avatar akngs avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.