Use several Slack workspaces from one CLI
Every authenticated Slack workspace is stored under a profile key in
~/.config/slackcli/workspaces.json. The first workspace you add automatically
becomes the default; every command uses the default unless you pass
--workspace.
slackcli auth list # what is stored, and which is defaultslackcli conversations list --workspace=T1234567slackcli conversations list --workspace="My Team"--workspace is accepted by every command that talks to Slack.
Several identities in one workspace
Section titled “Several identities in one workspace”By default each workspace is stored once. To keep more than one identity for
the same workspace — say a browser-authenticated user for search and drafts,
alongside a bot token for unattended jobs — name each login with --profile:
# A user identity (browser auth)slackcli auth login-browser \ --xoxd=xoxd-... --xoxc=xoxc-... \ --workspace-url=https://example.slack.com \ --profile=rafael
# A bot identity in the same workspaceslackcli auth login \ --token=xoxb-... \ --workspace-name=example \ --profile=automation-botThen select one anywhere --workspace is accepted:
slackcli search messages "after:2026-07-01" --workspace=rafael --jsonslackcli messages send --recipient-id=C123 --message="Done" --workspace=automation-botHow keys are chosen
Section titled “How keys are chosen”- First identity for a team keeps the historical
team_idas its key, so existing configs and scripts are unaffected. - Re-authenticating the same identity (same team, same auth type, same user)
refreshes its tokens in place — it keeps its key, its default status, and any
name you gave it. This is what makes
auth login-auto --headlessusable as a token refresh. - A second identity without
--profileis saved under an auto-generated key such asT1234567-2rather than overwriting the first. The key that was used is printed after login. --profilenaming an existing key that belongs to a different team is refused, so you cannot clobber an unrelated record by reusing a name.
How a selector is resolved
Section titled “How a selector is resolved”--workspace, auth set-default, and auth remove all accept the same kinds of
value, tried in this order:
- An exact profile key
- An explicit
--profilename - A workspace ID (
T…) - A workspace name
If a bare ID or name matches more than one stored profile, SlackCLI stops and asks you to disambiguate with a profile name instead of silently picking one.
"example" matches multiple profiles: T1234567, rafael.Re-run with --workspace=<profile> (see "slackcli auth list").Config file
Section titled “Config file”~/.config/slackcli/workspaces.json, mode 0600:
{ "default_workspace": "T1234567", "workspaces": { "T1234567": { "workspace_id": "T1234567", "workspace_name": "example", "auth_type": "browser", "workspace_url": "https://example.slack.com", "xoxd_token": "xoxd-...", "xoxc_token": "xoxc-..." }, "automation-bot": { "workspace_id": "T1234567", "workspace_name": "example", "profile": "automation-bot", "auth_type": "standard", "token": "xoxb-...", "token_type": "bot" } }}It holds live credentials. Do not commit it, sync it, or hand it around.