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)
- π― 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
- π Fast & Lightweight: Built with Bun for blazing fast performance
- π Auto-Update: Built-in self-update mechanism
- π¨ Beautiful Output: Colorful, user-friendly terminal output
curl -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-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"Extract tokens from your browser session. 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
# 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
slackcli auth logout# 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!"
# 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=eyesCommon emoji names:
+1orthumbsup- πheart- β€οΈfire- π₯eyes- πtada- πrocket- π
# 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 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: [email protected]
- Built with Bun
- Powered by @slack/web-api
- Inspired by gscli
Made with β€οΈ by Shaharia Lab