Read channels, send messages, search history, and catch up on what you missed. Built to be AI-agent friendly, so your scripts and assistants can use Slack too. No Slack app to build, no admin approval to wait for.
Quickstart Β· What it does Β· Commands Β· Docs Β· Contributing
β Like the idea? Star the repo.
It takes two seconds, and it is how the next person finds SlackCLI.
Sign in, browse conversations, search the workspace, read a thread from a permalink,
reply, react, read a canvas as Markdown, and pipe --json into jq β all from the terminal.
slackcli-demo.mp4
Important
Unofficial project. SlackCLI is not affiliated with, endorsed by, or supported by Slack Technologies. Slack ships an official CLI for building Slack apps β this is a different tool, for driving a workspace you already belong to.
Three steps, about a minute.
1. Install β pick your platform
Homebrew (macOS & Linux) β recommended
brew tap shaharia-lab/tap
brew install slackcliLinux β direct binary
# x86_64
curl -L https://github.com/shaharia-lab/slackcli/releases/latest/download/slackcli-linux -o slackcli
# arm64
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/macOS β direct binary
# Intel
curl -L https://github.com/shaharia-lab/slackcli/releases/latest/download/slackcli-macos -o slackcli
# Apple Silicon
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/Windows
Download slackcli-windows.exe from the latest release
and put it somewhere on your PATH.
From source (Bun)
git clone https://github.com/shaharia-lab/slackcli.git
cd slackcli
bun install
bun run build # -> ./dist/slackcliEvery release ships checksums.txt β verify your download if you care to, and you should.
Full details in the installation guide.
2. Sign in β one command, no Slack app required
slackcli auth login-autoA browser opens, you sign into Slack as you normally would, and SlackCLI captures the session tokens for every workspace on that account. Nothing leaves your machine.
Prefer a real Slack app token, or need a service account? There are three other ways β see authentication below.
3. Do something useful
slackcli conversations unread # what did I miss?
slackcli search messages "deploy failed" --in=engineering
slackcli messages send --permalink="$LINK" --message="On it π"Tip
Anywhere SlackCLI wants a channel ID or a timestamp, you can paste a Slack link instead. Copy a permalink out of the Slack app and hand it straight to the CLI β see links & timestamps.
| I want to⦠| Try this | Learn more |
|---|---|---|
| See what I missed | slackcli conversations unread |
conversations |
| Read a channel or a thread | slackcli conversations read C123 --limit=50 |
conversations |
| Send, reply, edit, or react | slackcli messages send --permalink="$LINK" --message="β¦" |
messages |
| Search the workspace | slackcli search messages "release notes" |
search |
| Find a channel or a person | slackcli search people "ada" |
search |
| Work through "saved for later" | slackcli saved list --state=to_do |
saved items |
| Read a Canvas as Markdown | slackcli canvas read F123 |
canvas |
| Upload a file with a message | slackcli messages send --file=./report.pdf β¦ |
messages |
| Post rich Block Kit content | slackcli messages send --blocks=@blocks.json β¦ |
messages |
| Script it / feed an AI agent | β¦ --json | jq |
scripting & JSON |
| Juggle several workspaces | slackcli conversations list --workspace=automation-bot |
workspaces |
| Fix something that broke | slackcli auth list |
troubleshooting |
Every command that returns data speaks --json, so SlackCLI drops straight into shell
pipelines, cron jobs, CI steps, and AI agent toolchains.
# Who is talking about the outage, and when?
slackcli search messages "outage" --in=incidents --json \
| jq -r '.matches[] | "\(.username)\t\(.text)"'
# Turn today's unreads into a digest
slackcli conversations unread --json | jq '[.unread_channels[] | {name, unread_count}]'
# Read a thread, summarise it elsewhere, reply with the result
slackcli conversations read --permalink="$LINK" --json | jq '.messages[].text'No Slack app, no OAuth dance, no webhook server β just a binary and a token. Patterns, exit codes, and pagination are in scripting & JSON output.
SlackCLI talks to Slack either as a Slack app (xoxb-* / xoxp-*) or as a
signed-in browser session (xoxd-* + xoxc-*). One SlackClient abstracts both.
flowchart LR
A["Any slackcli command"] --> B{"Workspace<br/>auth type"}
B -->|standard| C["@slack/web-api<br/>xoxb / xoxp"]
B -->|browser| D["fetch + session headers<br/>xoxd + xoxc"]
C --> E(("Slack API"))
D --> E
Four ways to sign in β and which one to pick
| Method | Command | Best for |
|---|---|---|
| Automatic browser login | slackcli auth login-auto |
Almost everyone. Sign in once, all workspaces enrolled. |
| Slack app token | slackcli auth login --token=xoxb-β¦ --workspace-name="My Team" |
Bots, CI, service accounts, long-lived automation. |
| Parse a DevTools cURL | slackcli auth parse-curl --login |
Locked-down browsers, or when you already copied the request. |
| Browser tokens by hand | slackcli auth login-browser --xoxd=β¦ --xoxc=β¦ --workspace-url=β¦ |
Full control, or scripted provisioning. |
Browser session tokens can create drafts, which a Slack app simply cannot do, and
they back saved list and conversations unread with Slack's own native endpoints
rather than approximations. Slack app tokens are more stable and survive a browser logout.
slackcli auth extract-tokens prints the manual walkthrough.
The security model, the OAuth scopes each command needs, and what login-auto does with
your browser profile are all in the authentication guide.
Where credentials live
Configuration lives in ~/.config/slackcli/ (directory mode 0700):
| File | Contents |
|---|---|
workspaces.json |
Workspace credentials (mode 0600) |
update-check.json |
Cached update check, refreshed at most daily |
browser-profile/ |
The browser profile used by auth login-auto |
workspaces.json and browser-profile/ both hold live credentials β do not commit,
sync, or share them. slackcli auth logout clears both.
Seven command groups. slackcli <group> --help always prints the authoritative options
for the version you have installed.
auth β sign in, manage workspaces
| Command | Does |
|---|---|
auth login-auto |
Sign in through a browser; captures tokens automatically |
auth login |
Sign in with a standard Slack app token (xoxb-* / xoxp-*) |
auth login-browser |
Sign in with browser session tokens (xoxd-* + xoxc-*) |
auth parse-curl |
Extract tokens from a cURL command copied out of DevTools |
auth extract-tokens |
Print the manual token-extraction guide |
auth list |
List authenticated workspaces |
auth set-default <workspace> |
Choose the default workspace |
auth remove <workspace> |
Remove one workspace |
auth logout |
Remove all workspaces and the stored browser profile |
π authentication Β· workspaces & profiles
conversations β channels, DMs, threads, unreads
slackcli conversations list --types=public_channel
slackcli conversations read C1234567890 --limit=50
slackcli conversations read --permalink="$LINK" # reads that message's thread
slackcli conversations get C1234567890 1234567890.123456
slackcli conversations unreadπ conversations
messages β send, reply, edit, react, draft
slackcli messages send --recipient-id=C1234567890 --message="Hello team!"
slackcli messages send --permalink="$LINK" --message="On it" # replies in-thread
slackcli messages send --recipient-id=C123 --file=./report.pdf --message="Latest numbers"
slackcli messages send --recipient-id=C123 --blocks=@blocks.json
slackcli messages react --permalink="$LINK" --emoji=+1
slackcli messages edit --channel-id=C123 --timestamp=1234567890.123456 --message="Corrected"
slackcli messages draft --recipient-id=C123 --message="Draft for later"[!NOTE]
messages draftrequires browser session tokens β Slack apps cannot create drafts.
π messages
search β messages, channels, people
slackcli search messages "deploy failed" --in=engineering --from=ada --limit=50
slackcli search channels "incident"
slackcli search people "ada@example.com"π search
saved Β· canvas Β· update
slackcli saved list --state=to_do # saved | to_do | completed
slackcli canvas list --channel=C1234567890
slackcli canvas read F1234567890 # Canvas -> Markdown
slackcli update check # is there a newer version?
slackcli update # install itπ saved items Β· canvas
Made it this far? Then SlackCLI is probably useful to you β and the fastest way to keep it alive is to make it easier for the next person to find.
β Star SlackCLI Β· π¬ Say hello in Discussions Β· π Report something broken
Share it with one person who lives in Slack and in a terminal
In rough order of usefulness:
- β Star the repo β the single highest-leverage thing.
- π Open an issue when something breaks or a command feels wrong.
- π¬ Tell one person who lives in Slack and in a terminal.
- βοΈ Write about it β a blog post, a work Slack message, a comment on HN or Reddit.
- π οΈ Send a PR β see Contributing below.
Everything lives in docs/.
|
User guide β how to use it |
Developer docs β how to work on it bun install
pre-commit install # same checks CI runs
bun run dev --help # run from source
bun test # 400+ tests
bun run type-check
bun run build # -> ./dist/slackcli |
Contributions are very welcome β and the process here is a little stricter than most repos, on purpose.
Important
Open an issue first, and wait for the ready-for-pr label. That label is how the
maintainer decides which features belong in the CLI, and it locks the feature to your
PR so nobody duplicates your work. A workflow enforces the issue link.
- Open an issue describing WHAT the change is, WHY it is needed, and optionally HOW.
- Wait for triage and the
ready-for-prlabel. - Fork, branch, and open a PR that links the issue (
Closes #123). - Make sure type-check, tests, and pre-commit hooks pass, and that your commits are signed.
Looking for a place to start? Try
good first issue
or help wanted.
The full policy is in CONTRIBUTING.md and CLAUDE.md. Security issues go through SECURITY.md β never a public issue.
- π Report a bug or request a feature
- π¬ Discussions
- π Security policy
- π§ support@shaharia.com
MIT β do what you like, no warranty.
Built with Bun Β· powered by @slack/web-api Β· inspired by gscli