A Go CLI wrapper over slackdump for quickly grabbing Slack conversations without admin access. Given a thread link, dump the thread. Given two message links (start/end), dump that range. Output goes to stdout as readable text.
Requires Go 1.25+.
git clone https://github.com/matthewvolk/slacker.git
cd slacker
go install .This builds the binary and places it in your $GOBIN directory (defaults to ~/go/bin). Make sure $GOBIN is on your $PATH:
# Add to your ~/.zshrc or ~/.bashrc if not already there
export PATH="$PATH:$(go env GOBIN)"
# Or if GOBIN is unset (uses the default):
export PATH="$PATH:$(go env GOPATH)/bin"After source code changes, run go install . again from the repo to update the binary in place.
# Thread mode: dump an entire thread
slacker "https://workspace.slack.com/archives/C123ABC456/p1577694990000400"
# Range mode: dump messages between two message links (same channel)
slacker "https://workspace.slack.com/archives/C123ABC456/p1577694990000400" \
"https://workspace.slack.com/archives/C123ABC456/p1577700000000000"
# JSON output for programmatic use
slacker --json "https://workspace.slack.com/archives/C123ABC456/p1577694990000400"| Flag | Description |
|---|---|
--help, -h |
Show help message |
--version |
Show version |
--json |
Output as JSON instead of plain text |
--no-interactive |
Fail instead of opening browser for auth |
| Command | Description |
|---|---|
tz [timezone] |
Show or set the display timezone (IANA name) |
purge |
Clear cached user data |
> Alice Smith (@asmith) @ 2026-02-26 23:53:32 CST:
Hey @bjones, check out this thread
| > Bob Jones (@bjones) @ 2026-02-26 23:54:10 CST:
| Thanks @asmith!
- Thread replies are indented with
|prefix <@U123ABC>mentions are resolved to@username- Message headers show full name,
@username, and timestamp (ISO 8601) - Output goes to stdout, so you can pipe it anywhere:
# Copy to clipboard (macOS)
slacker "https://..." | pbcopy
# Save to file
slacker "https://..." > thread.txtslacker --json "https://..." | jq .{
"messages": [
{
"user": "Alice Smith",
"username": "asmith",
"timestamp": "2026-02-26T23:53:32-06:00",
"text": "Hey @bjones, check out this thread",
"replies": [
{
"user": "Bob Jones",
"username": "bjones",
"timestamp": "2026-02-26T23:54:10-06:00",
"text": "Thanks @asmith!"
}
]
}
]
}| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Usage error (bad arguments, invalid URL) |
| 3 | Authentication error |
| 4 | Network/API error |
Slacker checks for credentials in this order:
- Environment variables —
SLACK_TOKENandSLACK_COOKIEset in your shell .envfile in the current working directory (project-specific override)- Global credentials file — stored in the OS config directory (see below)
- Browser login — interactive prompt as a last resort (disabled by
--no-interactive)
On first run (or when credentials expire), slacker opens an interactive browser prompt via slackdump's ROD auth, supporting Okta SSO, Google SSO, email/password, and more.
After a successful browser login, credentials are automatically saved to the global credentials file so subsequent runs from any directory work without re-authenticating.
Use --no-interactive to disable this fallback (e.g., in scripts or CI). Slacker will fail with exit code 3 if no credentials are available.
Credentials are stored in the OS config directory:
- macOS:
~/Library/Application Support/slacker/credentials.env - Linux:
~/.config/slacker/credentials.env
You can also override with a .env file in the current directory (useful for project-specific workspaces) or by setting SLACK_TOKEN and SLACK_COOKIE environment variables directly.
- Open your Slack workspace in a browser
- Open Developer Tools (F12) → Network tab
- Look for any request to
api.slack.com - Copy the
tokenparameter (starts withxoxc-) and thedcookie value (starts withxoxd-)
Timestamps default to UTC. Set the TZ environment variable to display in your local timezone:
export TZ=America/Chicago
slacker "https://..."Or set it in your shell profile (~/.zshrc or ~/.bashrc) for persistence.
Valid values are any IANA timezone name (e.g., America/New_York, Europe/London, Asia/Tokyo).
Slacker caches workspace user data (display names and usernames) to avoid hitting the Slack API on every run. The cache is stored at:
- macOS:
~/Library/Caches/slacker/users.json - Linux:
~/.cache/slacker/users.json
The cache expires after 24 hours and is automatically refreshed on the next run. To force a refresh, delete the cache file or run slacker purge.
slacker/
main.go — entry point, auth, CLI orchestration
format.go — text formatting, JSON output, @mention replacement, timezone handling
parse.go — Slack URL parsing, timestamp extraction
cache.go — user cache (JSON file with 24h TTL)
- stdout-only output: All conversation text goes to stdout. Errors and status messages (auth saved, etc.) go to stderr. This makes slacker composable with pipes and redirects — ideal for use by AI agents or scripts.
- Reimplemented internals: slackdump's URL parser and text formatter live under
internal/, which Go prevents external modules from importing. Slacker reimplements two small pieces: URL-to-timestamp parsing (~15 lines) and text formatting (~60 lines). - Silent by default: slackdump's internal logging is suppressed via a discard logger to keep output clean and minimize token usage when used by AI agents.
- Thread-aware formatting: When dumping a thread URL, slackdump returns all messages flat (parent first, then replies). Slacker detects this via
conv.IsThread()and applies reply indentation. For channel dumps, replies come nested inThreadRepliesand are handled recursively. - Semantic exit codes: Different failure modes produce distinct exit codes (2=usage, 3=auth, 4=API) so calling scripts can handle errors appropriately.
- slackdump v4 — Slack API client and message dumper
- godotenv —
.envfile loading