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)
- 🏢 Multi-Workspace Management: Manage multiple Slack workspaces with ease
- 💬 Conversation Management: List channels, read messages, send messages
- 🚀 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-...")
# 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!"# 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