slack-personal

Review·Scanned 2/18/2026

This skill is a macOS Slack CLI that auto-extracts the Slack desktop app session to read, search, send, and draft messages. It runs local commands (security, sqlite3, openssl, python3, curl), accesses Keychain/cookie/LevelDB files (~/.local/slk/token-cache.json, <slack-data-dir>/Cookies, <slack-data-dir>/Local Storage/leveldb/), and calls https://slack.com/api.

from clawhub.ai·vc8a1a84·58.2 KB·0 installs
Scanned from 0.1.6 at c8a1a84 · Transparency log ↗
$ vett add clawhub.ai/therohitdas/slack-personalReview findings below

slk 💬 — Slack CLI for macOS, so your agents can read and send messages

slk is a Slack command-line tool for macOS that auto-extracts auth from the Slack desktop app. Read channels, send messages, search, manage drafts, track unreads, and view pins — no tokens, no OAuth, no config.

Built for AI agents and terminal workflows. Zero dependencies. Zero setup.

Not affiliated with Slack. This is an independent Slack CLI built for personal productivity and agent automation. It uses session credentials from the Slack desktop app and works only on macOS. Use at your own discretion.

Install

npm install -g slkcli

One-shot (no install):

npx slkcli auth

Requirements: macOS, Slack desktop app (installed and logged in), Node.js 18+.

Agent Skill

Add to your AI agent (Claude Code, Codex, Moltbot, etc.):

# ClawdHub
clawdhub install slack-personal

# skills.sh
npx skills add therohitdas/slkcli

Browse on ClawdHub.

Quickstart

# Verify your session works
slk auth

# List channels
slk channels

# Read the last 20 messages in a channel
slk read general
slk read C08A8AQ2AFP        # by channel ID

# Send a message
slk send general "Hello from slk"

# Search across the workspace
slk search "deployment failed"

# Check what's unread
slk unread

# See starred items and VIP users
slk starred

# See saved for later items
slk saved

# See pinned messages in a channel
slk pins general

# Read a thread
slk thread general 1234567890.123456

# React to a message
slk react general 1234567890.123456 thumbsup

Commands

CommandAliasDescription
slk authTest authentication, show user/team info
slk channelschList all channels with member counts
slk dmsdmList DM conversations with IDs
slk usersuList workspace users with statuses
slk read <channel> [count]rRead recent messages (default: 20)
slk send <channel> <message>sSend a message to a channel
slk search <query> [count]Search messages across the workspace
slk thread <channel> <ts> [count]tRead thread replies (default: 50)
slk react <channel> <ts> <emoji>Add an emoji reaction to a message
slk activityaShow all channel activity with unread/mention counts
slk unreadurShow only channels with unreads (excludes muted)
slk starredstarShow VIP users and starred items
slk saved [count]svShow saved for later items (active by default, --all includes completed)
slk pins <channel>pinShow pinned items in a channel

Flags

FlagDescription
--tsShow raw Slack timestamps (useful for getting ts to read threads)
--threadsAuto-expand all threads when reading messages
--from YYYY-MM-DDRead messages from this date onwards
--to YYYY-MM-DDRead messages until this date
--no-emojiDisable emoji in output (or set NO_EMOJI=1)
--allInclude completed items in slk saved
# Get timestamps to use with thread command
slk read general 10 --ts
# Output: [1/30/2026, 11:41:19 AM ts:1769753479.788949] User [3 replies]:

# Then read that thread
slk thread general 1769753479.788949

Drafts

Drafts sync to Slack — they appear in the Slack editor UI.

CommandDescription
slk draft <channel> <message>Draft a channel message
slk draft thread <channel> <ts> <message>Draft a thread reply
slk draft user <user_id> <message>Draft a DM
slk draftsList all active drafts
slk draft drop <draft_id>Delete a draft

Channel resolution

Channels can be specified by name or ID in any command:

slk read general           # by name
slk read ai-coding         # by name
slk read C08A8AQ2AFP       # by ID

DMs

Read, send, and react to DMs using @username or user ID:

# List all DM conversations
slk dms

# Read DMs by username
slk read @andrej 50
slk read @nikhil 100 --threads    # auto-expand threads

# Read DMs with date range
slk read @andrej 100 --from 2026-02-01 --to 2026-02-07 --threads

# Send DM
slk send @andrej "hey, check this out"

# React to DM message
slk react @andrej 1769753479.788949 fire

# By user ID (U...)
slk read U07RQTFCLUC 50

Authentication

slk uses the credentials already stored by the Slack desktop app. No OAuth flows, no manual token management.

Keychain access prompt

On first run, macOS will show a Keychain dialog asking whether to allow access to "Slack Safe Storage":

  • Allow — grants one-time access. You'll be prompted again next time slk needs to decrypt the cookie.
  • Always Allow — grants permanent access for this binary. No future prompts.
  • Deny — blocks access. slk cannot authenticate.

Caution: Choosing "Always Allow" means any process running as your user that invokes the slk binary (or the security command targeting "Slack Safe Storage") can read the encryption key without a prompt. This is convenient but reduces the security boundary — any code running in your terminal (scripts, agents, other CLI tools) could trigger credential extraction silently. On a personal machine this is a reasonable trade-off. On a shared or managed machine, prefer "Allow" so you get prompted each time and maintain visibility into access.

How it works

  1. Cookie decryption — Reads the encrypted d cookie from Slack's SQLite cookie store (Cookies file). Decrypts it using the "Slack Safe Storage" key from the macOS Keychain via PBKDF2 + AES-128-CBC. Supports both direct-download and Mac App Store keychain account names.

  2. Token extraction — Scans Slack's LevelDB storage (Local Storage/leveldb/) for xoxc- session tokens. Uses both direct regex scanning and a Python fallback for Snappy-compressed entries. The Slack data directory is auto-detected (direct download or App Store sandbox).

  3. Validation — Tests each candidate token against auth.test with the decrypted cookie. The first valid pair is used.

  4. Auto-refresh — On invalid_auth, credentials are re-extracted and the request is retried once automatically.

Token caching

Validated tokens are cached to avoid re-extracting on every invocation:

Cache file~/.local/slk/token-cache.json
Format{ "token": "xoxc-...", "ts": 1706000000000 }
BehaviorLoad cache → validate with Slack API → use if valid, otherwise re-extract from LevelDB
In-memoryWithin a single process, credentials are cached in memory after first load

Credential resolution order

1. In-memory cache (same process)
2. Disk cache (~/.local/slk/token-cache.json) → validate → use if ok
3. Fresh extraction from Slack desktop app → validate → cache → use

What it reads from your system

DataSourcePurpose
Keychain passwordsecurity find-generic-password -s "Slack Safe Storage"Derive AES key for cookie decryption
Encrypted cookie<slack-data-dir>/Cookies (SQLite)Decrypt the d session cookie (xoxd-)
Session token<slack-data-dir>/Local Storage/leveldb/Extract xoxc- token

Agent usage patterns

slk is designed to be used by AI agents. Common patterns:

# Check auth before doing anything
slk auth

# Get channel list, find the right one
slk channels

# Read recent context from a channel
slk read engineering 50

# Search for something specific
slk search "PR review needed"

# Check what needs attention
slk unread

# See pinned context in a channel
slk pins engineering

# Send a message
slk send engineering "Build passed on main"

# Read a thread for full context
slk thread engineering 1706000000.000000

# Draft a message for human review (appears in Slack UI)
slk draft engineering "Here's the summary of today's standup..."

Exit codes: 0 on success, 1 on error. Errors are printed to stderr.

How it was installed

The bin field in package.json maps slk to ./bin/slk.js:

{ "bin": { "slk": "./bin/slk.js" } }

Running npm install -g creates a symlink in your PATH:

/opt/homebrew/bin/slk -> ../lib/node_modules/slkcli/bin/slk.js

Development

git clone https://github.com/therohitdas/slk.git
cd slk
node bin/slk.js auth       # run directly
npm link                   # symlink globally for development

Notes

  • macOS only — uses Keychain and Electron storage paths specific to macOS.
  • Both Slack variants supported — works with the direct download (~/Library/Application Support/Slack/) and the Mac App Store version (~/Library/Containers/com.tinyspeck.slackmacgap/.../Slack/). The correct path is auto-detected at runtime.
  • Slack desktop app required — must be installed and logged in. The app does not need to be running for cached tokens.
  • Zero dependencies — uses only Node.js built-in modules (crypto, fs, child_process, fetch).
  • Session-based — uses xoxc- tokens (user session), not bot tokens. This means you act as yourself.
  • Mute-awareactivity and unread commands respect your mute settings.