Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/csabapalfi/slackcat
Post to Slack from stdin
https://github.com/csabapalfi/slackcat
Last synced: 24 days ago
JSON representation
Post to Slack from stdin
- Host: GitHub
- URL: https://github.com/csabapalfi/slackcat
- Owner: csabapalfi
- Created: 2017-04-19T12:33:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T12:12:36.000Z (about 6 years ago)
- Last Synced: 2024-06-20T19:15:15.129Z (5 months ago)
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# slackcat
Post to Slack from stdin.
## installation
Grab the [latest release from Github](https://github.com/csabapalfi/slackcat/releases/latest).
## usage
### simple usage
```sh
echo "hello" | slackcat -channel=$YOUR_CHANNEL
```### use token from environment variable (default)
```sh
export SLACK_TOKEN=$SLACK_TOKEN
echo "hello" | slackcat -channel=$YOUR_CHANNEL
```### use token from command line flag
```sh
echo "hello" | slackcat -channel=$YOUR_CHANNEL -token=$SLACK_TOKEN
```### treat stdin as a [Slack attachment](https://api.slack.com/docs/message-attachments)
```sh
cat attachment.json | slackcat -channel=$YOUR_CHANNEL -attachment
```
Check out the [Slack Message Builder](https://api.slack.com/docs/messages/builder) to give you an idea. Also please find some simple example JSON below:
```json
{
"fallback": "Required plain-text summary of the attachment.",
"color": "#36a64f",
"title": "Slack API Documentation",
"title_link": "https://api.slack.com/",
"text": "Optional text that appears within the attachment",
}
```### tee stdin to stdout and Slack
```sh
echo "hello" | slackcat -channel=$YOUR_CHANNEL -tee
```### verbose output (print slack API response)
```sh
echo "hello" | slackcat -channel=$YOUR_CHANNEL -v
```## why?
There are lots of repos named slackcat (written in Go even).
The one I tried didn't work and it seemed too simple to implement hence the re-write.