{"id":41168649,"url":"https://github.com/cosmoquester/quick-slack","last_synced_at":"2026-01-22T19:37:52.252Z","repository":{"id":55364896,"uuid":"321864457","full_name":"cosmoquester/quick-slack","owner":"cosmoquester","description":"CLI tool to send message to mornitor status, notify process end, etc by slack.","archived":false,"fork":false,"pushed_at":"2021-09-14T08:56:45.000Z","size":839,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-24T04:31:35.837Z","etag":null,"topics":["command-line-tool","python","slack"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmoquester.png","metadata":{"files":{"readme":"README.ko.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-16T04:09:11.000Z","updated_at":"2021-09-14T08:56:48.000Z","dependencies_parsed_at":"2022-08-14T22:22:41.494Z","dependency_job_id":null,"html_url":"https://github.com/cosmoquester/quick-slack","commit_stats":null,"previous_names":["psj8252/quick-slack"],"tags_count":2,"template":false,"template_full_name":"cosmoquester/python3-template","purl":"pkg:github/cosmoquester/quick-slack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmoquester%2Fquick-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmoquester%2Fquick-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmoquester%2Fquick-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmoquester%2Fquick-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmoquester","download_url":"https://codeload.github.com/cosmoquester/quick-slack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmoquester%2Fquick-slack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28669391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","python","slack"],"created_at":"2026-01-22T19:37:51.575Z","updated_at":"2026-01-22T19:37:52.243Z","avatar_url":"https://github.com/cosmoquester.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick slack\n\n[![codecov](https://codecov.io/gh/psj8252/quick-slack/branch/master/graph/badge.svg?token=MREUJNXE7L)](https://codecov.io/gh/psj8252/quick-slack)\n\n- 빠르게 slack 메세지를 보내는 cli툴입니다. 프로세스 종료 알림, 실행 결과에 따라 알림 등의 기능을 지원합니다.\n\n# Install\n\n그냥 설치하면 virtualenv 상태에 따라 command가 동작하지 않을 수 있기 때문에 pipx를 이용해 설치하기를 권장합니다.\n\npipx로 설치할 경우 virtualenv 상태와 상관없이 명령어를 사용할 수 있습니다. 먼저 pipx를 설치합니다.\n\n## Install pipx\n\n```sh\n$ python3 -m pip install pipx\n```\n- pipx의 설치에 대한 자세한 내용은 [여기](https://github.com/pipxproject/pipx)를 참고해주세요.\n\n## Install Quick Slack for global\n\n```sh\n$ pipx install quick-slack\n```\npipx의 설치를 완료하면 pipx를 통해 quick-slack을 설치합니다.\n\n```\nFailing command: ['/home/user/.local/pipx/shared/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']\n'/usr/bin/python3 -m venv --clear /home/user/.local/pipx/shared' failed\n```\n위와 갈은 에러가 발생한다면 `python3-venv`를 설치해줘야 합니다. `python3.x -m pipx install quick-slack`와 같은 명령어로 설치했을 경우 `python3.x-venv`를 설치해줘야 합니다. \n\n## Install Quick Slack for some environment\n\n만약 특정 환경에만 설치하고 싶다면 평범하게 pip로 설치하면 됩니다.\n```sh\n$ pip install quick-slack\n```\n\n# Usage\n\n## Slack에 Bot 추가하기\n\n먼저 https://api.slack.com/apps 에 들어가서 Workspace에 App을 만들어줍니다.\n\n그 다음 Bot Token Scope에 아래의 권한을 추가해줍니다.\n\n![Permission](images/image1.png)\n![Permission](images/image2.png)\n\n- [chat:write](https://api.slack.com/scopes/chat:write)\n- [channels:read](https://api.slack.com/scopes/channels:read)\n- [groups:read](https://api.slack.com/scopes/groups:read)\n- [im:read](https://api.slack.com/scopes/im:read)\n- [mpim:read](https://api.slack.com/scopes/mpim:read)\n- [users:read](https://api.slack.com/scopes/users:read)\n- [usergroups:read](https://api.slack.com/scopes/usergroups:read)\n\n그리고 Install App 에서 Workspace에 App을 Install하면 xoxb로 시작하는 Bot User OAuth Access Token을 발급받습니다.\n\n![Install](images/image3.png)\n![Token](images/image4.png)\n\n## Config 설정\n\n```sh\n$ qslack config\nUsage: qslack config [OPTIONS] COMMAND [ARGS]...\n\n  Show or update configs\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  set   Set configurations Default channel is always only one, so you...\n  show  Show current configs\n```\n\n```\n$ qslack config show\nslack_oauth_token   : None\ndefault_channel_id  : None\ndefault_mentions    : None\n```\n`qslack config show` 명령어를 통해 현재 config를 볼 수 있습니다.\n\n```\n$ qslack config set --help\nUsage: qslack config set [OPTIONS]\n\n  Set configurations\n\n  Default channel is always only one, so you cannot and don't need to pass default channel name and default channel id.\n  Default mention format is like '@user1 @here !subteam3'. Warn you should use ! with custom usergroup like 'engineer'.\n\nOptions:\n  --api-token TEXT             Slack oauth API token start with xoxb-...\n  --default-mentions TEXT      Default mention user or groups\n  --default-channel-name TEXT  Default channel name to send message, enter\n                               '@username' if channel is direct message\n\n  --default-channel-id TEXT    Default channel id to send message\n  --help                       Show this message and exit.\n```\n\n```\n$ qslack config set --api-token xoxb-1231-12312312 --default-mentions '@psj8252 @here' --default-channel-id C10100110\nSetting slack token is done.\nSetting default mentions is done.\nSetting default channel is done.\n```\n위와 같은 방식으로 설정할 수 있습니다.\n- default-mentions는 메세지를 보내는 명령어를 사용할 때 mention 옵션을 켤 경우 mention이 되는 대상입니다.\n- default channel은 메세지를 보내는 명령어를 사용할 때 메세지가 보내지는 채널을 의미합니다.\n- default channel은 default-channel-id 인자로 id를 직접 입력하거나 default-channel-name 인자로 channel이름을 입력해 설정합니다.\n\n## 메세지 보내기\n\n```\n$ qslack send --help\nUsage: qslack send [OPTIONS] MESSAGE\n\n  Send message to the channel\n\nOptions:\n  -m, --mention            If use this flag, mention default mention\n                           user/groups\n\n  -c, --channel-name TEXT  Channel name to send message, use default channel\n                           in config if not passed\n\n  --help                   Show this message and exit.\n```\n\nqslack send 명령어로 채널에 메시지를 보낼 수 있습니다.\n\n```\n$ qslack send hi\nError occured in sending message!\n{'ok': False, 'error': 'invalid_auth', 'warning': 'missing_charset', 'response_metadata': {'warnings': ['missing_charset']}}\n```\ntoken이 올바르지 않을 경우 위와같은 에러가 발생할 수 있습니다.\n\n```\nqslack send hi\nError occured in sending message!\n{'ok': False, 'error': 'not_in_channel', 'warning': 'missing_charset', 'response_metadata': {'warnings': ['missing_charset']}}\n```\n- Bot이 메세지를 보내기 위해서는 해당 채널에 들어와 있어야 합니다. 그렇지 않으면 `'not_in_channel'`, `'channel_not_found'` 등의 에러가 날 수 있습니다.\n- 에러가 나는 경우는 slack API와 관련된 부분이니 토큰을 잘못 입력했거나 권한설정을 빼먹은 경우 토큰을 제대로 설정하고 빠진 권한을 추가하는 등의 조치를 취해주시면 됩니다.\n\n## 명령어 결과에 따라 메세지 보내기\n\n```\nqslack cond --help\nUsage: qslack cond [OPTIONS] COMMAND\n\n  Run command and send message based on whether success command\n\nOptions:\n  -s, --success TEXT  Message sent if command success\n  -f, --fail TEXT     Message sent if command failed\n  -m, --mention       If use this flag, mention default mention users\n  --help              Show this message and exit.\n```\n- 위 명령어는 command의 실행결과에 따라 메세지를 보내는 명령어 입니다. exit code가 0이면 success인자로 받은 메세지를 보내고 0이 아니면 fail인자로 받은 메세지를 보냅니다.\n- 메세지를 설정하지 않은 경우에는 따로 메세지를 보내지 않습니다.\n\n```\n$ qslack cond pwd -s hi -f hello\n/Users/psj8252/quick-slack\nCommand success\nSending message is done.\n```\n예들들어 이렇게 pwd명령을 성공하면 hi라는 메세지를 보냅니다.\n\n```\nqslack cond 'bash -c \"exit 1\"' -f good\nCommand exit with 1\nSending message is done.\n```\n위 경우에는 exit코드가 1로 실패했기 때문에 good이라는 메세지를 보냅니다.\n\n## 주기적으로 명령어를 실행하고 결과를 메세지로 보내기\n\n```sh\nqslack watch --help\nUsage: qslack watch [OPTIONS] COMMAND\n\n  Execute command every interval and send message of excution output\n\nOptions:\n  -n, --interaval FLOAT  seconds to wait between updates\n  -m, --mention          If use this flag, mention default mention users\n  -s, --silent           If use this flag, ignore output else print output\n  -b, --backgroud        Run this command backgroud\n  --help                 Show this message and exit.\n```\n위 명령어는 입력한 command를 정기적으로 실행하여 그 결과를 메세지로 전송합니다. watch 명령어처럼 사용할 수 있습니다.\n\n```\n$ qslack watch 'sh -c \"ls | wc -l\"'  -n 3\n      13\n\n      13\n\n      13\n```\n현재 디렉토리의 파일 개수를 3초마다 모니터링하여 슬랙으로 메세지를 보내주는 예시입니다.\n\n## 현재 실행 중인 프로세스가 끝나면 메세지를 전송\n\n```\nqslack ifend --help\nUsage: qslack ifend [OPTIONS] PROCESS_ID MESSAGE\n\n  Check the process is alive in every three seconds and when the process is\n  dead, send message\n\n  the process_id is the id of process to mornitor. Warn this command run\n  python process as backgroud so can be infinitely running if the process is\n  not dead.\n\nOptions:\n  -m, --mention          If use this flag, mention default mention users\n  -n, --interaval FLOAT  seconds to wait between checking liveness\n  --help                 Show this message and exit.\n```\npid를 입력하면 실행중인 프로세스가 끝났을 때 슬랙으로 메세지를 전송하는 명령어입니다.\n\n```\n$ qslack ifend 18103 \"end end\"\nStart mornitoring process 18103...\n\n[+] QuickSlack: Process 18623 end\n[+] QuickSlack: Sent message\n```\n이 명렁어는 background로 실행되기 때문에 해당 프로세스가 오랫동안 종료되지 않을 경우 qslack command가 계속 실행 중인 상태로 유지됩니다.\n\n## Python에서 사용하기\n\n```python\n$ python3\nPython 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21)\n[Clang 6.0 (clang-600.0.57)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n\u003e\u003e\u003e from quick_slack.low_api import send_message\n\n\u003e\u003e\u003e send_message(\"hihi\", mention=True)\n{'ok': True, 'channel': 'CCCCCCCCCCC', 'ts': '1609145740.013500', 'message': {'bot_id': 'BBBBBBBBB', 'type': 'message', 'text': '\u003c@UUUUUUU\u003e \u003c!here\u003e\\nhihi', 'user': 'U01GEA37VL1', 'ts': '1609145740.013500', 'team': 'TTTTTTTTTT', 'bot_profile': {'id': 'BBBBBBBB', 'deleted': False, 'name': 'Slack CLI', 'updated': 1606963748, 'app_id': 'AAAAAAAAAA', 'icons': {}, 'team_id': 'TTTTTTTTTT'}}, 'warning': 'missing_charset', 'response_metadata': {'warnings': ['missing_charset']}}\n\u003e\u003e\u003e\n```\n파이썬에서도 위와 같이 사용할 수는 있습니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmoquester%2Fquick-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmoquester%2Fquick-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmoquester%2Fquick-slack/lists"}