/slack-post-cli

JAR command-line app to post message to slack channel

Primary LanguageJava

Build Status

Description

The main motivation of this jar program is to be used within cli environment to post build status message to slack channel. Though however it could be used in any purposes as seem to fit.

How to use

  • Download latest release of jar file from here
  • Before running the jar, please make sure to configure below environment variables:
    • SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxxxx/xxxxx/xxxxxxx
    • SLACK_TOKEN=xoxp-xxxxxxxxxxxxxx
  • Run the jar file like below:
    • java -jar slack-cli-0.0.1.jar

Example

  • Simple text message:
java -jar slack-cli-0.0.1.jar --channel dev --message "test message"
  • Text message with attachment:
java -jar slack-cli-0.0.1.jar --channel dev --message "test message" --file ./demo.txt