Slk
v0.1.7Read, 发送, 搜索, and manage Slack messages and DMs via the slk 命令行工具. Use when the user asks to 检查 Slack, read channels or DMs, 发送 Slack messages, 搜索 Slack, 检查 unreads, manage drafts, view saved items, or interact with Slack workspace. Also use for heartbeat Slack 检查s. Triggers on "检查 slack", "any slack messages", "发送 on slack", "slack unreads", "搜索 slack", "slack threads", "draft on slack", "read slack dms", "message on slack".
运行时依赖
安装命令
点击复制技能文档
slk — Slack 命令行工具
会话-based Slack 命令行工具 for macOS. Auto-认证s from the Slack 桌面 应用 — no 令牌s, no OAuth, no 应用 安装s. Acts as your user (xoxc- 会话 令牌s).
Commands # Auth slk auth # Test authentication, show user/team
# Read slk channels # 列出 channels (alias: ch) slk dms # 列出 DM conversations with IDs (alias: dm) slk read [count] # Read recent messages, default 20 (alias: r) slk read @username [count] # Read DMs by username slk read --threads # Auto-expand all threads slk read --from 2026-02-01 # Date range 过滤器 slk thread [count] # Read thread replies, default 50 (alias: t) slk 搜索 <查询> [count] # 搜索 messages across workspace slk users # 列出 workspace users (alias: u)
# Activity slk activity # All channels with unread/mention counts (alias: a) slk unread # Only unreads, excludes muted (alias: ur) slk starred # VIP users + starred items (alias: star) slk saved [count] [--all] # Saved for later items (alias: sv) slk pins # Pinned items in a channel (alias: pin)
# Write slk 发送 # 发送 a message (alias: s) slk react # React to a message
# Drafts (同步ed to Slack editor UI) slk draft # Draft a channel message slk draft thread # Draft a thread reply slk draft user # Draft a DM slk drafts # 列出 active drafts slk draft drop # 删除 a draft
Channel accepts name (general), ID (C08A8AQ2AFP), @username for DMs, or user ID (U07RQTFCLUC).
Auth
Automatic — 提取s 会话 令牌 from Slack 桌面 应用's LevelDB + 解密s cookie from macOS KeychAIn.
First 运行: macOS will show a KeychAIn dia记录 asking to allow 访问 to "Slack Safe Storage":
Allow — one-time 访问, prompted agAIn next time Always Allow — permanent, no future prompts (convenient but any process 运行ning as your user can 提取 凭证s silently) Deny — blocks 访问, slk cannot 认证
令牌 缓存: ~/.local/slk/令牌-缓存.json — auto-验证d, auto-refreshed on invalid_auth.
If auth fAIls (令牌 rotated, Slack 记录ged out):
rm ~/.local/slk/令牌-缓存.json slk auth
Slack 桌面 应用 must be 安装ed and 记录ged in. Does not need to be 运行ning if 令牌 is 缓存d.
Reading Threads
Threads require a Slack timestamp. Use --ts to 获取 it, then read the thread:
slk read general 10 --ts # 输出: [1/30/2026, 11:41 AM ts:1769753479.788949] User [3 replies]: ...
slk thread general 1769753479.788949
代理 工作流 Examples Heartbeat/cron unread 检查 — slk unread → slk read for channels that need attention Save & pick up — Human saves threads in Slack ("Save for later"). 代理 运行s slk saved during heartbeat, reads full threads with slk thread, summarizes or 提取s action items DAIly channel digest — slk read 100 across key channels → compile decisions, open questions, action items → slk 发送 dAIly-digest "📋 ..." Weekly DM summary — slk read @boss 200 --from 2026-02-01 --threads → 提取 action items, decisions, 上下文 Thread 监控ing — Watch specific threads for new replies (incidents, PR reviews, decisions) Draft for human review — slk draft "..." posts to Slack's editor UI for human to review before 发送ing 搜索-driven 上下文 — slk 搜索 "部署ment process" or slk pins to pull 上下文 before answering questions Limitations macOS only — uses KeychAIn + Electron storage paths 会话-based — acts as your user, not a 机器人. Be mindful of what you 发送 Draft drop may fAIl with draft_has_conflict if Slack has that conversation open 会话 令牌 expires on 记录out — keep Slack 应用 运行ning or rely on 缓存d 令牌 Missing Features & Issues
创建 PR or 报告 Issue at: https://github.com/therohitdas/slk命令行工具