https://github.com/anthonyringoet/node-slack-webhook-cli
🎉 CLI to send messages to Slack by using their lightweight incoming webhooks API
https://github.com/anthonyringoet/node-slack-webhook-cli
cli javascript node slack webhook
Last synced: 5 months ago
JSON representation
🎉 CLI to send messages to Slack by using their lightweight incoming webhooks API
- Host: GitHub
- URL: https://github.com/anthonyringoet/node-slack-webhook-cli
- Owner: anthonyringoet
- License: mit
- Created: 2015-07-16T15:29:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-02T06:10:42.000Z (about 9 years ago)
- Last Synced: 2025-08-18T03:40:03.634Z (10 months ago)
- Topics: cli, javascript, node, slack, webhook
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-webhook-cli
[](https://github.com/feross/standard)
> A command line interface to send messages to Slack by using their lightweight incoming webhooks API. You never need to authenticate as an actual Slack user to use this interface.
## Installation
```bash
$ npm i slack-webhook-cli -g
# this should make the `slack-hook` command globally available
```
## Configuration
Configuration can be handled using environment variables or command line options.
From least to most heavy for overruling eachother:
- Internal defaults
- Environment variables
- `SLACK_WEBHOOK_CLI_URL`
- `SLACK_WEBHOOK_CLI_CHANNEL`
- `SLACK_WEBHOOK_CLI_EMOJI`
- `SLACK_WEBHOOK_CLI_USERNAME`
- Command line options
- `-m`: message __required__ when sending
- `-w`: webhook url
- `-c`: channel
- `-e`: emoji
- `-u`: username
#### Setting environment variables
You can use environment variables for your default options.
```bash
$ export SLACK_WEBHOOK_CLI_USERNAME=sl4ckb0t
```
## Commands
### setup
Verifies your setup and shows your active options given your input.
```bash
$ slack-hook setup
# actual example
$ slack-hook setup -c "#foobar" -e ":panda_face:"
# With the current input your resulting options are:
# url: 'https://hooks.slack.com/services/sdfq51dsf1s251/561sdfq/sdf51q51sdf20sdf1ds1f5'
# channel: '#foobar'
# icon_emoji: ':panda_face:'
# username: 'slack-webhook-bot'
```
### send
```bash
$ slack-hook send -m "Something happened" -c "#beep"
# Sent: "Something happened" to #beep
```