slack-cli
Original:🇺🇸 English
Translated
Use the Slack CLI to create, run, and manage Slack apps from the terminal. Use whenever the developer wants to log in, add a team, switch workspaces, or authenticate with Slack; whenever Slack CLI commands are needed (local development with `slack run`, managing app lifecycle, the manifest).
11installs
Added on
NPX Install
npx skill4agent add slackapi/slack-skills-plugin slack-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Slack CLI
Use the Slack CLI to create, run, and manage Slack apps — including calling Web API methods directly and searching Slack developer documentation from the terminal.
For initial setup (sandbox creation, project scaffolding from templates), use the skill instead.
slack:create-slack-appStep 1: Detect the Slack CLI
Resolve the path to the public Slack CLI before running any other command. We refer to the resolved value as — substitute it everywhere below. Try 1a → 1b → 1c in order; do not skip ahead.
SLACK_CMD1a. Standard install path (preferred — no verification needed)
The official install scripts place the binary at a fixed per-user path. If the file exists, use it directly: only the install script writes to that path.
- macOS / Linux:
~/.slack/bin/slack - Windows: (or
%USERPROFILE%\AppData\Local\slack-cli\bin\slack.exeas a fallback)%USERPROFILE%\.slack-cli\bin\slack.exe
POSIX shell:
bash
[ -x "$HOME/.slack/bin/slack" ] && echo "$HOME/.slack/bin/slack"PowerShell:
powershell
$p = "$env:USERPROFILE\AppData\Local\slack-cli\bin\slack.exe"
if (Test-Path $p) { $p } elseif (Test-Path "$env:USERPROFILE\.slack-cli\bin\slack.exe") { "$env:USERPROFILE\.slack-cli\bin\slack.exe" }If a path is returned, set to that absolute path and proceed to Step 2. Do not also run .
SLACK_CMD_fingerprint1b. slack
on PATH (verify with fingerprint)
slackIf 1a found nothing, try on PATH:
slackbash
slack _fingerprint 2>/dev/nullIf it outputs , set and proceed.
d41d8cd98f00b204e9800998ecf8427eSLACK_CMD=slack1c. Ask about an alias, or install
If 1b fails or returns a different value, ask the developer using AskUserQuestion:
-
"Thecommand on your system doesn't appear to be the public Slack CLI. Do you have it installed under a different name or alias?"
slack -
Options: "Yes, it's aliased as..." (let them provide the alias), "No, I need to install it"
-
If they provide an alias, verify it withand set
<alias> _fingerprint 2>/dev/null.SLACK_CMD=<alias> -
If they need to install it, run:text
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bashThen re-run 1a — the install script will have written.~/.slack/bin/slack
Common mistakes: Don't use to discover the binary — resolves any shell alias and defeats the point of 1a. In Git Bash on Windows, use the POSIX probe form, not PowerShell.
which slackwhichStep 2: Command Discovery via Help
Always run before constructing a command you have not used in the current session. Do not guess at flags — the help output is the source of truth.
SLACK_CMD <command> --help- — lists all available command groups
SLACK_CMD help - — shows subcommands, flags, and usage examples
SLACK_CMD <command> --help
Resolving --app
and --team
values
--app--teamWhen a command requires or :
--app--team- App ID: Run from the project directory to see installed apps and their IDs.
SLACK_CMD app list - Team ID: Run to see authenticated workspaces and their team IDs.
SLACK_CMD auth list
Step 3: Searching Documentation (slack docs search
)
slack docs searchSearch Slack's developer documentation directly from the terminal.
bash
SLACK_CMD docs search "<query>" --output=text --limit=5Use for concise terminal-readable results. Use this when you are already running CLI commands and want to:
--output=text- Check a Slack feature before implementing it
- Verify API behavior or required scopes
- Look up Block Kit elements, event types, or method parameters
Step 4: Calling Web API Methods (slack api
)
slack apiCall any Slack Web API method directly. Run for full details and examples.
SLACK_CMD api --helpParameters are passed as positional pairs (NOT flags):
key=value--key=valuebash
SLACK_CMD api chat.postMessage channel=C0123456789 text="Hello from the CLI"Important distinction: , , , and are meta-flags (prefixed with ). API method parameters use positional syntax without dashes.
--team--token--json--data--key=valueReference: Full method list at https://docs.slack.dev/reference/methods.md.
Step 5: Authentication (slack auth
)
slack authWhen to run this flow
Slack auth is per-team, not a single boolean. Run the seamless login flow below whenever any of these is true:
- The developer is not authenticated to any team yet.
- The developer wants to add a new team / workspace / sandbox, even if already shows other teams.
SLACK_CMD auth list - The developer asks to log in, switch teams, or re-authenticate.
SLACK_CMD auth listInspect existing auth (optional)
bash
SLACK_CMD auth listUse this to show the developer which teams are already authenticated, or to confirm a successful login. Do not treat a non-empty list as "auth complete" when the developer asked to log in to a new team.
Run the seamless login flow
The agent drives this end-to-end — no separate terminal window, no browser confirmation.
SLACK_CMD login --no-prompt/slackauthticket1. Start login and capture the ticket
bash
SLACK_CMD login --no-promptThe CLI prints a slash command and exits. Capture the ticket — you will need it in step 4. Sample output:
/slackauthticket <ticket>text
📋 Run the following slash command from any Slack channel in the workspace
you'd like to authenticate
/slackauthticket eyJ0eXAiOiJKV1QiLCJh…
? Slack will then show you a challenge code. Submit it via:
slack login --ticket <ticket> --challenge <code>2. Hand the slash command to the developer
Show the full line and ask the developer to paste it into the message box of the Slack workspace they want to authenticate, then send it. Slack responds with a modal containing a short challenge code (e.g. ).
/slackauthticket …JDt1IK7X3. Collect the challenge code
Use to ask the developer for the challenge code shown in the Slack modal. Wait for their answer — do not guess or default.
AskUserQuestion4. Complete login
bash
SLACK_CMD login --ticket <ticket> --challenge <code>On success the CLI returns the team name and ID. Verify with and report the team back to the developer.
SLACK_CMD auth listTroubleshooting: tickets are single-use and time-limited. If step 4 fails with an invalid/expired ticket or wrong challenge, restart from step 1 with a fresh — do not retry the same ticket.
SLACK_CMD login --no-promptUse on individual commands to target a specific workspace without switching globally.
--team <team_id>Red flags — STOP
If you catch yourself thinking any of these, you are about to regress to the old broken flow:
| Rationalization | Reality |
|---|---|
" | Auth is per-team. The developer asked for a new team — drive the flow. |
" | False with |
"I should tell the developer to run | Never. Step 5 is the agent's job from start to finish. |
All of these mean: run yourself and follow the four numbered steps above.
SLACK_CMD login --no-promptStep 6: Running an App Locally (slack run
)
slack runRun for all available flags.
SLACK_CMD run --helpResolve the app or team target
Run from the project directory to check for installed apps:
SLACK_CMD app list- If an app exists: Use in the run command.
--app=<app_id> - If no apps are listed: Use instead (get the team ID from
--team=<team_id>).SLACK_CMD auth list
Start the dev server in the background
Run this command as a background process so the developer can continue working:
If an app ID was found:
bash
cd <project-dir> && SLACK_CMD run --org-workspace-grant=all --app=<app_id>If no apps — use the team ID:
bash
cd <project-dir> && SLACK_CMD run --org-workspace-grant=all --team=<team_id>Tell the developer the app is running in the background. They can ask:
- "What's the status of the dev server?" — to check on it
- "Show me the output from slack run" — to see activity logs
- "Stop the dev server" — to terminate the process
Step 7: Managing the Manifest
Run for subcommands (, ) and the flag.
SLACK_CMD manifest --helpvalidateinfo--source local|remoteUse before deploying or when something seems wrong with the app configuration.
SLACK_CMD manifest validateStep 8: Other Commands
For any other command group (e.g., , , , , , ), run to discover subcommands and flags. Run to see all available command groups.
triggerdatastoreenvcollaboratorexternal-authdeploySLACK_CMD <command> --helpSLACK_CMD helpNotes
- is a placeholder — always substitute the actual command name resolved in Step 1.
SLACK_CMD - Always run before constructing a command you have not used in the current session.
--help - Interactive commands (e.g., without
slack trigger create) cannot be run in the background. Tell the developer to run these in a new terminal window.--trigger-defis not in this category — drive it inline using theslack login/--no-prompt/--ticketflow in Step 5.--challenge - runs locally for development.
slack rundeploys to Slack's hosted infrastructure. These are different operations — do not confuse them.slack deploy