Skip to content

kukita/post-stdin-to-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Post Stdin to Slack

Post Stdin to Slackは、標準入力から受け取ったテキストをSlackチャンネルに投稿するGo言語で書かれたコマンドラインツールです
(Post Stdin to Slack is a command-line tool written in Go that posts text received from standard input to a Slack channel.)

機能 (Features)

  • 標準入力からテキストを読み取り、指定されたSlackチャンネルに投稿します
    (I read text from standard input and post it to the specified Slack channel.)
  • メッセージタイプ(Info、Success、Warning、Error)に基づいて色分けします
    (I color-code messages based on message types (Info, Success, Warning, Error).)
  • JSON設定ファイルによる簡単な設定が可能です
    (I allow easy configuration using a JSON configuration file.)
  • 詳細なログ記録オプションを提供します
    (I provide detailed logging options.)

インストール (Installation)

go get github.com/yourusername/post-stdin-to-slack

設定 (Configuration)

初回実行時に、実行ファイルと同じディレクトリにpost-stdin-to-slack.jsonという設定ファイルを作成します
(I create a configuration file named post-stdin-to-slack.json in the same directory as the executable file on first run.)

このファイルを編集して、SlackのWebhook URLやその他の設定を行ってください
(Please edit this file to configure the Slack Webhook URL and other settings.)

{
  "slack_incoming_webhooks_url": "YOUR_SLACK_INCOMING_WEBHOOKS_URL",
  "slack_bot_name": "ChatOps Bot",
  "slack_bot_icon": ":loudspeaker:",
  "slack_channel": "#general",
  "log_enabled": false,
  "log_level": "INFO"
}

使用方法 (Usage)

echo "Hello, Slack!" | post-stdin-to-slack -message "Greeting" -type Info

オプション (Options)

  • -message: 投稿するメッセージのタイトルです(必須)
    (The title of the message to post (required).)
  • -type: メッセージのタイプです(Info、Success、Warning、Error)(デフォルト: Info)
    (The type of the message (Info, Success, Warning, Error) (default: Info).)

ログ (Logging)

ログを有効にするには、設定ファイルのlog_enabledtrueに設定してください
(To enable logging, set log_enabled to true in the configuration file.)

ログファイルは実行ファイルと同じディレクトリにpost-stdin-to-slack.logという名前で作成します
(I create a log file named post-stdin-to-slack.log in the same directory as the executable file.)

ライセンス (License)

このプロジェクトはApache License 2.0のもとで公開しています
(I release this project under the Apache License 2.0.)

詳細はLICENSEファイルをご覧ください
(Please see the LICENSE file for details.)

貢献 (Contributing)

バグ報告や機能リクエストは、GitHubのIssueでお願いします
(Please submit bug reports and feature requests through GitHub Issues.)

Pull Requestも歓迎します
(I also welcome Pull Requests.)

作者 (Author)

Keisuke Kukita

About

This program posts Std-In to the specified Slack channel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages