https://github.com/dssg/slack-report
report output of command to slack channel
https://github.com/dssg/slack-report
Last synced: 6 months ago
JSON representation
report output of command to slack channel
- Host: GitHub
- URL: https://github.com/dssg/slack-report
- Owner: dssg
- License: bsd-3-clause
- Created: 2020-02-11T16:18:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T22:40:47.000Z (about 3 years ago)
- Last Synced: 2025-09-29T15:28:05.671Z (10 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= slack-report
Report the results of executing the specified command to Slack.
== Use
The basic interface of `slack-report` is the same as `sudo`, `time`, `watch`, _etc._:
slack-report COMMAND
Any executable command, as well as its arguments, are accepted, and executed.
For example:
slack-report --channel=ops --title="uptime report" time annotate ./tps-reports.sh
The above would execute `time` (most likely `/usr/bin/time`), passing it the arguments `annotate ./tps-reports.sh` (such that these would be executed as well). The resulting standard output and error would be uploaded to Slack, and shared in the "ops" channel, with the title: "uptime report."
For the complete interface, consult `slack-report --help`.
== Installation
`slack-report` is available from https://pypi.org/project/slack-report/[PyPI] and https://github.com/dssg/slack-report[GitHub].
To install via `pip`:
pip install slack-report
== Configuration
In addition to its command flags, `slack-report` may be configured via the shell/process environment.
A Slack API token is *required*. This may be provided either via command flag `--token` or environment variable `SLACK_API_TOKEN`.
The API token requires permission:
* to post the results file: `files:write`
* to look up requested channels by name: `channels.read`