All Projects → rockymadden → Slack Cli

rockymadden / Slack Cli

Powerful Slack CLI via pure bash. Rich messaging, uploads, posts, piping, oh my!

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Slack Cli

Java Slack Sdk
Slack Developer Kit (including Bolt for Java) for any JVM language
Stars: ✭ 393 (-53.76%)
Mutual labels:  slack-bot, slack-api, slack
dienstplan
Slack bot app for duty rotations
Stars: ✭ 14 (-98.35%)
Mutual labels:  slack, slack-bot, slack-api
Slack Machine
A sexy, simple, yet powerful and extendable Slack bot
Stars: ✭ 91 (-89.29%)
Mutual labels:  slack-bot, slack-api, slack
slackblocks
🎲 Python API for Building Messages Using the Slack Block Kit API
Stars: ✭ 32 (-96.24%)
Mutual labels:  slack, slack-bot, slack-api
Slacker
Slack Bot Framework
Stars: ✭ 495 (-41.76%)
Mutual labels:  slack-bot, slack-api, slack
Slack Ruby Client
A Ruby and command-line client for the Slack Web, Real Time Messaging and Event APIs.
Stars: ✭ 957 (+12.59%)
Mutual labels:  slack-bot, slack-api, slack
Slack Block Builder
Lightweight, no-dependency JavaScript library for creating Slack Block Kit UIs, with a builder syntax, inspired by SwiftUI.
Stars: ✭ 129 (-84.82%)
Mutual labels:  slack-bot, slack-api, slack
slack-rota
日々のローテーションをお知らせする Slack アプリ
Stars: ✭ 14 (-98.35%)
Mutual labels:  slack, slack-bot
uptime.js
Uptime monitor in Node.js that send status changes to Chatbots
Stars: ✭ 52 (-93.88%)
Mutual labels:  slack-bot, slack-api
Torpedo
Pluggable, multi-network asynchronous chat bot written in Go
Stars: ✭ 19 (-97.76%)
Mutual labels:  slack-bot, slack
karmabot
upvotes and downvotes for slack
Stars: ✭ 24 (-97.18%)
Mutual labels:  slack, slack-bot
iou-slack-bot
💸 IOU Slack Bot - Keep track of your debts with your peers.
Stars: ✭ 13 (-98.47%)
Mutual labels:  slack, slack-bot
SlackWebhooksGithubCrawler
Search for Slack Webhooks token publicly exposed on Github
Stars: ✭ 21 (-97.53%)
Mutual labels:  slack, slack-bot
slack-mock
A Slack API mocker for Slack bot integration tests.
Stars: ✭ 61 (-92.82%)
Mutual labels:  slack, slack-bot
node-slack-events-api
Slack Events API for Node
Stars: ✭ 93 (-89.06%)
Mutual labels:  slack, slack-bot
WebsocketClientLite.PCL
websocket Client Lite PCL - Xaramrin
Stars: ✭ 22 (-97.41%)
Mutual labels:  slack, slack-api
Slack Cleaner
delete slack messages and files. An improved version is at:
Stars: ✭ 329 (-61.29%)
Mutual labels:  slack-api, slack
Chat
Chat with your team while you collaborate over code using VS Live Share
Stars: ✭ 468 (-44.94%)
Mutual labels:  slack-api, slack
Slack Black Theme
slack theme, dark theme for slack, black theme slack black theme
Stars: ✭ 531 (-37.53%)
Mutual labels:  slack-api, slack
slack-php-app-framework
Robust PHP framework for building Slack apps in PHP
Stars: ✭ 29 (-96.59%)
Mutual labels:  slack, slack-bot

slack-cli | Powerful Slack CLI via pure bash

version versioning branching license circleci

A pure bash, pipe friendly, feature rich, command line interface for Slack. Richly formatted messages, file uploads, and even creating Slack posts are first class constructs. Deep integration with jq allows for the ability to perform advanced operations upon JSON responses, helping you perform complex queries and pipe chaining with ease.

Simple chat example:

$ slack chat send hi @slackbot

100% Slack-based pomodoro example:

$ alias pomodoro='f() { slack status edit --text="Pomodoro" --emoji="🍅" && slack snooze start --minutes="${1-60}" && slack reminder add "Pomodoro done!" $(date -v +${1-60}M "+%s") }; f'
$ pomodoro 60

Pipe chaining example:

$ # Send a message, update the message, and finally delete the message:
$ slack chat send hello @slackbot --filter '.ts + "\n" + .channel' |
  xargs -n2 slack chat update goodbye --filter '.ts + "\n" + .channel' |
  xargs -n2 slack chat delete

Richly formatted chat example:

$ slack chat send \
  --actions '{"type": "button", "style": "primary", "text": "See results", "url": "http://example.com"}' \
  --author 'author' \
  --author-icon 'https://assets-cdn.github.com/images/modules/logos_page/Octocat.png' \
  --author-link 'https://github.com/rockymadden/slack-cli' \
  --channel '#channel' \
  --color good \
  --fields '{"title": "Environment", "value": "snapshot", "short": true}' \
  --footer 'footer' \
  --footer-icon 'https://assets-cdn.github.com/images/modules/logos_page/Octocat.png' \
  --image 'https://assets-cdn.github.com/images/modules/logos_page/Octocat.png' \
  --pretext 'pretext' \
  --text 'text' \
  --time 123456789 \
  --title 'title' \
  --title-link 'https://github.com/rockymadden/slack-cli'

Installation

Via brew

$ brew tap rockymadden/rockymadden
$ brew install rockymadden/rockymadden/slack-cli

Via curl

$ curl -O https://raw.githubusercontent.com/rockymadden/slack-cli/master/src/slack
$ chmod +x slack

PROTIP: You are responsible for having curl and jq on your PATH.

Via make

$ git clone [email protected]:rockymadden/slack-cli.git
$ cd slack-cli
$ make install bindir=/path/to/bin etcdir=/path/to/etc

PROTIP: You are responsible for having curl and jq on your PATH.

Configuration

If you want to post from your own account, you need a legacy API token which can be found here. If you want to post from a slackbot, create one here. Otherwise, you can create an app with a Slack API token and use said API token one of the following ways:

Via init

$ slack init

Via environment variable

$ export SLACK_CLI_TOKEN='token'

Examples and Recipes

chat send

$ # Send message via prompts:
$ slack chat send
$
$ # Send message via arguments:
$ slack chat send 'Hello world!' '#channel'
$
$ # Send message via options:
$ slack chat send --text 'Hello world!' --channel '#channel'
$
$ # Send message via short form options:
$ slack chat send -tx 'Hello world!' -ch '#channel'
$
$ # Send message via pipe:
$ ls -al | slack chat send --channel '#channel' --pretext 'Directory:' --color good
$
$ # Send message and returning just the timestamp via filter option:
$ slack chat send 'Hello world!' '#channel' --filter '.ts'

PROTIP: See the Slack attachments documentation for more information about option meanings.

chat update

$ # Update message via prompts:
$ slack chat update
$
$ # Update message via arguments:
$ slack chat update 'Hello world, again!' 1405894322.002768 '#channel'
$
$ # Update message via options:
$ slack chat update --text 'Hello world, again!' --timestamp 1405894322.002768 --channel '#channel'
$
$ # Update message via short form options:
$ slack chat update -tx 'Hello world, again!' -ts 1405894322.002768 -ch '#channel'
$
$ # Send message and immediately update:
$ slack chat send 'Hello world!' '#channel' --filter '.ts + "\n" + .channel' |
  xargs -n2 slack chat update 'Goodbye world!'

PROTIP: See the Slack attachments documentation for more information about option meanings.

chat delete

$ # Delete message via prompts:
$ slack chat delete
$
$ # Delete message via arguments:
$ slack chat delete 1405894322.002768 '#channel'
$
$ # Delete message via options:
$ slack chat delete --timestamp 1405894322.002768 --channel '#channel'
$
$ # Delete message via short form options:
$ slack chat delete -ts 1405894322.002768 -ch '#channel'
$
$ # Send message and immediately delete:
$ slack chat send 'Hello world!' '#channel' --filter '.ts + "\n" + .channel' |
  xargs -n2 slack chat delete

file upload

$ # Upload file via prompts:
$ slack file upload
$
$ # Upload file via arguments:
$ slack file upload README.md '#channel'
$
$ # Upload file via options:
$ slack file upload --file README.md --channels '#channel'
$
$ # Upload file via pipe:
$ ls -al | slack file upload --channels '#channel'
$
$ # Upload file with rich formatting:
$ slack file upload README.md '#channel' --comment 'Comment' --title 'Title'
$
$ # Create a Slack post, noting the filetype option:
$ slack file upload --file post.md --filetype post --title 'Post Title' --channels '#channel'

file list

$ # List files:
$ slack file list
$
$ # List files and output only ID and size:
$ slack file list --filter '[.files[] | {id, size}]'

file info

$ # Info about file via prompts:
$ slack file info
$
$ # Info about file via arguments:
$ slack file info F2147483862
$
$ # Info about file via options:
$ slack file info --file F2147483862

file delete

$ # Delete file via prompts:
$ slack file delete
$
$ # Delete file via arguments:
$ slack file delete F2147483862
$
$ # Delete file via options:
$ slack file delete --file F2147483862

presence active

$ # Active presence:
$ slack presence active

reminder list

$ # List reminders:
$ slack reminder list

reminder add

$ # Add reminder via prompts:
$ slack reminder add
$
$ # Add reminder via arguments:
$ slack reminder add 'lunch' 1526995300
$
$ # Add reminder in 10 minutes, via date on macOS, via arguments:
$ slack reminder add 'lunch' $(date -v +10M "+%s")
$
$ # Add reminder via options:
$ slack reminder add --text="lunch" --time=1526995300

reminder complete

$ # Complete reminder via prompts:
$ slack reminder complete
$
$ # Complete reminder via arguments:
$ slack reminder complete Rm7MGABKT6
$
$ # Complete reminder via options:
$ slack reminder complete --reminder="Rm7MGABKT6"

reminder delete

$ # Complete reminder via prompts:
$ slack reminder delete
$
$ # Complete reminder via arguments:
$ slack reminder delete "Rm7MGABKT6"
$
$ # Complete reminder via options:
$ slack reminder delete --reminder="Rm7MGABKT6"

reminder info

$ # Info about reminder via prompts:
$ slack reminder info
$
$ # Info about reminder via arguments:
$ slack reminder info "Rm7MGABKT6"
$
$ # Info about reminder via options:
$ slack reminder info --reminder="Rm7MGABKT6"

presence away

$ # Away presence:
$ slack presence away

snooze start

$ # Start snooze via prompts:
$ slack snooze start
$
$ # Start snooze via arguments:
$ slack snooze start 60
$
$ # Start snooze via options:
$ slack snooze start --minutes 60
$
$ # Start snooze via short form options:
$ slack snooze start -mn 60

snooze info

$ # Info about your own snooze:
$ slack snooze info
$
$ # Info about another user's snooze via argument:
$ slack snooze info @slackbot
$
$ # Info about another user's snooze via options:
$ slack snooze info --user @slackbot
$
$ # Info about another user's snooze via short form options:
$ slack snooze info -ur @slackbot

snooze end

$ # End snooze:
$ slack snooze end

status edit

$ # Edit status:
$ slack status edit
$
$ # Edit status via arguments:
$ slack status edit lunch 🍔
$
$ # Edit status via options:
$ slack status edit --text lunch --emoji 🍔
$
$ # Edit status via short form options:
$ slack status edit --tx lunch -em 🍔

Contributors

A big thank you to the following contributors who have helped add features and/or fixes:

License

The MIT License (MIT)

Copyright (c) 2018 Rocky Madden (https://rockymadden.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].