Slack from your terminal or coding agent. One Rust executable.
slk reads conversations, searches messages, replies to threads, uploads files,
and manages drafts using the account already signed into Slack Desktop.
No Node.js, Python, Homebrew, Rust toolchain, or database installation is needed
to run a release binary.
Download the latest release · WhatsApp CLI · Command guide for agents
Requires macOS 11 or newer and Slack Desktop signed in. Supports both Apple
Silicon (M-series) and Intel Macs. This project is independent of Slack; it is
not an official Slack SDK or the slack app-development CLI.
- Open the release page and download
slk-macos-arm64.tar.gzfor Apple Silicon, orslk-macos-x86_64.tar.gzfor Intel. About This Mac shows your chip. - Extract the archive. It contains
slk, this README, and the license. - In Terminal, install the extracted executable:
mkdir -p "$HOME/.local/bin"
# Run this in the folder containing the extracted slk file:
install -m 755 ./slk "$HOME/.local/bin/slk"
export PATH="$HOME/.local/bin:$PATH"
slk --version
slk authAdd export PATH="$HOME/.local/bin:$PATH" to ~/.zshrc once to keep it available
in new terminals. Existing npm users should check which -a slk and put
~/.local/bin first in PATH. The Rust version can reuse the existing session
cache. The old npm installation is no longer required.
Agents should install the repository skill alongside the CLI so Slack work uses
the native slk workflow:
mkdir -p "$HOME/.agents/skills"
cp -R skills/grail-slack-cli "$HOME/.agents/skills/grail-slack-cli"Repeat the copy after updating this repository so the global skill matches the checked-in version.
The downloads are ad-hoc signed, not Apple-notarized. macOS may block a
browser download. After verifying the release and checksum, allow that specific
binary in System Settings → Privacy & Security. If macOS still quarantines the
file, xattr -d com.apple.quarantine "$HOME/.local/bin/slk" removes quarantine
from that file only; do not disable Gatekeeper globally.
SHA256SUMS accompanies each release. Verify the downloaded archive with
shasum -a 256 slk-macos-arm64.tar.gz (or the Intel filename) and compare it
with the matching line in SHA256SUMS before installing.
On first use, macOS may ask for access to Slack Safe Storage. Enter your Mac login / Keychain password in the native dialog and click Always Allow (or Always Allow Access). This is not your Slack password. Never paste it into a terminal command, agent chat, or issue.
slk auth reports the user and workspace; verify these before sending anything.
Commands act with that user's permissions. The CLI validates its cached session
on each run and refreshes it from Slack Desktop when necessary. Keychain changes,
logout, revoked sessions, or a changed executable can require approval again.
With multiple signed-in workspaces, the default is Grail Computer. To select
a different workspace by its displayed name or team ID, pass --workspace; the
selected credentials become the cache used by subsequent commands:
slk auth
slk auth --refresh # Re-read the desktop session and Keychain
slk auth --workspace "Grail Computer" --refresh
slk auth --workspace T123456789 --refreshCredentials are cached at ~/.local/slk/token-cache.json (file mode 0600,
directory 0700). Never share or commit this file. No session credentials are
printed or passed to subprocesses. Requests use HTTPS directly from the binary.
The Slack cookie database is opened read-only; the CLI does not alter app files.
All successful commands print JSON to stdout. Errors print JSON to stderr and exit nonzero; help/argument errors use the normal CLI help format. Output may contain private conversations, so protect redirected files accordingly.
slk channels
slk dms
slk users
slk read general 20
slk read @alex 100 --threads
slk read general 100 --from 2026-01-01 --to 2026-02-01
slk thread CHANNEL_ID THREAD_TIMESTAMP 100
slk search 'in:general "release"' 20
slk search 'in:general "release"' 20 --page 2
slk unread
slk activity
slk pins general
slk starred
slk saved 20
slk saved 20 --allChannels accept a name, #name, or exact channel ID. DMs accept @username or a
user ID. Ambiguous names fail; use an exact ID. A read command never creates a
new DM. read returns newest first; thread returns oldest first, including the
parent. Date boundaries use UTC: --from is inclusive and --to exclusive.
Search queries containing spaces must be quoted; search supports up to 100
results per page.
List/read/thread commands follow Slack cursors until the requested count is
reached. If has_more is true, use next_cursor with read --cursor or
thread --cursor; use api for other cursor-based endpoints. Search returns
Slack's page metadata. A non-cursor has_more response requires inspecting the
raw API response and continuing with that endpoint's pagination parameters.
--threads expands each returned parent, potentially making many requests.
Slack rate limits are reported with the retry interval; writes are never retried
automatically because doing so could duplicate a message.
Messages sent through the CLI automatically end with the italicized footer
Sent by Agent, so agent/automation messages are visually distinguishable from
messages typed manually. The footer is also added to upload captions and direct
chat.postMessage calls made through slk api; it is not added to drafts.
Inline \\n sequences are converted to real line breaks, while text supplied
with --text-file or --caption-file keeps its contents unchanged.
slk send general "Build passed"
slk send CHANNEL_ID --thread THREAD_TIMESTAMP --text-file reply.txt
slk upload CHANNEL_ID report.pdf "Review copy"
slk upload CHANNEL_ID report.pdf --thread THREAD_TIMESTAMP --caption-file caption.txt
slk react CHANNEL_ID MESSAGE_TIMESTAMP eyesText files preserve real newlines. --thread keeps replies and attachments in
the intended thread. After posting, read the thread back and verify the message
or attachment ID; Slack may normalize links in the returned text. Inspect a
successful or uncertain response before retrying.
slk draft general "Review this before sending"
slk draft thread CHANNEL_ID THREAD_TIMESTAMP "Proposed reply"
slk draft user USER_ID "Proposed DM"
slk drafts
slk draft drop DRAFT_IDDrafts sync into Slack's UI. Drafts, saved items, preferences, and activity use internal Slack APIs that can change or be unavailable for some accounts. Such failures are reported explicitly; the CLI does not silently substitute a send.
Use slk api when you need a Slack endpoint that has no dedicated command.
Parameters come from a JSON object in a file, preserving structured fields and
newlines. This command can perform writes; review the method and parameters.
slk api auth.test
slk api conversations.replies --params-file request.jsonExample request.json:
{"channel":"CHANNEL_ID","ts":"THREAD_TIMESTAMP","limit":100}Use files.info to inspect attachment metadata and sharing. Download screenshots,
PDFs, and other private attachments using the same desktop session:
slk download FILE_ID /absolute/path/to/image.pngThe output path must be new. Downloads use owner-only permissions, verify the
size supplied by Slack, and leave no partial output after a failed download.
Credentials are sent only to HTTPS files.slack.com; redirects are rejected.
No Slack messages are sent and file sharing is unchanged.
See slk --help and slk COMMAND --help for options.
Aliases from the earlier CLI remain (ch, dm, u, r, t, s, a, ur,
star, sv, pin). Output changed from decorated text to JSON. WhatsApp is now
its own CLI, wacli.
- Wrong account or expired session: sign into the intended Slack Desktop
account, then run
slk auth --workspace "Workspace Name" --refresh. The selector accepts the workspace name or team ID and reports available workspaces if the requested one is not found. - Keychain denied: retry refresh and approve the native dialog. Do not copy another person's cache or credentials.
- Desktop data not found: use the native Slack Mac app. Direct-download and Mac App Store locations are supported; browser-only login is insufficient.
- Permission denied: check access to Slack app data for your terminal/agent.
- Rate limited: wait the interval shown, then retry the read. Check whether an uncertain write succeeded before resending.
- Method/schema changed: report the error and app version without tokens, cookies, private messages, or database files. Internal APIs are unofficial.
- Old version still runs: inspect
which -a slkand correct PATH ordering.
End users only need the download. Contributors need Rust 1.92+ and Xcode Command Line Tools. SQLite and TLS are linked into the executable; dynamic dependencies are macOS system libraries/frameworks. No helper executables run at runtime.
cargo test --locked
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo build --locked --release
./target/release/slk --help
./scripts/package.shThe packaging script builds Apple Silicon and Intel archives in dist/, with
SHA-256 checksums. CI runs tests/lint and builds both targets; live authentication
requires your local Slack session and is never run with CI secrets.
We bundle SQLite rather than using the Rust Turso engine because these are live SQLite files owned by another process. Turso's compatibility guide explicitly excludes mixed SQLite/Turso multi-process access. This choice adds no installation dependency for users.
The main branch and its releases are macOS-only: authentication depends on
Slack Desktop and the macOS Keychain. Linux is served by a separate Go CLI kept
on the linux-agent-footer
branch under linux/slk. It is based on howar31/slk
v0.8.1, authenticates with its own Slack OAuth token instead of Slack Desktop,
and appends the same Sent by Agent footer to outgoing messages.
git switch linux-agent-footer
cd linux/slk
go test ./...
go build -trimpath -ldflags='-s -w' -o slk ./cmd/slk
./slk auth set-tokenBuilding needs Go 1.25+. The two implementations do not share code, so the
branch is maintained alongside main and is not merged into it. See
linux/README.md and linux/slk/README.md on that branch for details.
MIT. Rust implementation maintained by Grail Computer, based on the workflows and authentication approach of Rohit Das's slkcli. Original license and source history are retained; see UPSTREAM.md. Slack is a trademark of its owner; this project is not affiliated with Slack.