https://github.com/jhjaggars/slack-pb
slack-pb is a simple script for pasting contents of files to the slack file upload service.
https://github.com/jhjaggars/slack-pb
cli python slack
Last synced: about 2 months ago
JSON representation
slack-pb is a simple script for pasting contents of files to the slack file upload service.
- Host: GitHub
- URL: https://github.com/jhjaggars/slack-pb
- Owner: jhjaggars
- License: apache-2.0
- Created: 2017-04-25T23:15:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T20:32:45.000Z (about 9 years ago)
- Last Synced: 2025-06-12T21:54:45.969Z (about 1 year ago)
- Topics: cli, python, slack
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
slack-pb
========
slack-pb is a simple script for pasting contents of files to the slack file
upload service.
Usage
=====
There are two ways to use the tool:
```
pb.py
```
Will send the contents of `filename` to slack. You can share it with a channel
or user with the `--channels` option.
```
pb.py --channels #my_channel frank
```
If you want to use options and place the file at the end of the command you can
do that too:
```
pb.py --channels #jokes bob --
```
The above will share the upload with `#my_channel` and `frank`
You can also pipe content in via stdin:
```
cat my_super_cool_file | pb.py -
```
Configuration
=============
The script requires a [slack legacy api
key](https://api.slack.com/custom-integrations/legacy-tokens). The script
expects the key to be stored in `~/.slack-token`.
The first time you specify a non-channel in the `--channels` option the script
will fetch a list of users known to you and cache the results in
`~/.slack-users.json`.