Organize your Slack sections to mirror your team's user groups and default channels.
- Create sections in Slack's left navigation for the specified user groups.
- Organize each user group's default channels into the corresponding section.
- Automatically join channels.
- Detect channels that are in multiple user groups and prompt for section designation.
- Automatically delete empty sections after organization is complete.
- This app requires
node
andnpm
to run. Refer to the Node Version Manager instructions for installation (recommended), or you may install them directly here. - Clone this repo (
git@github.com:vendrinc/slack-sections-organizer.git
) or if you do not have git installed download the zip - From the repo root directory, run
npm install && npm run build
Because this app uses non-published Slack APIs for managing sections, you must configure the app with a token and cookie retrieved from the Slack web app:
- Copy
.env.template
to.env
. The new.env
file is where you will configure yourSLACK_COOKIE
andSLACK_XOXC_TOKEN
values. - Log in to the Slack web app in Chrome via your team's Slack URL (
teamname.slack.com
) - Open developer tools (Mac:
cmd-option-i
) and click on theNetwork
tab. - In the
Filter
box, type.list
, clickFetch/XHR
, and then reload the browser. - Click any of the request rows in the
Name
box and click theHeaders
tab. - Scroll down to
Request Headers
->Cookie
. - Highlight and copy the entire
Cookie
value and paste it in.env
as theSLACK_COOKIE
value.- Note: You may opt to copy just the sub-value
d=xoxd-...;
and paste that in.env
as theSLACK_COOKIE
value. That's the important part!
- Note: You may opt to copy just the sub-value
- Click the
Payload
tab and findForm Data
->token
. - Highlight and copy the
token
value (xoxc-abc...123
) and paste it in.env
as theSLACK_XOXC_TOKEN
value. - Save the
.env
file.
WARNING: The SLACK_COOKIE
and SLACK_XOXC_TOKEN
secrets provide authenticated access to your Slack account. These values must be kept private. Do NOT share or distribute them.
- To run the app, from the repo root directory run
npm start -- <command line options>
- The following command line options are available:
-g, --group-handle string[]
User group handles. Create and organize sections for the named user groups.- ex:
npm start -- -g my-user-group my-other-user-group
This will organize sections for the user groups with the handlesmy-user-group
andmy-other-user-group
- ex:
-t, --group-desc-tag string[]
User group description tag. Create and organize sections for all user groups containing one or more tags in the description.- ex:
npm start -- -t engineering
This will organize sections for all user groups with the tagengineering
in the user group description.
- ex:
-j, --join-channels
Join all channels in the user groups. Defaults to true. Set tofalse
to disable.-d, --delete-empty-sections
Delete empty sections after completing organization. Defaults to true. Set tofalse
to disable.-h, --help
Display help information
Note: You may combine -g
and -t
to organize the union of user groups specified.