# slick > A headless Slack CLI for agents, scripts, and CI jobs. Use `slick agent schema --output=json` to discover the installed binary's command contract. The schema artifact is at `data.schema`. The embedded runbooks are the workflow authority: start with `slick agent guide --output=human`, then select a guide, or use `slick agent guide --all --output=human` for every runbook. Discovery and guides require no Slack credentials. This website export contains the public reference pages; it does not replace the installed binary's runbooks. For automation, use `--output=json`: both successes and failures are `{ok,meta,data,errors}` records on stdout. Inspect `ok` and the process exit code; stderr contains diagnostics. Compact successes contain only `data`, while compact failures retain the full envelope. Preserve Slack timestamps as strings. Preview supported mutations with `--dry-run`. Exit 8 means writing the result failed and the mutation may already have completed: inspect Slack state before retrying. Never put tokens in command arguments or documentation. # Getting started # Overview `slick` is a headless Slack CLI for agents, scripts, and CI jobs — anywhere you need to talk to the Slack API without a human at the keyboard. **Send** messages and DMs, **reply** in threads, **react** to messages, **read** channel and thread history, **search** the workspace, **set** your Slack status, **upload** files, and **check** Slack service health — all from a single binary that runs each of these non-interactively. Drive it with flags, stdin, or environment variables, and the output adapts to where it runs: friendly colored text in a terminal, structured JSON when piped or under an agent. You can also [pause notifications](), [pin messages](), and [manage channel bookmarks](). The binary is `slick`; the repo and Go module are `slack-cli`. For agents, the documentation is available as an [llms.txt index]() and a [single full-text file](). Use **Copy as Markdown** at the top of any page to copy its rendered content. Running `slick` without a subcommand lists its commands without resolving credentials. Printing shell completion scripts also needs no token. ## Install ``` brew install matcra587/tap/slick ``` Also available via `go install` and pre-built binaries. See [Installation]() for go install, GitHub Releases, source builds, and upgrade paths. The examples below assume `slick` is on `PATH`. Run `slick --help` for the current flags and short forms. ## First-time setup > [!NOTE] > > **Prerequisite — an installed Slack app** > > slick uses a user or bot token from a Slack app installed in your workspace. Choose scopes for the commands you plan to run. Common scopes include: > > | Scope | Enables | > | --- | --- | > | `chat:write` | Send messages | > | `channels:read` | Resolve public channels | > | `users:read` | User lookup | > > Create the app at [api.slack.com/apps](). See [manifest]() for an optional `slick manifest template` shortcut that emits a ready-to-import manifest — and for broader scope sets (history, DMs, reactions, file uploads, search, status updates). User tokens support actions such as search and personal status updates. Bot tokens support the bot’s permitted conversations and actions. The [manifest presets]() list scopes for each token type. `auth.test` does not need a separate OAuth scope. With the app installed: ``` slick auth login slick auth status ``` `auth login` opens a browser for OAuth (a token via stdin / env / file is also supported); `auth status` confirms the workspace is wired up. See [auth]() for the full flow. ## Output modes slick has a single output flag, `--output` (short `-o`), with four values: - `auto` — the default. TTY without an agent renders human-readable clog output; everything else renders the JSON envelope. - `human` — human-readable clog output. - `json` — full envelope with `ok`, `meta`, `data`, and `errors[]`. - `compact` — JSON `data` on success; the full envelope on failure. Under `auto`, JSON is selected when stdout is not a TTY or when slick detects an agent environment (e.g. `CLAUDE_CODE`, `CURSOR_TERMINAL`, `CODEX`, `GITHUB_ACTIONS`, `CI`). ``` flowchart LR Input(["--output=auto"]) --> TTY{"stdout a TTY?"} TTY -- No --> JSON(["JSON envelope"]) TTY -- Yes --> Agent{"agent or CI
detected?"} Agent -- Yes --> JSON Agent -- No --> Human(["human clog output"]) classDef decision stroke:#d97706,stroke-width:2px classDef jsonOut stroke:#2563eb,stroke-width:2px classDef humanOut stroke:#16a34a,stroke-width:2px class TTY,Agent decision class JSON jsonOut class Human humanOut ``` Use command-local `--blocks` when the message body is already a Slack Block Kit JSON array. `--timeout` (`-I`) defaults to `30s`. Positive values add a command deadline. Zero and negative values add no deadline; they preserve any existing caller deadline and cancellation. Command-specific limits still apply. `--debug` (or `-D`) adds diagnostics on stderr. SDK diagnostics keep safe HTTP status and event summaries. They omit request payloads, response headers and bodies, and unknown diagnostic text, which can contain credentials, message content, or signed URLs. Machine results keep the same stdout format. ### Terminal status In human terminal sessions, slick uses OSC 7501 to report long operations. Terminals that support this protocol can show activity, completion, and errors. Reports use stderr. JSON, compact, redirected output, and dry runs omit them. - File uploads report preparation, data transfer, and completion phases. - Cache fetches report pages and cache publication. Warm cache reads omit status. - Paginated API calls report the current page without a percentage. - Multi-emoji reaction commands report progress from completed items. - OAuth sign-in and reaction watches report their current activity. Completion appears after the command writes its result. Cancellation returns the status to idle. A wait for Slack or a rate limit remains working. Only a wait for user action uses blocked status. Status text omits credentials, message content, filenames, and workspace details. ## Exit codes | Code | Meaning | | --- | --- | | 0 | Success | | 1 | `auth_failure` (`invalid_auth`, `missing_scope`, `no_permission`, expired) | | 2 | `not_found` (`channel_not_found`, `user_not_found`, `not_in_channel`, …) | | 3 | `rate_limit` (`retry_after_seconds` is included when Slack supplies timing) | | 4 | `validation_error` (bad flags, malformed input, Slack rejects the value) | | 5 | `server_error` (unexpected HTTP response or filesystem/runtime failure) | | 6 | `canceled` (command or credential lookup canceled) | | 7 | `timeout` (command or credential lookup deadline exceeded) | | 8 | `io` (`output_write_failed`; a mutation may already have completed) | JSON and compact failures write a full `{ok, meta, data, errors}` envelope to stdout, with `ok=false`, `data=null`, and the original error class and exit code. Human errors use stderr and include `retry_after_seconds` when known, including zero. A machine failure has no duplicate human error. Help and shell completion scripts keep their text format in every output mode. If writing that text fails, slick returns exit 8, reports `output_write_failed` on stderr, and stops writing. Discard any partial text. Credential lookup failures use exit 1 with a safe diagnostic. Provider output is not included because it may contain secrets. Cancellation and deadlines keep exit 6 and 7, including during credential lookup. An empty credential stops the command before any Slack request. Compact success still emits the command data directly. Paginated command data includes `pagination`; JSON also keeps `meta.pagination` for compatibility. List pagination includes `items_returned`, including `0` for an empty page. Human list output keeps the rows and adds a footer with `has_more`, the count, and any next cursor or time boundary. A final page shows `has_more=false`. Recognized Slack JSON errors distinguish recovery: `token_expired` and `access_denied` use exit 1; `file_not_found`, `thread_not_found`, and `invalid_scheduled_message_id` use exit 2. `rate_limited` and `ratelimited` use exit 3. Bad timestamps, stale cursors, invalid rich content, and the reaction limits listed in the command docs use exit 4. Internal failures and unrecognized Slack error codes keep exit 5. These classes do not trigger automatic mutation retries. HTTP `429` uses exit 3 even when `Retry-After` is missing or unusable. A usable nonnegative integer delay allows at most two automatic retries. Missing, invalid, duplicate, or excessively long timing returns the rate-limit error immediately. Known timing is included as `retry_after_seconds`, including zero; unknown timing is omitted. A valid integer delay that exceeds the supported wait duration is reported without scheduling a retry. `--no-throttle` disables proactive pacing; bounded retries for usable rate-limit timing remain enabled. Cancellation or a deadline during a retry wait uses exit 6 or 7. Other unexpected HTTP responses, including `401` and `403`, use exit 5. Slack JSON errors such as `invalid_auth` and `missing_scope` use exit 1. Slack request failures use safe diagnostic summaries. HTTP failures retain the numeric status, but omit the server's reason phrase and request URL. Malformed error codes and unrecognized scope names are omitted. Missing-scope errors prefer Slack's structured `needed` field and fall back to metadata messages when the SDK preserves them. Some SDK response types discard those messages, so a missing-scope failure may have no `needed` detail. When present, `errors[].details.needed` is always an array of scope names. `needed_match` explains the list: `all` requires every named scope; `any` requires at least one. `reported` means Slack supplied the names and slick does not infer an all-or-any rule from them. Unrecognized scope names are omitted from diagnostics. A result-write failure exits 8 in human, JSON, and compact modes. A mutation may already have completed: inspect Slack before retrying it. Slick does not retry the failed result destination. Output diagnostics omit the underlying writer error text, which can contain private data. If a human error cannot be written to stderr, slick also exits 8 and leaves stdout empty. Bare `slick` returns command discovery in machine modes; explicit `--help` remains help text. Flag and argument parsing failures identify the selected command in `meta.command`, using its canonical name even when invoked through an alias. Early failures retain the requested workspace, using its configured spelling when known, or the configured default when no profile was selected. Formatting these errors does not read credentials or call Slack. ## Output styling slick uses [`gechr/clog`]() for human-mode output and [`gechr/primer/table`]() for tables. | Field kind | Rendering | | --- | --- | | **Identity** — `channel`, `user`, `team_id`, `workspace`, `file_id`, … | Hash-coloured from the entity palette; the same ID always renders the same colour. | | **Human labels** — channel name, user name, file name | Plain terminal text — no colour, no hyperlink, no weight. | | **Slack entity / permalink** | OSC 8 terminal hyperlinks when slick has enough workspace metadata. `channel_url` uses `slack://` on macOS, `https://app.slack.com/client//` elsewhere; absent without a team ID. Parse JSON for raw IDs. | | **Time** — `ts`, `fetched_at`, `expiration` | clog's `FieldTime` magenta. | | **Bool** | Coloured by polarity — see below. | Bool polarity: | Tier | Examples | True | False | | --- | --- | :---: | :---: | | Alarming-on-true | `is_archived`, `deleted`, `truncated` | red | dim | | Both states matter | `authenticated`, `exists` | green | red | | Routine-on-true | `is_member` | dim | default | `dry_run` and [`cache clear`]()'s `cleared` are retained where they're the only signal of what happened; otherwise the action label plus `errors[]` carries success/failure. Field order follows a canonical taxonomy: *where → what → when → state → detail → numbers → diagnostics → pagination*. An AST-walking test enforces it on every CI run — see [`internal/cli/output/field_order_test.go`](). ## Attribution In an agent or CI environment, the four mutating commands (`message send`, `message edit`, `reply`, `file upload`) attach a Block Kit context block marking the message as automated. Override per call with `--attribution-label`, `--attribution-emoji`, `--attribution-message`, or gate the block itself with `--attribution` / `--no-attribution` — both flags trump config defaults *and* env detection, so a single command can attribute on a workspace where it's off (or suppress where it's on). > [!NOTE] > > **Detection triggers** > > The authoritative list lives in [`internal/agent/detect.go`](). > > - **AI assistants** — Claude Code, Cursor, Codex, Aider, Cline, Windsurf, GitHub Copilot, Codeium, Amazon Q, Gemini Code Assist, Cody. > - **CI** — GitHub Actions, Buildkite, Jenkins, GitLab CI, CircleCI, Travis CI, Bitbucket Pipelines, TeamCity, Azure Pipelines, plus the generic `CI` variable. > - **Cron / automation** — `CRON`, `CRON_JOB`, `SLACK_CLI_AGENT`. The attribution context block reflects the detection state in the rendered Slack message: - 🤖 *Sent via slick (agent mode)* — slick auto-detected an agent or CI environment. - 🤖 *Sent via slick* — slick is running interactively (no agent triggers) but `attribution.enabled = true` is set in config, or `--attribution` is passed on the command line. Override either piece with `--attribution-message` (text body) or `--attribution-emoji` (leading emoji). Config can pin attribution defaults per workspace: ``` slick config set workspaces.default.attribution.enabled true slick config set workspaces.default.attribution.emoji :robot_face: slick config set workspaces.default.attribution.message "Sent via build agent" ``` ## Configuration paths - Config: `${SLICK_CONFIG:-${XDG_CONFIG_HOME:-~/.config}/slick/config.toml}`. `SLACK_CLI_CONFIG` remains as a legacy override. - Cache: `${XDG_CACHE_HOME:-~/.cache}/slick//` for ordinary names. [Special or long profile names]() use stable folder identifiers. - Path inputs (`SLICK_CONFIG`, `--token-file`, `--file`, …) expand `~` and environment variables. Tokens never appear in argv, TOML, stdout, stderr, or any of these docs. Auth-owned fields store keychain or secret-manager references; config commands do not edit them. ## Further reading - Per-command pages above for flags, examples, and JSON shapes. - [`slick agent guide`]() for machine-readable runbooks designed for agent consumption. - [`slick agent schema`]() for the full command tree and exit-code contract in JSON. - [Repo source]() # Installation `slick` ships as a single static Go binary. Pick the tab for your platform in [Quick start](<#quick-start>), or jump straight to a method: - [One-line install](<#one-line-install>) — `curl | sh` on Linux & Apple Silicon macOS. - [Homebrew](<#homebrew>) — recommended on macOS (Apple Silicon) and Linux. - [Pre-built binaries](<#pre-built-binaries>) — checksummed, signed tarballs. - [`go install`](<#go-install>) — any Go platform supported by slick's dependencies. - [From source](<#from-source>) — build with the pinned toolchain. ## Platform support Pre-built archives and the Homebrew formula cover Linux (amd64/arm64) and Apple Silicon macOS. Intel macOS installs through `go install` or a source build. macOS requires version 13 (Ventura) or later, matching the [Go 1.27 minimum](). | Platform | Homebrew | Pre-built tarball | `go install` | From source | | --- | :---: | :---: | :---: | :---: | | Linux · amd64 | ✓ | ✓ | ✓ | ✓ | | Linux · arm64 | ✓ | ✓ | ✓ | ✓ | | macOS · Apple Silicon (arm64) | ✓ | ✓ | ✓ | ✓ | | macOS · Intel (amd64) | — | — | ✓ | ✓ | | Windows · amd64/arm64 | — | — | See note | Build verified | > [!NOTE] > > **Windows source builds** > > The current source cross-compiles for Windows on amd64 and arm64. The pinned `gechr/clog` dependency has a non-Unix terminal-resize fallback, so the former `syscall.SIGWINCH` compilation blocker no longer applies. > > Native Windows runtime behavior has not yet been verified. The release pipeline does not publish Windows archives, and the POSIX installer and Homebrew instructions below target Linux and macOS. > > Source-build verification applies to this checkout. Tagged releases may use older dependencies: `go install …@latest` selects a published release, not unreleased changes. Build an updated source checkout for these fixes. WSL remains an alternative for using the published Linux binaries. > [!NOTE] > > **No Intel-macOS binary** > > The release pipeline builds `linux/amd64`, `linux/arm64`, and `darwin/arm64` only. On Intel macOS, use [`go install`](<#go-install>) (which produces a working binary from source) or [build from source](<#from-source>). `brew install --HEAD` also compiles from source on any Homebrew platform. ## Quick start **Recommended** — Homebrew on amd64/arm64. You get `brew upgrade slick` for managed updates: ``` brew install matcra587/tap/slick ``` No Homebrew? The one-line installer drops the binary into `$HOME/.local/bin`. Re-run it to upgrade in place: ``` curl -fsSL https://matcra587.github.io/slack-cli/install.sh | sh ``` **Recommended** — Homebrew on Apple Silicon. You get `brew upgrade slick` for managed updates: ``` brew install matcra587/tap/slick ``` No Homebrew? The one-line installer drops the binary into `$HOME/.local/bin`. Re-run it to upgrade in place: ``` curl -fsSL https://matcra587.github.io/slack-cli/install.sh | sh ``` > [!NOTE] > > **Intel macs** > > No `darwin/amd64` bottle or tarball is published. Use [`go install`](<#go-install>), a [source build](<#from-source>), or `brew install --HEAD matcra587/tap/slick`. Build an updated source checkout with the toolchain selected by `go.mod`: ``` go build -o slick.exe ./cmd/slick .\slick.exe version ``` Cross-compilation has been verified for Windows amd64 and arm64; native Windows runtime testing is still outstanding. No Windows release archive is published, and `go install …@latest` still selects the older tagged release. See [Platform support](<#platform-support>) for details. To use the published Linux binaries on Windows, install [WSL]() and follow the Linux instructions. ## Homebrew Recommended on macOS (Apple Silicon) and Linux (amd64/arm64). ``` brew install matcra587/tap/slick ``` The formula lives in [`matcra587/homebrew-tap`]() and tracks the latest GitHub release. Upgrades come through `brew upgrade slick`. > [!TIP] > > **Source build via Homebrew** > > `brew install --HEAD matcra587/tap/slick` compiles the latest `main` with the Go toolchain and embeds version metadata. This is the one Homebrew path that works on Intel macOS. ## go install ``` go install github.com/matcra587/slack-cli/cmd/slick@latest ``` Installs the latest tagged release into `$(go env GOBIN)` (or `$(go env GOPATH)/bin`). > [!WARNING] > > **No version metadata** > > This path does **not** embed version metadata — `slick version` will report `dev` / `unknown` because the version package reads compile-time `-X` ldflag overrides and `go install` doesn't supply them. If you need accurate `slick version` output, use Homebrew or the pre-built binaries instead, or build from a checkout via `mise run install` (which does set the ldflags). ## One-line install For Linux (amd64/arm64) and Apple Silicon macOS, a POSIX-sh installer hosted on this site does the download, verify, and install in one step: ``` curl -fsSL https://matcra587.github.io/slack-cli/install.sh | sh ``` It auto-detects OS and architecture, resolves the latest release, verifies the SHA-256 against the published `checksums.txt`, optionally verifies the cosign signature when `cosign` is on `PATH`, and installs the binary to `$HOME/.local/bin`. The script prints a PATH-fix hint if that directory isn't already on your shell's `PATH`. > [!TIP] > > **Prefer Homebrew for managed upgrades** > > The one-line installer has no upgrade command of its own — re-run it to pick up the latest release. If you want `brew upgrade slick` style managed updates, install with [Homebrew](<#homebrew>) instead. > [!NOTE] > > **Environment overrides** > > | Variable | Effect | > | --- | --- | > | `SLICK_VERSION` | Pin a specific release tag (e.g. `v0.5.9`). Default: latest. | > | `SLICK_INSTALL_DIR` | Install directory. Default: `$HOME/.local/bin`. Use `/usr/local/bin` with `curl … \\| sudo sh` for a system-wide install. | > | `SLICK_NO_VERIFY` | Set to `1` to skip cosign verification when cosign is unavailable. SHA-256 still runs. | > > Examples: > > ``` > # Pin a version > curl -fsSL https://matcra587.github.io/slack-cli/install.sh | SLICK_VERSION=v0.5.9 sh > > # System-wide install > curl -fsSL https://matcra587.github.io/slack-cli/install.sh | SLICK_INSTALL_DIR=/usr/local/bin sudo -E sh > ``` > [!WARNING] > > **What `curl | sh` actually runs** > > The installer's source lives at [`docs/install.sh`]() — about 130 lines of POSIX sh. Inspect it before piping into `sh` if you don't already trust the source: > > ``` > curl -fsSL https://matcra587.github.io/slack-cli/install.sh | less > ``` ## Pre-built binaries GitHub Releases ship checksummed tarballs for Linux on amd64/arm64 and macOS on arm64 (Apple Silicon). The [one-line installer](<#one-line-install>) wraps the download/verify/install dance, but if you'd rather do it by hand — for a scripted pipeline, a stricter audit trail, or because you don't want to pipe `curl` into `sh` — the manual recipe is below. > [!NOTE] > > **Manual download + SHA-256 verify** > > ``` > VERSION=$(curl -fsSLI -o /dev/null -w '%{url_effective}' \ > https://github.com/matcra587/slack-cli/releases/latest | sed 's#.*/tag/##') > OS=$(uname -s | tr '[:upper:]' '[:lower:]') > ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') > > curl -fsSLO "https://github.com/matcra587/slack-cli/releases/download/${VERSION}/slick_${VERSION#v}_${OS}_${ARCH}.tar.gz" > curl -fsSLO "https://github.com/matcra587/slack-cli/releases/download/${VERSION}/checksums.txt" > grep "_${OS}_${ARCH}.tar.gz$" checksums.txt | sha256sum -c > > tar xzf "slick_${VERSION#v}_${OS}_${ARCH}.tar.gz" > sudo install slick /usr/local/bin/ > ``` > > ``` > set VERSION (curl -fsSLI -o /dev/null -w '%{url_effective}' \ > https://github.com/matcra587/slack-cli/releases/latest | string replace -r '.*/tag/' '') > set OS (uname -s | string lower) > set ARCH (uname -m | string replace x86_64 amd64 | string replace aarch64 arm64) > set NUM (string replace -r '^v' '' $VERSION) > set TARBALL (printf 'slick_%s_%s_%s.tar.gz' $NUM $OS $ARCH) > > curl -fsSLO "https://github.com/matcra587/slack-cli/releases/download/$VERSION/$TARBALL" > curl -fsSLO "https://github.com/matcra587/slack-cli/releases/download/$VERSION/checksums.txt" > grep (printf '_%s_%s.tar.gz$' $OS $ARCH) checksums.txt | sha256sum -c > > tar xzf $TARBALL > sudo install slick /usr/local/bin/ > ``` > [!NOTE] > > **Cosign signature verification** > > `checksums.txt` is signed with [cosign]() keyless signing — a `checksums.txt.sigstore.json` bundle ships next to the release artifacts. The [one-line installer](<#one-line-install>) verifies it automatically when `cosign` is on `PATH`. To verify by hand: > > ``` > curl -fsSLO "https://github.com/matcra587/slack-cli/releases/download/${VERSION}/checksums.txt.sigstore.json" > cosign verify-blob \ > --bundle checksums.txt.sigstore.json \ > --certificate-identity-regexp "https://github.com/matcra587/slack-cli/" \ > --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \ > checksums.txt > ``` > > ``` > curl -fsSLO "https://github.com/matcra587/slack-cli/releases/download/$VERSION/checksums.txt.sigstore.json" > cosign verify-blob \ > --bundle checksums.txt.sigstore.json \ > --certificate-identity-regexp "https://github.com/matcra587/slack-cli/" \ > --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \ > checksums.txt > ``` > > The archives themselves are not individually signed; the checksum bundle covers them transitively. ## From source ``` git clone https://github.com/matcra587/slack-cli cd slack-cli mise install # provision pinned toolchain mise run install # go install ./cmd/slick with version metadata slick version ``` `mise run build` writes a release-style binary to `./dist/slick--` if you need to test the artifact shape used in release. ## Verifying the install ``` slick version ``` Should print the installed version, commit, branch, build time, and `built by` (one of `goreleaser`, `homebrew`, or the local user for a dev build). ## Upgrading | Install path | Upgrade | | --- | --- | | Homebrew | `brew upgrade slick` | | go install | `go install github.com/matcra587/slack-cli/cmd/slick@latest` | | Pre-built | Re-download from [releases]() | | From source | `git pull && mise run install` | > [!NOTE] > > **No self-updater** > > slick does not currently ship a `slick update` self-updater; upgrade through whichever install path you chose. ## See also - [README]() — quick start. - [`version`]() — what the installed binary reports. - [`auth`]() — once installed, authenticate a workspace. # slick auth **Manage** Slack authentication. Login validates a token with the Slack API and stores a structured credential in the local keychain. Config holds its credential reference. Raw Slack tokens with known prefixes, including rotating, refresh, app, and workflow tokens, are rejected when loading or saving config. Validation errors do not repeat the token value. A rejected credential value leaves the prior config intact; repair an existing plaintext value by replacing it with a credential reference. If result output fails after a local auth change is saved, slick exits 8. The change remains applied. Check the saved profile or auth status before retrying; slick does not repeat the operation or roll back saved credentials because output failed. ## auth login Token imports accept bot and user access tokens, including rotating `xoxe.` forms. An imported access token has no refresh token and expires on Slack’s schedule. Use browser OAuth to retain refresh support. Create or replace a workspace profile. Login saves only reviewed auth fields and a credential reference in config. It reads the previous keychain value before writing, including with `--force`. If that read fails, nothing is overwritten. Failed credential writes, or config saves that fail before replacing the file, trigger a restore of the previous credential or removal of a new entry. If restoration also fails, the error includes `details.credential_restore_failed: true`; check the keychain entry before retrying. The previous config remains intact when replacement did not occur. If the file was replaced but its directory could not be synced, login keeps the new credential paired with the new profile and returns exit 5. Machine errors include `config_published: true` and `durability_confirmed: false` in `errors[].details`. The file is in place, but its survival across a crash is unconfirmed. Inspect the saved profile before retrying. Replacing an env, 1Password, or differently named keychain reference requires `--force`. Login does not resolve or delete that old source. The forced login saves the new credential in the profile's managed keychain entry and updates the reference. If the profile already uses its managed entry and that entry is missing, login can restore authentication without `--force`. An existing malformed config must be repaired before logging in. Login does not replace it with a new config. The local profile name can come from either flag: the hidden `--workspace-name ` (preferred) or the global `--workspace ` selector — if `--workspace-name` is empty, slick reuses the value of `--workspace`. On a TTY, omitting both drops into an interactive form that prompts for the missing fields. Use exactly one token source with `--method token`. OAuth client, redirect, and callback-port flags require `--method oauth`; token source flags cannot be used with OAuth. Choose either `--oauth-redirect-url` or `--oauth-callback-port`, not both. Invalid combinations fail before reading tokens or starting a browser. Callback ports range from 0 through 65535; 0 asks the OS to choose a port. Redirect URLs must use local HTTP, include a port, and have no user credentials or fragment. The callback accepts GET requests with the state from the current login. Requests with missing, mismatched, or duplicate state values are rejected without ending the login. Missing or ambiguous code/error fields are also rejected, so a later valid callback can still complete the flow. A valid authorization denial ends the login without exchanging a code or saving credentials. Callback pages and terminal errors do not repeat the remote error text. `--dry-run` or `-n` checks the option shape and previews the canonical profile name. It does not read token sources or the keychain, open a listener or browser, call Slack, or change files. The result includes `dry_run: true` and `authenticated: false`; a preview does not validate credentials or promise that a real login will succeed. Provide the profile name for a preview, including on a TTY. For token mode, slick calls Slack's `auth.test` after validating the token and fills in `team_id` / `team_name` from the response. Pass `--team-id` / `--team-name` only if you need to override what Slack returns (rare). TTY only; prompts for workspace name, method, and whatever else is missing: ``` slick auth login ``` Fully scripted. `--workspace-name` and `--oauth-client-id` are required, and `--oauth-callback-port` must match the redirect URL in your manifest: ``` slick auth login --workspace-name default --method oauth \ --oauth-client-id 1234567890.0987654321 \ --oauth-callback-port 53221 ``` The token never appears in argv, and slick derives the workspace identity from `auth.test`: ``` printf '%s\n' "$SLACK_TOKEN" | slick auth login \ --workspace-name default --method token --token-stdin ``` Read the token from a file; path expansion is supported: ``` slick auth login --workspace-name default --method token \ --token-file ~/.slack-token ``` Pass the name of an environment variable, not its value: ``` slick auth login --workspace-name default --method token \ --token-env SLACK_TOKEN ``` ### Output Human (success — same shape for OAuth and token-mode logins; both end with a single `Login complete` event on stdout): ``` Login complete workspace=default team_id=T123ABC456 team_name="Example Inc" token_type=user authenticated=true ``` Human (token env var unset or empty — validation error): ``` ERR token environment variable is unset or empty type=validation_error exit_code=4 ``` JSON envelope on a successful login (`auth.login`): ``` { "ok": true, "meta": {"exit_code": 0, "command": "auth.login", "workspace": "default", "timestamp": "2026-05-26T03:00:56Z", "request_id": "337f5bd1-a5f2-4bb8-8da5-510cb801f62d"}, "data": { "workspace": "default", "authenticated": true, "token_type": "user", "team_id": "T123ABC456", "team_name": "Example Inc" }, "errors": [] } ``` Token validation uses the shared Slack error codes: invalid credentials or permissions exit 1; rate limits exit 3; malformed responses, server failures, and transport failures exit 5; cancellation exits 6 and request timeouts exit 7. These failures leave the previous config and saved credential intact. Debug output uses safe SDK summaries and does not include request or response payloads. ### Flags > [!NOTE] > > **Flags** > > | Flag | Value | Description | > | --- | --- | --- | > | `--workspace-name` | `` | Local profile name. Hidden in --help. Falls back to the global --workspace value when omitted. | > | `-s`, `--token-stdin` | | Read Slack token from stdin | > | `-f`, `--token-file` | `` | Read Slack token from file | > | `-e`, `--token-env` | `` | Read Slack token from named environment variable | > | `-T`, `--team-id` | `` | Slack workspace ID (overrides auth.test) | > | `-N`, `--team-name` | `` | Slack workspace display name (overrides auth.test) | > | `-m`, `--method` | `` | Auth mechanism: oauth or token (default: token) | > | `-C`, `--oauth-client-id` | `` | Slack OAuth client ID | > | `-r`, `--oauth-redirect-url` | `` | Slack OAuth redirect URL configured on the app | > | `-p`, `--oauth-callback-port` | `` | Local OAuth callback port; 0 for OS-assigned | > | `-P`, `--scope-preset` | `` | OAuth user scopes: readonly, messaging (default), files, search, organize, or full | > | `-F`, `--force` | | Overwrite an existing authenticated profile | OAuth requests the selected scope preset. Configure matching user scopes in the Slack app before consent. `organize` covers DND, pins and channel bookmarks; `full` includes these plus messaging, files, search and profile status. The default remains `messaging`. `--scope-preset` requires `--method oauth` and does not change an existing token until a new login completes. The profile-name resolution order is: `--workspace-name` flag, then the global `--workspace` flag value, then the TTY interactive form. After those, slick errors with `workspace-name is required` if it still doesn't have one. For token mode, slick calls `auth.test` after the token validates and fills `team_id` / `team_name` from the response. Pass `--team-id` / `--team-name` only when you need to override what Slack returns. ### OAuth flow In human terminal sessions, supporting terminals show sign-in progress and the wait for Slack approval in their status area. Status reports use stderr; JSON, compact, and redirected output omit them. Cancellation returns the status to idle, and completion is reported after credentials and config are saved. OAuth exchange and saved-token refresh reject redirects by default. Replies need an explicit, consistent acknowledgement, a nonempty token without whitespace, and valid whole-second expiry values. Negative, null or unrepresentable expiry values are rejected. Responses are limited to 8 MiB. Rejected refresh replies leave the saved credential intact. 1. slick opens the Slack authorize URL in the default browser and listens on the configured local port. 2. The Slack consent screen redirects back to `http://localhost:/callback`. 3. slick exchanges the code for a token, stores it in the keychain, and writes a `token_ref` to the config TOML. ``` sequenceDiagram actor User participant S as slick participant B as Browser participant Slack participant K as Keychain User->>S: slick auth login --method oauth S->>B: Open Slack authorize URL Note right of S: Listening on
localhost callback port User->>B: Approve consent B->>Slack: Authorize Slack-->>S: Redirect to /callback
with code S->>Slack: Exchange code for token Slack-->>S: Access token S->>K: Store credential Note right of S: Write token_ref
to config TOML S-->>User: Login complete ``` During the wait, a spinner displays the authorize URL on stderr so you can copy it if the browser launch fails. Ctrl\+C cancels the wait. The default OAuth-wait budget is two minutes (`OAuthTimeout`); the token-exchange POST gets its own fresh `--timeout` budget after a valid callback. Browser approval can take longer than `--timeout`. Caller cancellation and caller deadlines still apply throughout login, including the exchange and local save. Browser-wait expiry remains an auth failure (exit 1), with `redirect_url` in the error details. An exchange timeout or caller deadline exits 7; cancellation exits 6. Rate limits exit 3 and permission failures exit 1. Slack validation errors such as `invalid_arguments` exit 4. Malformed responses, server failures, and transport failures exit 5. These failures do not save a new credential or change the previous config. An occupied callback port exits 5 and includes `callback_address`, without copying the underlying network error. Known OAuth client, code, verifier, redirect, and PKCE setup errors remain auth failures (exit 1). The error keeps Slack's defined code so you can correct the setup or repeat browser approval. Unknown response text remains redacted. ### Common errors | Error | Cause | Fix | | --- | --- | --- | | `workspace profile is already authenticated; rerun with --force to overwrite auth fields` | The profile uses another credential reference, or its managed keychain credential exists. | Pass `--force` to replace it. A missing managed keychain entry can be restored without `--force`. | | `oauth flow timed out waiting redirect_url=…` | The OAuth window stayed open longer than `OAuthTimeout` (default 2m). | Re-run; consider raising `OAuthTimeout` if your IdP redirect is slow. | | `invalid_auth` / `token_revoked` | Token is bad or has been revoked on Slack's side. | Re-run `auth login`. | ## auth status Check every configured profile in name order. A missing or invalid credential is reported in that profile’s result; the completed check still exits 0. Cancellation exits 6 and a timeout exits 7, without a partial success result. Provider and transport diagnostics are redacted. Known Slack error codes, such as `invalid_auth`, remain visible. With no profiles, JSON and compact output contain `workspaces: []`. Human output says `No workspace profiles configured`. This command takes no positional arguments and does not change your configuration. Show auth state for every configured workspace. The action label colour-codes state at a glance: - `Authenticated` (bold green) — credentials valid; `authenticated=true`. - `Authentication invalid` (red) — credentials exist but Slack rejected them. - `Credentials missing` (red) — workspace metadata exists; no credential in the keychain. ``` slick auth status ``` Human output: ``` Authenticated workspace=default team_id=T123ABC456 team_name="Example Inc" token_type=user authenticated=true ``` JSON data excerpt (authenticated profile): ``` { "data": { "workspaces": [ { "workspace": "default", "authenticated": true, "token_type": "user", "team_id": "T123ABC456", "team_name": "Example Inc", "validation_state": "valid" } ] } } ``` JSON data excerpt (a configured credential was removed outside slick). Workspace metadata is still present, but `validation_state` is `missing` and `authenticated` is `false`: ``` { "data": { "workspaces": [ { "workspace": "default", "authenticated": false, "token_type": "user", "team_id": "T123ABC456", "team_name": "Example Inc", "validation_state": "missing" } ] } } ``` ## auth switch Change the default workspace used when `--workspace` is omitted. ``` slick auth switch ``` Names match without regard to case; the stored spelling is preserved. Whitespace in the argument is trimmed; `--debug` logs the trim. Switching is local and does not read credentials or call Slack. Use `--dry-run` or `-n` to preview the canonical target without changing the config. Preview results include `dry_run: true`. A save failure before file replacement leaves the previous default and all profile settings intact. If replacement succeeded but directory sync failed, the new default stays applied and the error reports `config_published: true` with `durability_confirmed: false`. Cancellation exits 6; timeouts exit 7. Result metadata names the selected target. ### Output Human: ``` Workspace switched workspace=default authenticated=false ``` JSON data excerpt (`auth.switch`). Switching selects a profile without validating its credentials. The receipt includes `authenticated: false`; use `auth status` to check authentication. ``` { "data": { "workspace": "default", "authenticated": false } } ``` ## auth logout Names match without regard to case. `--dry-run` or `-n` previews the local logout without reading credentials, calling Slack, or changing files. Logout first saves the config change. If that fails before file replacement, the previous config and credentials stay intact. If replacement succeeded but directory sync failed, the local config change stays applied. The exit-5 error reports `config_published: true`, `durability_confirmed: false`, and `credential_cleanup_attempted: false`; revocation and keychain deletion have not run. Inspect the config and remaining credential before retrying. Profiles keep their preferences, including an explicit attribution setting of either `true` or `false`. A profile with no remaining preferences is removed. Removing the default selects the first remaining profile in name order; removing the last profile removes the config file. After saving, slick tries to revoke the token and delete its keychain entry. An unresolved configured credential, or a failure in either step, produces a redacted warning on stderr while local logout continues. Slack must explicitly confirm `revoked: true`; an explicit `false` also produces a warning. A failed revocation may leave the token active; a failed keychain deletion may leave the saved credential available. Logging out removes auth fields and preserves configured preferences. If no profiles remain, slick removes the empty config file. Revoke the token on Slack and delete the local credential. With `--keep-token`, slick removes the workspace's auth fields from config but leaves the keychain credential alone and skips Slack-side revocation. ``` slick auth logout slick auth logout default --keep-token ``` ### Flags > [!NOTE] > > **Flags** > > | Flag | Value | Description | > | --- | --- | --- | > | `-K`, `--keep-token` | | Skip token revocation and local credential deletion; only removes the workspace auth fields from config | `--keep-token` emits an Info-level notice on stderr explaining that the token remains active in the workspace until manually revoked or it expires. ### Output Human (destructive logout — revokes via the Slack API, deletes the keychain entry): ``` Logout complete workspace=default authenticated=false ``` Human (`--keep-token`). The first line is the Info-level notice on stderr; the second is the result event on stdout: ``` INF --keep-token preserves the credential in keychain; the token is still valid on Slack's side until manually revoked or it naturally expires workspace=default Logout complete workspace=default authenticated=false ``` JSON data excerpt (`auth.logout`). `authenticated` is forced to `false`: ``` { "data": { "workspace": "default", "authenticated": false } } ``` > [!NOTE] > > **Retained credentials do not sign you back in** > > `--keep-token` leaves the credential in keychain but removes its reference from the profile. Later commands do not automatically discover that entry. Authenticate again to restore the reference. An explicit token environment override can still authenticate the profile; it is independent of the removed reference. ## See also - [Manifest]() — generate a Slack app manifest that matches the scopes you want. - [Config]() — workspace preferences (default channel, attribution). - [Workspace]() — list configured profiles. - Slack API methods: [`auth.test`](), [`oauth.v2.access`](), [`auth.revoke`](). # slick agent The agent surface uses [docent]() to serve embedded runbooks, command discovery, and exported skills without credentials. The embedded guides are the workflow authority. The `slack-cli` plugin includes the [Slack CLI skill](). This skill uses the guides and command schema from the installed CLI. `agent guide`, `agent schema`, and `agent export` results and failures use `agent` as the workspace label, including invalid arguments and flag combinations. They do not select a configured workspace. Automatic output stays JSON in a terminal; pass `--output=human` for Markdown and human diagnostics. ## Documentation for agents The website's [llms.txt index]() links to Markdown copies of the public reference pages. The [full-text export]() combines those pages, and **Copy as Markdown** copies the current page's rendered content. These exports describe the website revision. Use the installed binary's schema and embedded guides for its exact contract and authoritative workflows; neither requires Slack credentials: ``` slick agent schema --output=json slick agent guide --output=human slick agent guide core-contract --output=human slick agent guide safe-mutation --output=human slick agent guide --all --output=human ``` The website export does not include the complete embedded runbook collection. Retrieve runbooks from the binary rather than assuming the website matches an older installed release. For machine-readable guides, use `--output=json` and read `data.document`. ## Schema ``` slick agent schema --output=json slick agent schema --path 'message send' --output=json slick agent schema --shapes --output=compact slick agent schema --compact --output=json ``` JSON uses the common `{ok,meta,data,errors}` envelope. The schema artifact lives at `data.schema`, or `schema` in compact mode. Local `$ref` values resolve against that extracted artifact. Human mode prints the JSON artifact directly. The docent tree uses `name`, `path`, `children`, `flags`, and `flag_groups`. Persistent flags are declared on their owning ancestor. Host contract metadata remains under `extensions`: auth, environment names, exit codes, output modes, examples, input/output descriptions, guide summaries, and operational guidance. `extensions.contract_version` is `2`. `read_only: true` identifies Slack reads, local discovery, and manifest or completion-script generation. Explicit mutations of Slack, credentials, configuration, caches, or exported files keep this field false or omitted. Routing parents also keep the conservative default; inspect the leaf command's classification when choosing an operation. The classification is retained in compact and selected-subtree schemas. | Flag | Meaning | | --- | --- | | `--path`, `-p` | Select one canonical command subtree, including schemas | | `--shapes`, `-s` | Embed schemas throughout the tree; repeated bodies pool under `$defs` | | `--compact`, `-c` | Retain routing facts while omitting verbose descriptions and metadata | These flags are mutually exclusive. The local `--compact` changes schema content; global `--output=compact` selects the result format. ## Guides ``` slick agent guide --output=human slick agent guide send-msg --output=human slick agent guide send_msg --section Run --output=human slick agent guide --all --output=json ``` No slug returns an index. A slug returns its runbook; old underscore names resolve as aliases. `--section`, `-s` selects one of Decide, Run, Save, Preconditions, Recover, or Next. `--all`, `-a` returns every guide in canonical order. JSON carries Markdown at `data.document`; compact at `document`. Human mode prints Markdown directly. All-guide documents use form-feed separators in their canonical machine representation. ## Export ``` slick agent export --format agent-skill --dir ./slick-skills --output=json slick agent export --scope project --harness codex --output=json ``` `--dir`, `-d` requires an explicit `--format`, `-f`. Alternatively, `--scope`, `-s` selects `project` or `user`; `--harness`, `-H` selects the consumer, or docent detects it. Explicit directory and scope are exclusive. Built-in formats are `agent-skill` and `claude-skill`; exported skill names are qualified with `slick-`. JSON reports relative written paths in `data.paths`. Export writes files to the selected destination and updates existing slick skill files. Other files remain in place. `--dir` expands `~` and environment variables. Add `--dry-run` to preview the relative paths without creating or changing files. Machine previews include `dry_run: true`; human previews say that no files were written. A preview does not check whether the destination is writable. If a filesystem operation fails, export exits with code 5. Machine errors include `details.completed_paths`, listing files already written relative to the export root. Export does not roll back those files. Resolve the failure and rerun to finish the export. A failure to write the result uses exit 8; inspect the files before rerunning because the export may already have finished. ## Compatibility Contract version 2 moves raw schema output into the common result envelope, replaces the bespoke schema walker with docent, and changes no-argument guide output from a full dump to an index. Use `agent guide --all` for the full set, `--output=human` for direct Markdown, and extract `data.schema` when a tool needs the schema artifact alone. Former top-level contract metadata is now under the artifact's `extensions` object. # Messaging # slick message **Send**, **edit**, and **delete** Slack messages. Markdown input is converted to [Block Kit]() by default; `--blocks` accepts raw Block Kit JSON. Slack-side message mutations require `chat:write` and permission to act in the destination; user-token profiles can edit and delete only their own messages. For thread replies, see [`reply`](). For reactions, see [`react`](). Opening a one-to-one DM needs `im:write`; opening a group DM needs `mpim:write`. Both need `chat:write` to send. Resolving an email recipient also needs `users:read.email`. These requirements apply to scheduled sends too. ## message send Send to a channel by ID, name, or alias; `--file -` reads the body from stdin, and `--dry-run` previews without sending: ``` slick message send --channel C1234567890 --message "Deploy complete" echo "Deploy complete" | slick message send --channel C1234567890 --file - slick message send --channel C1234567890 --message "Deploy complete" --dry-run ``` Send to one user, a group DM, or a Slack-profile email: ``` slick message send --user U1234567890 --message "Build artifact ready" slick message send --user dev@example.com,ops@example.com --message "Review please" ``` Send a raw Block Kit payload from a file: ``` slick message send --channel C1234567890 --blocks --file blocks.json ``` Schedule a future send with RFC3339, a Go duration, or Unix seconds (no natural-language times). For an absolute time, set `send_at` to an RFC3339 timestamp within the next 120 days: ``` slick message send --channel C1234567890 --message "Deploy at the chosen time" --schedule "$send_at" slick message send --channel C1234567890 --message "Deploy in 90 minutes" --schedule 90m slick message send --user dev@example.com --message "DM follow-up" --schedule 90m ``` ### Flags `message send --filename` (`-N`) is a deprecated compatibility option with no effect. Message text has no filename. Use `file upload --filename` for attachments. > [!NOTE] > > **Flags** > > | Flag | Value | Description | > | --- | --- | --- | > | `-c`, `--channel` | `` | Channel ID, name, or alias | > | `-u`, `--user` | `…` | User ID or alias; repeat or comma-separate for group DM | > | `-m`, `--message` | `` | Message body | > | `-f`, `--file` | `` | Read message body from file or `-` for stdin | > | `-b`, `--blocks` | | Treat message source as raw Block Kit JSON | > | `-s`, `--schedule` | `` | Schedule for future send: RFC3339, Go duration, or Unix seconds | > | `-n`, `--dry-run` | | Preview without sending | > [!NOTE] > > **Attribution flags** > > Accepted by the four mutating commands (`message send`, `message edit`, `reply`, `file upload`): > > | Flag | Value | Description | > | --- | --- | --- | > | `--[no-]attribution` | | Toggle attribution for this command | > | `--attribution-label` | `