一键导入
slack-cli
Perform Slack operations using the Slack CLI for app management and the Slack Web API (curl) for messaging, channel, and user operations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Perform Slack operations using the Slack CLI for app management and the Slack Web API (curl) for messaging, channel, and user operations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use the correct AWS CLI profile when running AWS commands based on the target environment.
Analyze code changes between two local Git branches and perform a comprehensive code review. Use ONLY for local git branch comparisons. Do NOT use when a GitLab or GitHub MR/PR URL or MR ID is provided — use gitlab-cli or github-cli skill instead.
Analyze code changes to prepare conventional commit message and commit to a new branch.
Create optimized, secure, production-ready Dockerfiles based on user requirements and application context.
Create a new SKILL.md file based on a guided conversation about a task or workflow.
Create a detailed upgrade plan for a Helm release managed by Terraform, comparing the current and desired chart versions including breaking changes and required code changes.
| name | slack-cli |
| description | Perform Slack operations using the Slack CLI for app management and the Slack Web API (curl) for messaging, channel, and user operations. |
This skill uses two tools depending on the operation:
| Use case | Tool |
|---|---|
| App management (install, deploy, auth) | slack CLI |
| Messaging, channels, users, search | Slack Web API via curl |
Update the Slack workspace name below before using this skill:
| Setting | Value |
|---|---|
| Slack Workspace | <your-workspace>.slack.com |
| Slack Team Name (for CLI) | <your-team-name> |
If not already authenticated, ask the user to complete these steps manually. Do not perform these steps yourself.
brew install slack-cli # install if needed
slack login # authenticate
slack auth list # confirm your workspace is listed
Always pass --team <your-team-name> on every command.
| Command | Description |
|---|---|
slack auth list | List authenticated workspaces |
slack auth whoami | Show current authenticated user |
slack app list --team <your-team-name> | List apps in the workspace |
slack app install --team <your-team-name> | Install app to workspace |
slack app uninstall --team <your-team-name> | Uninstall app (requires explicit user approval) |
slack deploy --team <your-team-name> | Deploy app to Slack Platform |
slack trigger list --team <your-team-name> | List triggers for an app |
curl (messaging, channels, users)To get started, create a Slack app at api.slack.com/apps. On the OAuth & Permissions page, add the required scopes, then install the app to your workspace. After installation, your user token (starting with xoxp-) will appear on the same page. Save it to ~/.slack/token. Never print or display the token value. Do not perform these steps yourself.
Required token scopes: channels:read, channels:history, groups:read, groups:history, users:read
echo "xoxp-..." > ~/.slack/token && chmod 600 ~/.slack/token
https://slack.com/api/<method>
curl -s -H "Authorization: Bearer $(cat ~/.slack/token)" \
"https://slack.com/api/conversations.list?limit=200&exclude_archived=true&types=public_channel,private_channel" \
| jq '.channels[] | {id, name}'
general with channel name)curl -s -H "Authorization: Bearer $(cat ~/.slack/token)" \
"https://slack.com/api/conversations.list?limit=200&exclude_archived=true&types=public_channel,private_channel" \
| jq -r '.channels[] | select(.name == "general") | .id'
curl -s -H "Authorization: Bearer $(cat ~/.slack/token)" \
"https://slack.com/api/conversations.history?channel=<CHANNEL_ID>&limit=10" \
| jq '.messages[] | {ts, user, text}'
search:read scope)curl -s -H "Authorization: Bearer $(cat ~/.slack/token)" \
"https://slack.com/api/search.messages?query=<search+term>&count=10" \
| jq '.messages.matches[] | {channel: .channel.name, user: .username, text, ts}'
curl -s -X POST -H "Authorization: Bearer $(cat ~/.slack/token)" \
-H "Content-Type: application/json" \
--data '{"channel": "<CHANNEL_ID>", "text": "<MESSAGE>"}' \
"https://slack.com/api/chat.postMessage" \
| jq '{ok, ts, error}'
curl -s -H "Authorization: Bearer $(cat ~/.slack/token)" \
"https://slack.com/api/users.list" \
| jq '.members[] | select(.deleted == false) | {id, name, real_name: .profile.real_name}'
curl -s -H "Authorization: Bearer $(cat ~/.slack/token)" \
"https://slack.com/api/users.list" \
| jq -r '.members[] | select(.name == "<username>") | .id'
Every Slack API response includes an ok field. Always check it:
| jq 'if .ok then . else error(.error) end'
~/.slack/token or any credential value.~/.slack/token does not exist, inform the user and stop. Do not attempt to find or guess the token.