Linux command
slackcat 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run first-time OAuth setup
slackcat --configure
Send a one-shot message
slackcat -c [channel] -m "[hello]"
Pipe stdin
[command] | slackcat -c [channel]
Upload a file
slackcat -c [channel] [file.txt]
Override the upload filename / filetype
slackcat -c [channel] -n [log.py] --filetype [python] [file.py]
Also print to stdout
[command] | slackcat -c [channel] --tee
Stream tail output
tail -f [/var/log/app.log] | slackcat -c [channel] --stream
Dry run
[command] | slackcat -c [channel] --noop
Use a different profile
slackcat -p [profile] -c [channel] [file]
说明
pipe command output and files to Slack channels
参数
- -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.
FAQ
What is the slackcat command used for?
pipe command output and files to Slack channels
How do I run a basic slackcat example?
Run `slackcat --configure` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c, --channel _CHANNEL_ do in slackcat?
Target channel (public/private) or group. Required unless set in config.