LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

slackcat

pipe command output and files to Slack channels

TLDR

Run first-time OAuth setup
$ slackcat --configure
copy
Send a one-shot message to a channel
$ slackcat -c [channel] -m "[hello]"
copy
Pipe stdin into Slack as a snippet
$ [command] | slackcat -c [channel]
copy
Upload a file
$ slackcat -c [channel] [file.txt]
copy
Override the upload filename / filetype
$ slackcat -c [channel] -n [log.py] --filetype [python] [file.py]
copy
Also print to stdout (tee mode)
$ [command] | slackcat -c [channel] --tee
copy
Stream tail output into Slack
$ tail -f [/var/log/app.log] | slackcat -c [channel] --stream
copy
Dry run (don't actually post)
$ [command] | slackcat -c [channel] --noop
copy
Use a different profile from the config file
$ slackcat -p [profile] -c [channel] [file]
copy

SYNOPSIS

slackcat [-c channel] [-m message] [options] [file]

PARAMETERS

-c, --channel CHANNEL

Target channel (public/private) or group. Required unless set in config.
-m, --message TEXT
Post TEXT as a message (don't read stdin or file).
-n, --filename NAME
Override the filename shown in Slack when uploading a snippet.
--filetype TYPE
Explicit Slack filetype for syntax highlighting (`python`, `shell`, `javascript`, …). Useful when piping stdin.
--comment TEXT
Initial comment attached to a snippet upload.
-p, --profile NAME
Use a specific profile from the slackcat config file.
--tee
Copy input to stdout as well as to Slack.
--stream
Treat input as a live stream; keep posting updates as new data arrives instead of buffering a single snippet.
--noop
Do not actually upload; print what would be sent.
--configure
Run interactive OAuth configuration to create/update the slackcat config.
-h, --help
Show help.
-v, --version
Show version.

CONFIGURATION

~/.slackcat

INI-style config with `[default]` and named profile sections. Keys include `token`, `team`, `default_channel`.
Slack tokens must have `files:write`, `chat:write`, and related scopes. `slackcat --configure` walks through OAuth to set these.

CAVEATS

Requires a Slack app / user token. Slack rate-limits uploads and chat messages (tier-dependent). Very large files or high-frequency streams may hit the 1 MB/message snippet limit — `--stream` rotates to a new snippet when that happens.

HISTORY

slackcat was created by Bradley Cicenas (`bcicen`) and is written in Go. Source: github.com/bcicen/slackcat.

SEE ALSO

curl(1), tee(1), jq(1)

Copied to clipboard
Kai