Slackが流行っていることもあって、情報をどんどんSlack上にアップしていこうという流れになっています。外部のWebサービスもSlack連携のものが増えてきました。 今回紹介するのはSlackcat、コンソールとSlackを連携させるソフトウェアです。スクリプトの出力結果をSlack上にポストします。

Slackcatの使い方

Slackcatは標準出力などをそのままパイプで渡せばいいだけです。結果はこんな感じでファイルとしてポストしてくれます。

コマンドのヘルプです。ストリームにも対応しています。

$ slackcat --help
NAME:
   slackcat - redirect a file to slack

USAGE:
   slackcat [global options] command [command options] [arguments...]
   
VERSION:
   0.8
   
COMMANDS:
   help, h	Shows a list of commands or help for one command
   
GLOBAL OPTIONS:
   --tee, -t		Print stdin to screen before posting
   --stream, -s		Stream messages to Slack continuously instead of uploading a single snippet
   --noop		Skip posting file to Slack. Useful for testing
   --configure		Configure Slackcat via oauth
   --channel, -c 	Slack channel or group to post to
   --filename, -n 	Filename for upload. Defaults to current timestamp
   --help, -h		show help
   --version, -v	print the version

Slackcatを使えばコマンドの実行結果をそのままアップロードしたり、自社システムとSlackを連携させるのが容易になるのではないでしょうか。

SlackcatはGo製のオープンソース・ソフトウェア(MIT License)です。

Slackcat vektorlab/slackcat