This tool no longer does it's job, as Slack has modified their API.
This little CLI helps you to join, leave, add/remove stars from/to a bunch of channels based on regex patterns.
Before you can start, set up the SLACK_TOKEN
environment variable with a valid Slack token as value and create an alias slackutil
as you can see below:
export SLACK_TOKEN=<mytoken>
alias slackutil="docker run --rm -ti -e SLACK_TOKEN=${SLACK_TOKEN} quay.io/giantswarm/slackutil"
To join all channels available to you:
slackutil join
To join all channels with names starting with ux-
:
slackutil join --include "ux-.*"
To join all channels with names matching ux-.*
, but not matching ux-noise
:
slackutil join --include "ux-.*" --exclude "ux-noise"
You can use as many --include
and --exclude
patterns as you want to.
Pro tip: Test your patterns as described below before actually joining channels.
The leave
command works the same way as the join
command.
To leave all channels containing jokes
in their name, except for the one named actually-funny-jokes
:
slackutil leave --include ".*jokes.*" --exclude "actually-funny-jokes"
slackutil star --include "cool-.*"
slackutil unstar --include "uncool-.*"
To mute all support channels:
slackutil mute --include "support-.*"
To unmute all support channels:
slackutil unmute --include "support-.*"
To just test your include and exclude patterns, use list
instead:
slackutil list --include "a.*" --exclude "abc.*"
This way, the matching channel names will be printed. Nothing else.