Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcicen/slackcat
CLI utility to post files and command output to slack
https://github.com/bcicen/slackcat
cli commandline slack slackapi
Last synced: 25 days ago
JSON representation
CLI utility to post files and command output to slack
- Host: GitHub
- URL: https://github.com/bcicen/slackcat
- Owner: bcicen
- License: mit
- Created: 2015-12-30T18:46:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-23T09:19:20.000Z (4 months ago)
- Last Synced: 2024-10-01T13:41:43.335Z (about 1 month ago)
- Topics: cli, commandline, slack, slackapi
- Language: Go
- Homepage: http://slackcat.chat
- Size: 139 KB
- Stars: 1,217
- Watchers: 22
- Forks: 57
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - bcicen/slackcat - CLI utility to post files and command output to slack (Go)
- WebHackersWeapons - slackcat
README
# slackcat
Slackcat is a simple commandline utility to post snippets to Slack.
## Installing
Download the [latest release](https://github.com/bcicen/slackcat/releases) for your platform:```bash
curl -Lo slackcat https://github.com/bcicen/slackcat/releases/download/1.7.2/slackcat-1.7.2-$(uname -s)-amd64
sudo mv slackcat /usr/local/bin/
sudo chmod +x /usr/local/bin/slackcat
````slackcat` is also available via homebrew:
```brew
brew install slackcat
```## Building
To optionally build `slackcat` from source, ensure you have [dep](https://github.com/golang/dep) installed and run:
```
go get github.com/bcicen/slackcat && \
cd $GOPATH/src/github.com/bcicen/slackcat && \
make build
```You must use GNU make for the build to work correctly. If your platform does not install GNU make as `make` (i.e. OpenBSD) then you will need to install gmake and run:
```
go get github.com/bcicen/slackcat && \
cd $GOPATH/src/github.com/bcicen/slackcat && \
gmake build
```## Configuration
Generate an initial config, or add a new team token with:
```bash
slackcat --configure
```
You'll be prompted for a team nickname and a new browser window will be opened for you to confirm the request via Slack. Provide the returned token to slackcat when prompted, and you're ready to go!For configuring multiple teams and default channels, see [Configuration Guide](https://github.com/bcicen/slackcat/blob/master/docs/configuration-guide.md).
## Usage
Pipe command output as a text snippet:
```bash
$ echo -e "hi\nthere" | slackcat --channel general --filename hello
*slackcat* file hello uploaded to general
```Post an existing file:
```bash
$ slackcat --channel general /home/user/bot.png
*slackcat* file bot.png uploaded to general
```Stream input continuously:
```bash
$ tail -F -n0 /path/to/log | slackcat --channel general --stream
*slackcat* posted 5 message lines to general
*slackcat* posted 2 message lines to general
...
```## Options
Option | Description
--- | ---
--tee, -t | Print stdin to screen before posting
--stream, -s | Stream messages to Slack continuously instead of uploading a single snippet
--noop | Skip posting file to Slack. Useful for testing
--configure | Configure Slackcat via oauth
--iconemoji, -i | Specify emoji icon for message (e.g. ":+1:")
--channel, -c | Slack channel, group, or user to post to
--filename, -n | Filename for upload. Defaults to given filename or current timestamp if reading from stdin
--filetype | Specify filetype for syntax highlighting. Defaults to autodetect
--comment | Initial comment for snippet
--username | Stream messages as given bot user. Defaults to auth user
--thread | Stream messages to thread after initial comment message