{"id":13478922,"url":"https://github.com/rockymadden/slack-cli","last_synced_at":"2025-05-16T14:04:30.675Z","repository":{"id":2707907,"uuid":"47231877","full_name":"rockymadden/slack-cli","owner":"rockymadden","description":":neckbeard: Powerful Slack CLI via pure bash. Rich messaging, uploads, posts, piping, oh my!","archived":false,"fork":false,"pushed_at":"2023-02-05T10:19:08.000Z","size":206,"stargazers_count":1067,"open_issues_count":38,"forks_count":93,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-12T10:58:07.726Z","etag":null,"topics":["bash","pomodoro","slack","slack-api","slack-attachments","slack-bot","slack-client","slack-files","slack-post","slack-upload"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/rockymadden.png","metadata":{"files":{"readme":"README.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":"2015-12-02T02:33:13.000Z","updated_at":"2025-04-11T16:31:39.000Z","dependencies_parsed_at":"2023-02-18T23:01:38.024Z","dependency_job_id":null,"html_url":"https://github.com/rockymadden/slack-cli","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockymadden%2Fslack-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockymadden%2Fslack-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockymadden%2Fslack-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockymadden%2Fslack-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockymadden","download_url":"https://codeload.github.com/rockymadden/slack-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash","pomodoro","slack","slack-api","slack-attachments","slack-bot","slack-client","slack-files","slack-post","slack-upload"],"created_at":"2024-07-31T16:02:05.864Z","updated_at":"2025-05-16T14:04:30.642Z","avatar_url":"https://github.com/rockymadden.png","language":"Shell","funding_links":[],"categories":["Shell","bash","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# slack-cli \u003csub\u003e\u003csup\u003e| Powerful Slack CLI via pure bash\u003c/sup\u003e\u003c/sub\u003e\n\n[![version](http://img.shields.io/badge/version-0.18.0-blue.svg)](https://github.com/rockymadden/slack-cli/releases)\n[![versioning](http://img.shields.io/badge/versioning-semver-blue.svg)](http://semver.org/)\n[![branching](http://img.shields.io/badge/branching-github%20flow-blue.svg)](https://guides.github.com/introduction/flow/)\n[![license](http://img.shields.io/badge/license-mit-blue.svg)](https://opensource.org/licenses/MIT)\n[![circleci](https://circleci.com/gh/rockymadden/slack-cli.svg?style=shield)](https://circleci.com/gh/rockymadden/slack-cli)\n\nA pure bash, pipe friendly, feature rich, command line interface for Slack.\n[Richly formatted messages](https://api.slack.com/docs/message-formatting),\n[file uploads](#file-upload), and even [creating Slack posts](#file-upload) are first class\nconstructs. Deep integration with [jq](https://github.com/stedolan/jq) allows for the ability to\nperform advanced operations upon JSON responses, helping you perform complex queries and pipe\nchaining with ease.\n\n__Simple chat example:__\n\n```console\n$ slack chat send hi @slackbot\n```\n\n---\n__100% Slack-based pomodoro example:__\n```console\n$ alias pomodoro='f() { slack status edit --text=\"Pomodoro\" --emoji=\":tomato:\" \u0026\u0026 slack snooze start --minutes=\"${1-60}\" \u0026\u0026 slack reminder add \"Pomodoro done!\" $(date -v +${1-60}M \"+%s\") }; f'\n$ pomodoro 60\n```\n\n---\n__Pipe chaining example:__\n\n```console\n$ # Send a message, update the message, and finally delete the message:\n$ slack chat send hello @slackbot --filter '.ts + \"\\n\" + .channel' |\n  xargs -n2 slack chat update goodbye --filter '.ts + \"\\n\" + .channel' |\n  xargs -n2 slack chat delete\n```\n\n---\n__Richly formatted chat example:__\n\n```console\n$ slack chat send \\\n  --actions '{\"type\": \"button\", \"style\": \"primary\", \"text\": \"See results\", \"url\": \"http://example.com\"}' \\\n  --author 'author' \\\n  --author-icon 'https://assets-cdn.github.com/images/modules/logos_page/Octocat.png' \\\n  --author-link 'https://github.com/rockymadden/slack-cli' \\\n  --channel '#channel' \\\n  --color good \\\n  --fields '{\"title\": \"Environment\", \"value\": \"snapshot\", \"short\": true}' \\\n  --footer 'footer' \\\n  --footer-icon 'https://assets-cdn.github.com/images/modules/logos_page/Octocat.png' \\\n  --image 'https://assets-cdn.github.com/images/modules/logos_page/Octocat.png' \\\n  --pretext 'pretext' \\\n  --text 'text' \\\n  --time 123456789 \\\n  --title 'title' \\\n  --title-link 'https://github.com/rockymadden/slack-cli'\n```\n\n## Installation\n\n### Via `brew`\n\n```console\n$ brew tap rockymadden/rockymadden\n$ brew install rockymadden/rockymadden/slack-cli\n```\n\n### Via `curl`\n\n```console\n$ curl -O https://raw.githubusercontent.com/rockymadden/slack-cli/master/src/slack\n$ chmod +x slack\n```\n\n\u003e __PROTIP:__ You are responsible for having `curl` and `jq` on your `PATH`.\n\n### Via `make`\n\n```console\n$ git clone git@github.com:rockymadden/slack-cli.git\n$ cd slack-cli\n$ make install bindir=/path/to/bin etcdir=/path/to/etc\n```\n\n\u003e __PROTIP:__ You are responsible for having `curl` and `jq` on your `PATH`.\n\n## Configuration\n\nIf you want to post from your own account, you need a legacy API token which can be found\n[here](https://api.slack.com/custom-integrations/legacy-tokens). If you want to post from a\nslackbot, [create one here](https://my.slack.com/services/new/bot). Otherwise, you can create an\napp with a [Slack API token](https://api.slack.com/web) and use said API token one of the\nfollowing ways:\n\n### Via `init`\n\n```console\n$ slack init\n```\n\n### Via environment variable\n\n```console\n$ export SLACK_CLI_TOKEN='token'\n```\n\n## Examples and Recipes\n\n### `chat send`\n\n```console\n$ # Send message via prompts:\n$ slack chat send\n$\n$ # Send message via arguments:\n$ slack chat send 'Hello world!' '#channel'\n$\n$ # Send message via options:\n$ slack chat send --text 'Hello world!' --channel '#channel'\n$\n$ # Send message via short form options:\n$ slack chat send -tx 'Hello world!' -ch '#channel'\n$\n$ # Send message via pipe:\n$ ls -al | slack chat send --channel '#channel' --pretext 'Directory:' --color good\n$\n$ # Send message and returning just the timestamp via filter option:\n$ slack chat send 'Hello world!' '#channel' --filter '.ts'\n```\n\n\u003e __PROTIP:__ See the [Slack attachments documentation](https://api.slack.com/docs/attachments) for\nmore information about option meanings.\n\n### `chat update`\n\n```console\n$ # Update message via prompts:\n$ slack chat update\n$\n$ # Update message via arguments:\n$ slack chat update 'Hello world, again!' 1405894322.002768 '#channel'\n$\n$ # Update message via options:\n$ slack chat update --text 'Hello world, again!' --timestamp 1405894322.002768 --channel '#channel'\n$\n$ # Update message via short form options:\n$ slack chat update -tx 'Hello world, again!' -ts 1405894322.002768 -ch '#channel'\n$\n$ # Send message and immediately update:\n$ slack chat send 'Hello world!' '#channel' --filter '.ts + \"\\n\" + .channel' |\n  xargs -n2 slack chat update 'Goodbye world!'\n```\n\n\u003e __PROTIP:__ See the [Slack attachments documentation](https://api.slack.com/docs/attachments) for\nmore information about option meanings.\n\n### `chat delete`\n\n```console\n$ # Delete message via prompts:\n$ slack chat delete\n$\n$ # Delete message via arguments:\n$ slack chat delete 1405894322.002768 '#channel'\n$\n$ # Delete message via options:\n$ slack chat delete --timestamp 1405894322.002768 --channel '#channel'\n$\n$ # Delete message via short form options:\n$ slack chat delete -ts 1405894322.002768 -ch '#channel'\n$\n$ # Send message and immediately delete:\n$ slack chat send 'Hello world!' '#channel' --filter '.ts + \"\\n\" + .channel' |\n  xargs -n2 slack chat delete\n```\n\n### `file upload`\n\n```console\n$ # Upload file via prompts:\n$ slack file upload\n$\n$ # Upload file via arguments:\n$ slack file upload README.md '#channel'\n$\n$ # Upload file via options:\n$ slack file upload --file README.md --channels '#channel'\n$\n$ # Upload file via pipe:\n$ ls -al | slack file upload --channels '#channel'\n$\n$ # Upload file with rich formatting:\n$ slack file upload README.md '#channel' --comment 'Comment' --title 'Title'\n$\n$ # Create a Slack post, noting the filetype option:\n$ slack file upload --file post.md --filetype post --title 'Post Title' --channels '#channel'\n```\n\n### `file list`\n\n```console\n$ # List files:\n$ slack file list\n$\n$ # List files and output only ID and size:\n$ slack file list --filter '[.files[] | {id, size}]'\n```\n\n### `file info`\n\n```console\n$ # Info about file via prompts:\n$ slack file info\n$\n$ # Info about file via arguments:\n$ slack file info F2147483862\n$\n$ # Info about file via options:\n$ slack file info --file F2147483862\n```\n\n### `file delete`\n\n```console\n$ # Delete file via prompts:\n$ slack file delete\n$\n$ # Delete file via arguments:\n$ slack file delete F2147483862\n$\n$ # Delete file via options:\n$ slack file delete --file F2147483862\n```\n\n### `presence active`\n\n```console\n$ # Active presence:\n$ slack presence active\n```\n\n### `reminder list`\n\n```console\n$ # List reminders:\n$ slack reminder list\n```\n\n### `reminder add`\n\n```console\n$ # Add reminder via prompts:\n$ slack reminder add\n$\n$ # Add reminder via arguments:\n$ slack reminder add 'lunch' 1526995300\n$\n$ # Add reminder in 10 minutes, via date on macOS, via arguments:\n$ slack reminder add 'lunch' $(date -v +10M \"+%s\")\n$\n$ # Add reminder via options:\n$ slack reminder add --text=\"lunch\" --time=1526995300\n```\n\n### `reminder complete`\n\n```console\n$ # Complete reminder via prompts:\n$ slack reminder complete\n$\n$ # Complete reminder via arguments:\n$ slack reminder complete Rm7MGABKT6\n$\n$ # Complete reminder via options:\n$ slack reminder complete --reminder=\"Rm7MGABKT6\"\n```\n\n### `reminder delete`\n\n```console\n$ # Complete reminder via prompts:\n$ slack reminder delete\n$\n$ # Complete reminder via arguments:\n$ slack reminder delete \"Rm7MGABKT6\"\n$\n$ # Complete reminder via options:\n$ slack reminder delete --reminder=\"Rm7MGABKT6\"\n```\n\n### `reminder info`\n\n```console\n$ # Info about reminder via prompts:\n$ slack reminder info\n$\n$ # Info about reminder via arguments:\n$ slack reminder info \"Rm7MGABKT6\"\n$\n$ # Info about reminder via options:\n$ slack reminder info --reminder=\"Rm7MGABKT6\"\n```\n\n### `presence away`\n\n```console\n$ # Away presence:\n$ slack presence away\n```\n\n### `snooze start`\n\n```console\n$ # Start snooze via prompts:\n$ slack snooze start\n$\n$ # Start snooze via arguments:\n$ slack snooze start 60\n$\n$ # Start snooze via options:\n$ slack snooze start --minutes 60\n$\n$ # Start snooze via short form options:\n$ slack snooze start -mn 60\n```\n\n### `snooze info`\n\n```console\n$ # Info about your own snooze:\n$ slack snooze info\n$\n$ # Info about another user's snooze via argument:\n$ slack snooze info @slackbot\n$\n$ # Info about another user's snooze via options:\n$ slack snooze info --user @slackbot\n$\n$ # Info about another user's snooze via short form options:\n$ slack snooze info -ur @slackbot\n```\n\n### `snooze end`\n\n```console\n$ # End snooze:\n$ slack snooze end\n```\n\n### `status edit`\n\n```console\n$ # Edit status:\n$ slack status edit\n$\n$ # Edit status via arguments:\n$ slack status edit lunch :hamburger:\n$\n$ # Edit status via options:\n$ slack status edit --text lunch --emoji :hamburger:\n$\n$ # Edit status via short form options:\n$ slack status edit --tx lunch -em :hamburger:\n```\n\n## Contributors\n\nA big thank you to the following contributors who have helped add features and/or fixes:\n\n* [nharsch](https://github.com/nharsch)\n* [funky-monkey](https://github.com/funky-monkey)\n* [bertag](https://github.com/bertag)\n* [leehuffman](https://github.com/leehuffman)\n* [raine](https://github.com/raine)\n\n## License\n\n```text\nThe MIT License (MIT)\n\nCopyright (c) 2018 Rocky Madden (https://rockymadden.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockymadden%2Fslack-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockymadden%2Fslack-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockymadden%2Fslack-cli/lists"}