Skip to content

Slack upload CLI tool using 'files.getUploadURLExternal' and 'files.completeUploadExternal'

License

Notifications You must be signed in to change notification settings

pyar6329/slack-upload-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!"

About

Slack upload CLI tool using 'files.getUploadURLExternal' and 'files.completeUploadExternal'

Resources

License

Stars

Watchers

Forks

Packages

No packages published