Disclaimer: This is an unofficial, open-source CLI tool for interacting with Slack. It is not affiliated with, endorsed by, or supported by Slack Technologies. Slack has an official CLI — see the Slack CLI documentation for the officially supported tooling.
A fast, developer-friendly command-line interface tool for interacting with Slack workspaces. Built with TypeScript and Bun, it enables AI agents, automation tools, and developers to access Slack functionality directly from the terminal.
- 🔐 Dual Authentication Support: Standard Slack tokens (xoxb/xoxp) or browser tokens (xoxd/xoxc)
- 🪄 Automatic Browser Login: sign into Slack in a browser and the tokens are captured for you
- 🎯 Easy Token Extraction: Automatically parse tokens from browser cURL commands
- 🏢 Multi-Workspace Management: Manage multiple Slack workspaces with ease
- 💬 Conversation Management: List channels, read messages, send messages
- 🎉 Message Reactions: Add emoji reactions to messages programmatically
- 📄 Canvas Support: List and read Slack canvas documents as markdown
- 🚀 Fast & Lightweight: Built with Bun for blazing fast performance
- 🔄 Auto-Update: Built-in self-update mechanism
- 🎨 Beautiful Output: Colorful, user-friendly terminal output
brew tap shaharia-lab/tap
brew install slackcliTo upgrade to the latest version:
brew upgrade slackclicurl -L https://github.com/shaharia-lab/slackcli/releases/latest/download/slackcli-linux -o slackcli
chmod +x slackcli
mkdir -p ~/.local/bin && mv slackcli ~/.local/bin/curl -L https://github.com/shaharia-lab/slackcli/releases/latest/download/slackcli-linux-arm64 -o slackcli
chmod +x slackcli
mkdir -p ~/.local/bin && mv slackcli ~/.local/bin/curl -L https://github.com/shaharia-lab/slackcli/releases/latest/download/slackcli-macos -o slackcli
chmod +x slackcli
mkdir -p ~/.local/bin && mv slackcli ~/.local/bin/curl -L https://github.com/shaharia-lab/slackcli/releases/latest/download/slackcli-macos-arm64 -o slackcli
chmod +x slackcli
mkdir -p ~/.local/bin && mv slackcli ~/.local/bin/Download slackcli-windows.exe from the latest release and add it to your PATH.
# Clone the repository
git clone https://github.com/shaharia-lab/slackcli.git
cd slackcli
# Install dependencies
bun install
# Build binary
bun run buildSlackCLI supports two authentication methods:
Create a Slack app at api.slack.com/apps and obtain a bot token (xoxb-) or user token (xoxp-).
slackcli auth login --token=xoxb-YOUR-TOKEN --workspace-name="My Team"Sign into Slack in a browser and let SlackCLI capture the tokens. No Slack app, no DevTools, no copy-paste.
slackcli auth login-autoA browser window opens on Slack. Sign in as you normally would, and SlackCLI enrols every workspace you are signed into — one sign-in covers them all.
| Option | Purpose |
|---|---|
--workspace-url <url> |
Open a specific workspace instead of the Slack home |
--timeout <seconds> |
How long to wait for sign-in (default 300) |
--headless |
No visible window — only works once you are already signed in |
SLACKCLI_BROWSER |
Path to a browser, if yours is not auto-detected |
SLACKCLI_BROWSER_PROFILE |
Override the profile directory |
Requirements: Chrome, Edge, Chromium, or Brave installed. Nothing is downloaded and no extra dependency is installed — SlackCLI drives the browser you already have.
Why you sign in again the first time. SlackCLI runs the browser against its own profile in ~/.config/slackcli/browser-profile, separate from your everyday browsing. It has to: since Chrome 136 the browser refuses remote debugging against the default profile, so your existing session cannot be reused. The profile persists, so only the first run needs interaction — after that the window opens and closes on its own.
Security notes.
- Token values are never printed.
- The browser profile is a credential store. While it exists,
login-autocan re-mint working tokens with no prompt.slackcli auth logouttherefore deletes it along withworkspaces.json; pass--keep-browser-sessionto keep it signed in. - Only
https://URLs on aslack.comhost are ever paired with your session cookie — a URL read from the browser that points anywhere else is refused. - While the browser is open it exposes a DevTools port on loopback that any local process could connect to. SlackCLI closes the browser as soon as capture finishes, and also on
Ctrl-Cor termination. - Credentials land in
~/.config/slackcli/workspaces.json(mode0600); the profile directory is0700on macOS and Linux (Windows uses ACL defaults).
Extract tokens from your browser session by hand. No Slack app creation required!
# Step 1: Get extraction guide
slackcli auth extract-tokens
# Step 2: Login with extracted tokens
slackcli auth login-browser \
--xoxd=xoxd-YOUR-TOKEN \
--xoxc=xoxc-YOUR-TOKEN \
--workspace-url=https://yourteam.slack.comHow to Extract Browser Tokens:
- Open your Slack workspace in a web browser
- Open Developer Tools (F12)
- Go to Network tab
- Send a message or refresh
- Find a Slack API request
- Extract:
xoxdtoken from Cookie header (d=xoxd-...)xoxctoken from request payload ("token":"xoxc-...")
The easiest way to extract browser tokens is to copy a Slack API request as cURL and let SlackCLI parse it automatically!
# Step 1: In browser DevTools, right-click any Slack API request
# → Copy → Copy as cURL
# Step 2: Interactive mode (recommended) - just paste and press Enter twice
slackcli auth parse-curl --login
# Alternative: Read directly from clipboard
slackcli auth parse-curl --from-clipboard --login
# Alternative: Pipe from clipboard or file
pbpaste | slackcli auth parse-curl --login
cat curl-command.txt | slackcli auth parse-curl --loginThis automatically extracts:
- Workspace URL and name
- xoxd token from cookies
- xoxc token from request data
# Sign in via a browser; tokens are captured automatically
slackcli auth login-auto
# Refresh tokens later without any interaction (profile stays signed in)
slackcli auth login-auto --headless
# List all authenticated workspaces
slackcli auth list
# Set default workspace
slackcli auth set-default T1234567
# Remove a workspace
slackcli auth remove T1234567
# Logout from all workspaces (also clears the login-auto browser profile)
slackcli auth logout
# Logout but keep the browser signed in
slackcli auth logout --keep-browser-sessionBy default each Slack workspace is stored once. To keep more than one identity
for the same workspace — for example a browser-authenticated user for search
and drafts alongside a bot token for unattended jobs — give each login a
--profile name:
# 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 workspace
slackcli auth login \
--token=xoxb-... \
--workspace-name=example \
--profile=automation-botSelect a profile anywhere --workspace is accepted:
slackcli search messages "after:2026-07-01" --workspace=rafael --json
slackcli messages send --recipient-id=C123 --message="Done" --workspace=automation-botNotes:
- Backward compatible. Existing
workspaces.jsonfiles and single-identity setups keep working unchanged —--profileis optional. - Re-authenticating the same identity refreshes its stored tokens in place.
- Logging in a second identity for a workspace without
--profileis saved under an auto-generated key (e.g.T123-2) instead of overwriting the first. The chosen key is printed after login. auth list,auth set-default, andauth removeaccept a profile name, workspace ID, or workspace name. If a bare workspace ID/name matches more than one profile, SlackCLI asks you to pick a profile instead of guessing.
# List all conversations
slackcli conversations list
# List only public channels
slackcli conversations list --types=public_channel
# List DMs
slackcli conversations list --types=im
# Read recent messages from a channel
slackcli conversations read C1234567890
# Read a specific thread
slackcli conversations read C1234567890 --thread-ts=1234567890.123456
# Read with custom limit
slackcli conversations read C1234567890 --limit=50
# Get JSON output (includes ts and thread_ts for replies)
slackcli conversations read C1234567890 --json# Send message to a channel
slackcli messages send --recipient-id=C1234567890 --message="Hello team!"
# Send DM to a user
slackcli messages send --recipient-id=U9876543210 --message="Hey there!"
# Reply to a thread
slackcli messages send --recipient-id=C1234567890 --thread-ts=1234567890.123456 --message="Great idea!"
# Send a message with a file attachment
slackcli messages send --recipient-id=C1234567890 --message="Here is the file" --file=./report.pdf
# Edit an existing message you posted
slackcli messages edit --channel-id=C1234567890 --timestamp=1234567890.123456 --message="Corrected message"
# Create a draft message in a channel (only works with browser session tokens)
slackcli messages draft --recipient-id=C1234567890 --message="Hello team!"
# Add emoji reaction to a message
slackcli messages react --channel-id=C1234567890 --timestamp=1234567890.123456 --emoji=+1
# More reaction examples
slackcli messages react --channel-id=C1234567890 --timestamp=1234567890.123456 --emoji=heart
slackcli messages react --channel-id=C1234567890 --timestamp=1234567890.123456 --emoji=fire
slackcli messages react --channel-id=C1234567890 --timestamp=1234567890.123456 --emoji=eyesFile uploads require Slack workspace permissions that allow file upload, such as files:write for standard Slack app tokens.
Editing only works on messages posted by the authenticated user or app; ephemeral messages cannot be edited.
Common emoji names:
+1orthumbsup- 👍heart- ❤️fire- 🔥eyes- 👀tada- 🎉rocket- 🚀
# List canvases in the workspace
slackcli canvas list
slackcli canvas list --limit=50
slackcli canvas list --channel=C1234567890
# Read canvas content as markdown
slackcli canvas read F1234567890
# Read canvas in JSON format (includes markdown field)
slackcli canvas read F1234567890 --json
# Read raw HTML (no conversion)
slackcli canvas read F1234567890 --raw
# Read the canvas associated with a channel
slackcli canvas read --channel=C1234567890# Check for updates
slackcli update check
# Update to latest version
slackcli update# Use specific workspace by ID
slackcli conversations list --workspace=T1234567
# Use specific workspace by name
slackcli conversations list --workspace="My Team"Configuration is stored in ~/.config/slackcli/:
workspaces.json- Workspace credentialsconfig.json- User preferences (future)
- Bun v1.0+
- TypeScript 5.x+
# Install dependencies
bun install
# Run in development mode
bun run dev --help
# Build binary
bun run build
# Build for all platforms
bun run build:all
# Type check
bun run type-checkslackcli/
├── src/
│ ├── index.ts # CLI entry point
│ ├── commands/ # Command implementations
│ │ ├── auth.ts
│ │ ├── conversations.ts
│ │ ├── messages.ts
│ │ └── update.ts
│ ├── lib/ # Core library
│ │ ├── auth.ts
│ │ ├── workspaces.ts
│ │ ├── slack-client.ts
│ │ ├── formatter.ts
│ │ └── updater.ts
│ └── types/ # Type definitions
│ └── index.ts
├── .github/workflows/ # CI/CD
└── dist/ # Build output
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Standard Tokens:
- Ensure your token has the required OAuth scopes
- Check token validity in your Slack app settings
Browser Tokens:
- Tokens expire with your browser session
- Extract fresh tokens if authentication fails
- Verify workspace URL format (https://yourteam.slack.com)
If you get permission errors when accessing conversations or sending messages:
- Verify your bot/user has been added to the channel
- Check OAuth scopes include required permissions
- For browser tokens, ensure you have access in the web UI
If installed via Homebrew, use brew upgrade slackcli instead of slackcli update.
If slackcli update fails:
- Ensure you have write permissions to the binary location
- Try running with sudo if installed system-wide
- Consider installing to user directory (~/.local/bin) instead
MIT License - see LICENSE file for details
- 🐛 Report Issues
- 💬 Discussions
- 📧 Email: support@shaharia.com
A huge thanks to the amazing people who have contributed to SlackCLI!
- Built with Bun
- Powered by @slack/web-api
- Inspired by gscli
Made with ❤️ by Shaharia Lab