
In this tutorial, we’ll learn about how we can send messages to Slack via the Command Line. Slack is an extremely popular collaboration tool due to its amazing set of integrations. The tool we’ll use today does not need any integration however, it only requires your personal Slack Token. Let’s get started.
Installation
The tool we’ll be using is call Slack-Cli, If you have NPM or Node installed, you can get this tool with a simple
note the -g global flag, this will make the slackcli command available globally anywhere from the command line.
NPM + Slack Case Study Design – Michael Stevens This piece shows NPM’s symbiotic relationship with Slack—a communication platform now used by over 65% of companies in the Fortune 500. A slack bot that publishes messages when npm packages are published. The server.js script can be run from node.js, but requires three parameters given by environment variables. NPMPACKAGES is a comma-delimited list of npm package names to report on.; SLACKCHANNEL is the destination channel to report to. (e.g., #foo) SLACKWEBHOOKURL is the slack-provided incoming. 📦 Opinionated NPM publish program. Published helps streamline a git based workflow with package publishing through continues delivery. Developers control their branch and version strategies, and published takes care of logical conditioning of when to publish stable versions and/or release candidates.
Npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. It is extremely configurable to support a variety of use cases. Slack Events API. The @slack/events-api package helps your app respond to events from Slack's Events API such as new messages, emoji reactions, files, and much more. This package will help you start with convenient and secure defaults.

Usage
Npm Slack Download
First we need to get our slack token from https://api.slack.com/custom-integrations/legacy-tokens, this is the only thing you’ll need to make this work. Now head over to the command line and send a message to Slack with:
replace your token for the -t value. You should now see a message from user name Pentacode in your Slack channel! It’s that simple. Now I don’t want to send/type my token every time I send a message, so I am going to store my token as a value somewhere, for the sake of simplicity, I will store it as a command line variable:
now you can simplify the above command as:
Npm Slack Client
looks much better!
This tool has more options for you to customize your message, you can even attach a file to it, this means you can build literately anything you want with this tool, perhaps a bot? 🙂


I hope you enjoy this quick little tutorial and find the tool useful.
Npm Slack Client
If you enjoyed this tutorial, make sure to subscribe to our Youtube Channel and follow us on Twitter @pentacodevids for latest updates!
