LoginSignup
0
0

More than 3 years have passed since last update.

terminalの履歴をrealtimeにslackに記録

Last updated at Posted at 2019-08-13

完成イメージ

image.png

記事を参考にincomming webhookを設定

webhookを叩くコマンドを作成

curl -X POST -H 'Content-type: application/json' --data '{"text":"Done!:ghost:"}' https://YOURE_INCOMMING_WEB_HOOK_URL

コマンド実行後に実行されるコマンドを設定

~/.bash_profile
function execute_after_executed () {
  h=$(history 1)
  #echo $h
  curl -X POST -H 'Content-type: application/json' --data "{'text':'$h:run_gopher:'}" https://YOURE_INCOMMING_WEB_HOOK_URL;
}
PROMPT_COMMAND=execute_after_executed

欠点

0.1秒くらいbashがラグる

予定

slackで集計して、頻度の高いコマンドをaliasとして提案するAI

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0