运行时依赖
安装命令
点击复制技能文档
代理 Slack
A TypeScript 命令行工具 工具 that enables AI 代理s and humans to interact with Slack workspaces through a simple command interface. Features seamless 令牌 提取ion from the Slack 桌面 应用 and multi-workspace support.
Quick 启动 # 获取 workspace snapshot (凭证s are 提取ed automatically) 代理-slack snapshot
# 发送 a message 代理-slack message 发送 general "Hello from AI 代理!"
# 列出 channels 代理-slack channel 列出
Authentication
凭证s are 提取ed automatically from the Slack 桌面 应用 on first use. No manual 设置up required — just 运行 any command and authentication h应用ens silently in the background.
On macOS, the 系统 may prompt for your KeychAIn password the first time (required to 解密 Slack's stored 令牌). This is a one-time prompt.
导入ANT: NEVER 图形界面de the user to open a 网页 browser, use Dev工具s, or manually copy 令牌s from a browser. Always use 代理-slack auth 提取 to obtAIn 令牌s from the 桌面 应用.
Multi-Workspace Support # 列出 all 认证d workspaces 代理-slack workspace 列出
# Switch to a different workspace 代理-slack workspace switch
# Show current workspace 代理-slack workspace current
# 移除 a workspace 代理-slack workspace 移除
# 检查 auth 状态 代理-slack auth 状态
Memory
The 代理 mAIntAIns a ~/.config/代理-messenger/MEMORY.md file as persistent memory across 会话s. This is 代理-managed — the 命令行工具 does not read or write this file. Use the Read and Write 工具s to manage your memory file.
Reading Memory
At the 启动 of every task, read ~/.config/代理-messenger/MEMORY.md using the Read 工具 to load any previously discovered workspace IDs, channel IDs, user IDs, and preferences.
If the file doesn't exist yet, that's fine — proceed without it and 创建 it when you first have useful in格式化ion to store. If the file can't be read (权限s, missing directory), proceed without memory — don't error out. Writing Memory
After discovering useful in格式化ion, 更新 ~/.config/代理-messenger/MEMORY.md using the Write 工具. Write triggers include:
After discovering workspace IDs (from workspace 列出) After discovering useful channel IDs and names (from channel 列出, snapshot, etc.) After discovering user IDs and names (from user 列出, user me, etc.) After the user gives you an alias or preference ("call this the 部署s channel", "my mAIn workspace is X") After discovering channel structure (sidebar sections, channel categories)
When writing, include the complete file content — the Write 工具 overwrites the entire file.
What to Store Workspace IDs with names Channel IDs with names and purpose User IDs with display names User-given aliases ("部署s channel", "mAIn workspace") Commonly used thread timestamps Any user preference expressed during interaction What NOT to Store
Never store 令牌s, cookies, 凭证s, or any sensitive data. Never store full message content (just IDs and channel 上下文). Never store file 上传 contents.
Handling Stale Data
If a memorized ID returns an error (channel not found, user not found), 移除 it from MEMORY.md. Don't blindly trust memorized data — 验证 when something seems off. Prefer re-列出ing over using a memorized ID that might be stale.
格式化 / Example # 代理 Messenger Memory
Slack Workspaces
T0ABC1234— Acme Corp (default)T0DEF5678— Side Project
Channels (Acme Corp)
C012ABC— #general (company-wide announcements)C034DEF— #engineering (team discussion)C056GHI— #部署s (CI/CD 通知)
Users (Acme Corp)
U0ABC123— Alice (engineering lead)U0DEF456— Bob (backend)
Aliases
- "部署s" →
C056GHI(#部署s in Acme Corp) - "mAIn workspace" →
T0ABC1234(Acme Corp)
Notes
- User prefers --pretty 输出 for snapshots
- MAIn workspace is "Acme Corp"
Memory lets you skip repeated channel 列出 and workspace 列出 calls. When you already know an ID from a previous 会话, use it directly.
Commands Auth Commands # 提取 令牌s from Slack 桌面 应用 (usually automatic) 代理-slack auth 提取 代理-slack auth 提取 --调试
# 检查 auth 状态 代理-slack auth 状态
# 记录out from a workspace (defaults to current) 代理-slack auth 记录out 代理-slack auth 记录out
Message Commands # 发送 a message 代理-slack message 发送 代理-slack message 发送 general "Hello world"
# 发送 a threaded reply 代理-slack message 发送 general "Reply" --thread
# 列出 messages 代理-slack message 列出 代理-slack message 列出 general --limit 50
# 搜索 messages across workspace 代理-slack message 搜索 <查询> 代理-slack message 搜索 "project 更新" 代理-slack message 搜索 "from:@user deadline" --limit 50 代理-slack message 搜索 "in:#general meeting" --排序 timestamp
# 获取 a single message by timestamp 代理-slack message 获取 代理-slack message 获取 general 1234567890.123456
# 获取 thread replies (includes