Skip to content

Pipe STDIN To Slack From The Command Line

License

Notifications You must be signed in to change notification settings

talkquazi/slackcat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlackCat

Pipe STDIN To Slack From The Command Line

Installing

npm install -g slackcat

Command Line Arguments (optional)

Output Channel ( Defaults to general )

-f general

Bot Name ( Defaults to Bot )

-n Bot

Bot Icon ( Defaults to computer )

-i :computer:

Environment Variables (required)

REQUIRED: Slack API Token ( see: https://my.slack.com/services/new/bot )

SLACKCAT_API_TOKEN = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

OPTIONAL: "Bot Channel"

SLACKCAT_CHANNEL = general

OPTIONAL: "Bot Name"

SLACKCAT_USERNAME = Bot

OPTIONAL: "Bot Icon"

SLACKCAT_ICON = :computer:

Usage

From The Command Line:

Say Hello Slack World! in the general channel.

echo "Hello Slack World!" | slackcat

Say Welcome To The Channel! in the welcome channel when you run this command

echo "Welcome To The Channel!" | slackcat -f welcome

Use all the command line options to ask Who Wants Cake? in the party channel with the 🍰 icon and use the name Chef.

echo "Who Wants Cake?" | slackcat -f party -i :cake: -n Chef

Further Reading

Facts:

  • This module is heavily inspired by and loosely based off of the python module slackcat.
  • A 10 second delay occurs before slackcat will exit after the STDIO is closed. This gives the bot time to send the data to slack before exiting.
  • Feature requests will not be taken but bug related issues will be addressed.
  • No cats were harmed in the making of this module.
  • Less than 1 cup of coffee and 2 hours of time was used in making this module
  • You can run this module with nodejs to output errors to slack. example: node server.js | slackcat

License

MIT

About

Pipe STDIN To Slack From The Command Line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%