slack-term
v1.14.0
Published
Slack CLI — read activity/news/mentions, search, send messages with a confirm-hash safety gate.
Maintainers
Readme
slack — Slack CLI
A lightweight Slack CLI for quick workspace interaction from the terminal.
Two implementations — TypeScript (bun-first, published to npm) and Rust
(native binary, cargo install) — share one command surface and are verified
byte-for-byte by tests/parity.sh.
Features
- News — Activity feed showing recent mentions (
to:me), grouped by day with human-readable timestamps - Messages — Browse recent messages across joined channels
- Tail — Stream new messages from a channel in real time (like
tail -f) - Search — Full-text search across the workspace
- Send — Send messages to channels or DMs with a confirm-hash safety gate (prevents accidental sends)
- Dump — Bulk-export channel history as markdown
Output formatting
- DM channels display as
@DisplayName, public channels as#channel-name - Slack
<@UID>mention tokens are resolved to display names - Slack
<!date^...>markup is rendered as human-readable dates - Messages are grouped by day (Today / Yesterday / weekday)
Installation
TypeScript (npm, recommended)
One package, no native binaries, any platform with Node 18+.
npm install -g slack-term
# or: bun add -g slack-term | pnpm add -g slack-termNote: Previously published as
@snomiao/slack(now deprecated).
Rust (cargo)
cargo install --path rsBoth expose the same slack command.
Usage
# Activity feed (mentions directed to you)
slack news
slack news --limit 5
# Recent messages across joined channels
slack msgs
# Search messages
slack search "deploy"
slack search "deploy" --count 50
# Send a message (two-step confirm — quote #channel)
slack send "#general" "Hello team"
# Prints preview + confirm hash; rerun with --confirm=<hash> to actually send
slack send "#general" "Hello team" --confirm=<hash>
# Bulk export channel history
slack dump --days 7 --filter eng
# Stream new messages in real time (Ctrl-C to stop)
slack tail "#general"
slack tail "#general" --since=10m # backfill last 10 minutes first
slack tail "#general" --thread=<ts> # follow a single thread
slack tail "#general" --me # only messages that mention youtail — real-time message stream
slack tail polls a channel every 3 seconds (configurable via --interval) and
prints new messages as they arrive, in the same [ts] @handle: text format as
the read command.
slack tail "#symval" # follow new messages from now
slack tail "#symval" --since=30m # backfill 30 minutes, then stream
slack tail "#symval" --thread=1700000000.000100 # one thread only
slack tail "#symval" --me # only messages mentioning youNote: Cross-channel mention streaming (--me without a target) is not yet
supported — a target channel is required.
Configuration
Requires a Slack user token (xoxp-...) with the following scopes:
search:read— for search and newschannels:history,groups:history,im:history,mpim:history— for message historychannels:read,groups:read,im:read,mpim:read— for channel listingusers:read— for resolving display nameschat:write— for sending messages
Set the token via environment variable:
export SLACK_MCP_XOXP_TOKEN=xoxp-...Or place it in ~/.config/slack-cli/.env or a local .env file.
See SKILL.md for a full token-acquisition walkthrough.
Development
# TypeScript
bun install
bun run dev -- news --limit 3 # run straight from source
bun run typecheck
bun run build # produces dist/cli.js
# Rust
cargo run --manifest-path rs/Cargo.toml --release --bin slack -- news --limit 3
# Parity test (requires a token — compares Rust and TS stdout)
bun run test:parityDependencies
TypeScript impl — zero runtime deps; uses built-in fetch, node:crypto,
node:util argument parsing.
Rust impl
- clap — CLI argument parsing
- reqwest — HTTP client for Slack Web API
- tokio — async runtime
- chrono — date/time formatting
- ring — SHA-256 for confirm hashes
Release notes
v0.x — 2026-05-15: slack tail
New tail subcommand streams channel messages in real time using poll-based
delivery (3-second interval). Supports --since=<duration> for backfill,
--thread=<ts> to follow a single thread, and --me to filter for messages
that mention you. Uses conversations.history?oldest=<ts> as a cursor so
already-seen messages are never re-printed, even across reconnects.
Related / prior art
slkcliby @therohitdas — a macOS-only Node CLI that auto-extractsxoxc-session tokens from the Slack desktop app. Different tradeoffs (zero-config on macOS vs. our cross-platform explicit-token approach). Seedocs/comparison-slkcli.mdfor a full UX side-by-side.docs/ecosystem.md— survey of other terminal Slack tools (official,slack-term,wee-slack,slackcat,slackdump, …).
License
MIT
