Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.37 KB

File metadata and controls

54 lines (36 loc) · 1.37 KB

Slack upload CLI

See: files.upload retires in March 2025, replaced by sequenced Web API methods

files.upload API was replaced to files.getUploadURLExternal and files.completeUploadExternal.

However, those new APIs are complex and not easy to use with curl. So, I made this small CLI tool to upload files to Slack.

Download

$ curl -sL -o suc https://github.com/pyar6329/slack-upload-cli/releases/download/1.0.1/suc-$(uname -s)-$(uname -m)
$ chmod +x suc
$ ./suc --help

Please move suc command to PATH directory.

Usage

Usage: suc [OPTIONS]

Options:
  -u, --upload <FILE_PATH>   upload file to slack. Please set path of a file.
  -s, --send <SEND_MESSAGE>  send a message to slack. Please set message text.
  -h, --help                 Print help
  -V, --version              Print version

Environment Variables

please set below environment variables

export SLACK_API_TOKEN="xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-"
export SLACK_CHANNEL_ID="C12345678"

Upload a file

run the command

$ suc -u /path/to/file

Send a message

run the command

$ suc -s "Hello, World!"