https://github.com/jmurray2011/heka
The intent of this app is to have a simple, cross-platform binary that allows for messaging to a specified Slack channel. This can be used manually but the goal is something that can alert in automated workflows (like AWS servers booting up or terminating, etc.)
https://github.com/jmurray2011/heka
go golang slack
Last synced: 5 months ago
JSON representation
The intent of this app is to have a simple, cross-platform binary that allows for messaging to a specified Slack channel. This can be used manually but the goal is something that can alert in automated workflows (like AWS servers booting up or terminating, etc.)
- Host: GitHub
- URL: https://github.com/jmurray2011/heka
- Owner: jmurray2011
- Created: 2021-12-22T05:08:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-26T00:12:53.000Z (about 3 years ago)
- Last Synced: 2024-06-19T23:14:59.002Z (about 2 years ago)
- Topics: go, golang, slack
- Language: Go
- Homepage:
- Size: 101 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
heka
A simple Slack message tool for the CLI written in Go
Report Bug
·
Request Feature
Table of Contents
## About The Project
This is my first Go project! I'm sure there are 1000 others like it, but this one is mine.
The intent of this app is to have a simple, cross-platform binary that allows for messaging to a specified Slack channel. This can be used manually but the goal is something that can alert in automated workflows (like AWS servers booting up or terminating, etc.)
This is currently only using Incoming Webhooks, so there is no ```oath``` authentication, etc. I will likely add more features, such as the ability to attach files, in the future. For now, no tokens are needed by the project, just an Incoming Webhook URL for each channel you want to talk to.
### Built With
* [Go](https://go.dev/)
* [slack-go/slack](https://github.com/slack-go/slack)
## Getting Started
First you will need access to a Slack workspace that you have permissions to build an App on.
Follow the [Slack instructions](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack) on creating a Slack app with access to Incoming Webhooks, then create an Incoming Webhook for the channel(s) you'd like heka to talk to. Make note of the Webhook URLs as you will need to populate the config file with them later.
### Installation
1. Clone the repo
```git clone https://github.com/jmurray2011/heka.git```
2. Build the project
```go build```
3. From inside the project directory, run ```./heka init``` to generate a config file
4. Edit the generated config file with the appropriate information (channel name and webhook URL from Slack)
1. running ```./heka init``` will output the location of the ```.heka.toml``` config file for your OS (Windows or Linux)
## Usage
#### Create a config file (should work for both Linux and Windows):
```./heka init```
#### Send a message to a channel
```./heka says -m "your message here" -c "your channel here"```
#### Optionally specify a different config file
```./heka says -m "your message here" -c "your channel here" --config /path/to/custom/config/.file.toml```
#### Send piped output as a message
```echo "Hello, World!" | ./heka says -c example```
## Roadmap
- [] Add ability to add/remove channels from the CLI instead of manually editing the config
- [] Add message templates to allow for custom message formats instead of the default
- [] Further integrate with Slack API for more functionality
- [] List channels and optionally import them to config
- [] Generate Incoming Webhook URLs on-the-fly
- [] Add ability to attach files to messages
See the [open issues](https://github.com/jmurray2011/heka/issues) for a full list of proposed features (and known issues).
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## License
Distributed under the MIT License. See `LICENSE` for more information.
## Contact
Josh Murray - jmurray2011@gmail.com
Project Link: [https://github.com/jmurray2011/heka](https://github.com/jmurray2011/heka)