💬 Slk — Slack CLI工具
v1.0.0通过slk CLI读取、发送、搜索和管理Slack消息和私信。当用户要求检查Slack、阅读频道或私信、发送Slack消息、搜索Slack、检查未读、管理草稿、查看已保存项目或与Slack工作区交互时使用。也用于心跳Slack检查。在'检查Slack'、'任何Slack消息'、'在Slack上发送'、'Slack未读'、'搜索Slack'、'Slack线程'、'在Slack上草稿'、'阅读Slack私信'、'在Slack上发消息'时触发。
详细分析 ▾
运行时依赖
版本
macOS的Slack CLI技能初始版本。- 直接通过slk CLI阅读、发送、搜索和管理Slack消息和私信。- 支持Slack频道和私信阅读、发送消息、搜索、检查未读、管理草稿、已保存项目和查看线程。- 基于会话的认证:使用macOS Keychain从Slack桌面应用自动提取用户会话(无需令牌或OAuth)。- 专为个人代理工作流和心跳检查设计,具有广泛的命令选项。- 仅macOS;使用用户权限和会话行事。
安装命令 点击复制
技能文档
Session-based Slack CLI for macOS. Auto-authenticates from the Slack desktop app — no tokens, no OAuth, no app installs. Acts as your user (xoxc- session tokens).
Commands
# Auth
slk auth # Test authentication, show user/team# Read
slk channels # List channels (alias: ch)
slk dms # List 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 filter
slk thread [count] # Read thread replies, default 50 (alias: t)
slk search [count] # Search messages across workspace
slk users # List 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 send # Send a message (alias: s)
slk react # React to a message
# Drafts (synced 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 # List active drafts
slk draft drop # Delete a draft
Channel accepts name (general), ID (C08A8AQ2AFP), @username for DMs, or user ID (U07RQTFCLUC).
Auth
Automatic — extracts session token from Slack desktop app's LevelDB + decrypts cookie from macOS Keychain.
第一个 run: macOS 将 show Keychain 对话框 asking 到 allow access 到 "Slack Safe Storage":
- Allow — one-时间 access, prompted again 下一个 时间
- Always Allow — permanent, 否 future prompts (convenient 但是 任何 process running 作为 用户 可以 extract credentials silently)
- Deny — blocks access, slk cannot 认证
令牌 缓存: ~/.local/slk/令牌-缓存.json — auto-validated, auto-refreshed 在...上 invalid_auth.
If auth fails (token rotated, Slack logged out):
rm ~/.local/slk/token-cache.json
slk auth
Slack desktop app must be installed and logged in. Does not need to be running if token is cached.
Reading Threads
Threads require a Slack timestamp. Use --ts to get it, then read the thread:
slk read general 10 --ts
# Output: [1/30/2026, 11:41 AM ts:1769753479.788949] User [3 replies]: ...slk thread general 1769753479.788949
Agent Workflow Examples
- Heartbeat/cron unread check —
slk unread→slk 读取对于 channels 需要 attention - 保存 & pick up — Human saves threads 在...中 Slack ("保存 对于 later"). Agent runs
slk saved期间 heartbeat, reads 满 threads 带有slk thread, summarizes 或 extracts action items - Daily channel digest —
slk 读取穿过 键 channels → compile decisions, 打开 questions, action items →100 slk 发送 daily-digest "📋 ..." - Weekly DM summary —
slk 读取 @boss 200 --从 2026-02-01 --threads→ extract action items, decisions, context - Thread monitoring — Watch specific threads 对于 新的 replies (incidents, PR reviews, decisions)
- Draft 对于 human review —
slk draftposts 到 Slack's editor UI 对于 human 到 review 之前 sending"..." - 搜索-driven context —
slk 搜索 "deployment process"或slk pins到 拉取 context 之前 answering questions
Limitations
- macOS 仅 — uses Keychain + Electron storage paths
- 会话-based — acts 作为 用户, 不 bot. mindful 的 什么 您 发送
- Draft drop 可能 失败 带有
draft_has_conflict如果 Slack 有 conversation 打开 - 会话 令牌 expires 在...上 登出 — keep Slack app running 或 rely 在...上 cached 令牌
Missing Features & Issues
Create PR or Report Issue at: https://github.com/therohitdas/slkcli
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制