> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# slack

> Slack Web API client speaking the OpenClaw Slack action vocabulary.

Mirage's built-in Slack Web API client follows the Slack action vocabulary
from the upstream [OpenClaw](https://github.com/openclaw/openclaw) project.
The Mirage command tree is discoverable with `slack --help`.

**Licenses:** OpenClaw uses the
[MIT License](https://github.com/openclaw/openclaw/blob/main/LICENSE); Mirage's
independent Slack implementation uses
[Apache-2.0](https://github.com/strukto-ai/mirage/blob/main/LICENSE).

## Install

```typescript theme={null}
import { SLACK } from '@struktoai/mirage-core'
import { SlackVFS, Workspace } from '@struktoai/mirage-node'

const config = { token: 'xoxb-...', searchToken: 'xoxp-...' }
const ws = new Workspace({ '/slack': new SlackVFS(config) })
ws.registerCli('slack', SLACK, config)
```

Two installs under different names are two accounts. In YAML, the same
install rides the `clis:` section; see the [CLI overview](/typescript/cli/index).

## Verbs

The verbs follow that OpenClaw Slack action vocabulary (kebab verbs:
`send-message`, `read-messages`, `pin-message`, `list-pins`,
`member-info`, `emoji-list`); `search` and `list-members` are mirage
extensions. Search needs a user token (`search_token`), the rest run on
the bot token.

### Messages

```bash theme={null}
slack send-message --channel C04KEPWF6V7 --text "Hello from MIRAGE"
slack send-message --channel C04KEPWF6V7 --thread-ts 1712345678.123456 --text "Thread reply"
slack read-messages --channel C04KEPWF6V7 --limit 20
```

| Verb | Flags | Writes |
| - | - | - |
| `send-message` | `--channel --text [--thread-ts]` | yes |
| `read-messages` | `--channel [--limit]` | no |

### Reactions and pins

```bash theme={null}
slack react --channel C04KEPWF6V7 --ts 1712345678.123456 --emoji thumbsup
slack reactions --channel C04KEPWF6V7 --ts 1712345678.123456
slack pin-message --channel C04KEPWF6V7 --ts 1712345678.123456
slack list-pins --channel C04KEPWF6V7
slack unpin-message --channel C04KEPWF6V7 --ts 1712345678.123456
```

| Verb | Flags | Writes |
| - | - | - |
| `react` | `--channel --ts --emoji` | yes |
| `reactions` | `--channel --ts` | no |
| `pin-message` | `--channel --ts` | yes |
| `unpin-message` | `--channel --ts` | yes |
| `list-pins` | `--channel` | no |

### Members, emoji, search

```bash theme={null}
slack member-info --user U04K21SEVR9
slack list-members --query "alice"
slack emoji-list
slack search --query 'from:@priya in:#general launch' --count 20 --page 1
```

| Verb | Flags | Writes |
| - | - | - |
| `member-info` | `--user` | no |
| `list-members` | `[--query]` | no |
| `emoji-list` | | no |
| `search` | `--query [--count] [--page]` | no |

`search` supports Slack query operators (`from:@user`, `in:#channel`,
`after:YYYY-MM-DD`).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.