Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twobucks/slack-message
Send Slack messages from terminal.
https://github.com/twobucks/slack-message
Last synced: 3 months ago
JSON representation
Send Slack messages from terminal.
- Host: GitHub
- URL: https://github.com/twobucks/slack-message
- Owner: twobucks
- License: mit
- Created: 2016-10-14T17:13:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-14T08:30:17.000Z (over 5 years ago)
- Last Synced: 2024-10-31T18:36:48.158Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 60.5 KB
- Stars: 44
- Watchers: 5
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slack Message
[](https://travis-ci.org/twobucks/slack-message) [](https://github.com/sindresorhus/xo) [](https://npmjs.org/package/slack-message)

Send messages from your terminal directly to the Slack channel. The idea for this was published in [mikaelbr/open-source-ideas](https://github.com/mikaelbr/open-source-ideas/issues/2).
Common use cases for this package are:
* get a Slack notification when a CI server finishes its work
* get a Slack notification when a deployment is complete
* get a Slack notification when any other process exits## Install
```
$ npm i slack-message -g
```## Usage
You will need a working token. The easiest way to get a testing one is [api.slack.com/web](https://api.slack.com/web).
If you need a live token please follow the instructions about oAuth [api.slack.com/docs/oauth](https://api.slack.com/docs/oauth).```
$ slack-messageUsage: slack-message [options] <#channel | @user>
Options:
-h, --help output usage information
-V, --version output the version number
-t, --token token to use, reads SLACK_TOKEN if provided
-s, --save-token saves token for later use
```## Examples
Sending a message with inline token
```
$ slack-message -t token-123-321 #factory "I need some pancakes folks"
```Sending a message and saving the token for a later use
```
$ slack-message -t token-123-321 -s #factory "really, I need pancakes"
```Sending a direct message to a user
```
$ slack-message -t token-123-321 -s @chef "awesome pancakes!"
```If you have a saved token
```
$ slack-message #general "send pancakes and hurry"
```You can also pass an ENV variable
```
$ SLACK_TOKEN=token slack-message #random "I'm hungry"
```## Alternatives
* [slack](https://github.com/smallwins/slack) - Slack API console for Node and the browser
* [slack-cli](https://github.com/candrholdings/slack-cli) - Slack CLI interface for various API endpoints## License
MIT
## Sponsors
Two Bucks Ltd © 2016
[](https://twobucks.co)