slack-cli-read

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

slack-cli-read

slack-cli-read

Use this skill to read Slack content via the global
slack
command.
通过全局
slack
命令使用此技能读取Slack内容。

Scope

适用范围

  • Read-only commands are supported.
  • Writing/sending/replying is not implemented yet. If asked to write, state that it is not available yet and offer to draft message text only.
  • 支持只读命令。
  • 暂未实现写入/发送/回复功能。如果被要求执行写入操作,请告知该功能暂不可用,并仅提供草拟消息文本的服务。

Environment

环境要求

  • Assume
    slack
    is available as a global command.
  • Slack credentials are expected at
    ~/.config/slack/slack.env
    .
  • Required variables:
    • SLACK_WORKSPACE
    • TOKEN
    • D_COOKIE
  • If auth fails or env vars are missing, help the user populate that file.
  • 假设
    slack
    已作为全局命令可用。
  • Slack凭证需存放在
    ~/.config/slack/slack.env
    路径下。
  • 必填变量:
    • SLACK_WORKSPACE
    • TOKEN
    • D_COOKIE
  • 如果认证失败或缺少环境变量,协助用户填充该文件。

Command Map

命令映射

  • Login bootstrap (interactive):
    slack auth login <workspace>
  • Auth diagnostics:
    slack auth status
  • Verify auth/workspace:
    slack me
  • List all conversations:
    slack chat list
  • List unread conversations:
    slack chat list --unread
  • List DM inbox:
    slack dm list
  • List unread DMs:
    slack dm list --unread
  • Read chat history:
    slack chat history "<chat>" --limit 30
  • Read DM history:
    slack dm history <user_or_dm_id> --limit 30
  • Read full thread:
    slack thread show <chat_or_dm> <thread_ts>
  • Read one full message:
    slack chat message <chat_or_dm> <ts>
  • Search users:
    slack users list --query <text>
  • Raw API call (expert mode):
    slack api call <endpoint> -p key=value
  • Raw API curl wrapper (expert mode):
    slack api curl <endpoint> -- [curl args]
  • 登录引导(交互式):
    slack auth login <workspace>
  • 认证诊断:
    slack auth status
  • 验证认证/工作区:
    slack me
  • 列出所有对话:
    slack chat list
  • 列出未读对话:
    slack chat list --unread
  • 列出私信收件箱:
    slack dm list
  • 列出未读私信:
    slack dm list --unread
  • 查看聊天历史:
    slack chat history "<chat>" --limit 30
  • 查看私信历史:
    slack dm history <user_or_dm_id> --limit 30
  • 查看完整线程:
    slack thread show <chat_or_dm> <thread_ts>
  • 查看单条完整消息:
    slack chat message <chat_or_dm> <ts>
  • 搜索用户:
    slack users list --query <text>
  • 原始API调用(专家模式):
    slack api call <endpoint> -p key=value
  • 原始API curl包装器(专家模式):
    slack api curl <endpoint> -- [curl args]

Working Style

工作流程

  1. Start broad with
    chat list
    or
    dm list
    when intent is vague.
  2. Narrow into history with a bounded
    --limit
    .
  3. Expand parent threads via
    thread show
    when inline replies are truncated.
  4. Fetch exact messages with
    chat message
    when full text is needed.
  1. 当意图不明确时,先使用
    chat list
    或
    dm list
    进行大范围查询。
  2. 通过设置
    --limit
    参数缩小范围查看历史记录。
  3. 当内嵌回复被截断时,使用
    thread show
    展开父线程。
  4. 当需要完整文本时,使用
    chat message
    获取特定消息。

Command Hygiene

命令规范

  • Quote names starting with
    #
    in shell commands, for example:
    slack chat history "#general"
    .
  • Prefer IDs when names are ambiguous.
  • Keep commands bounded with
    --limit
    unless the user asks for more.
  • Use pretty output for human reading.
  • Use
    --format json
    or
    --format jsonl
    for structured parsing.
  • Use
    slack api call
    /
    slack api curl
    only when typed commands do not cover the needed endpoint behavior.
  • If auth fails, run
    slack auth status
    before retrying read commands.
  • 在shell命令中,对以
    #
    开头的名称添加引号,例如:
    slack chat history "#general"
    。
  • 当名称存在歧义时,优先使用ID。
  • 除非用户要求更多内容,否则使用
    --limit
    限制命令返回结果。
  • 为方便人类阅读,使用美观的输出格式。
  • 使用
    --format json
    或
    --format jsonl
    进行结构化解析。
  • 仅当现有命令无法满足所需端点行为时,才使用
    slack api call
    /
    slack api curl
    。
  • 如果认证失败,在重试读取命令前先运行
    slack auth status
    。

Response Guidance

响应指引

  • Summarize key findings instead of dumping raw command output.
  • Keep timestamps and IDs in results when they help the user drill down.
  • Treat attachment lines (
    📎 ...
    ) as message context.
  • 总结关键发现,而非直接输出原始命令结果。
  • 当时间戳和ID有助于用户深入查询时,保留在结果中。
  • 将附件行(
    📎 ...
    )视为消息上下文。