Source: https://cli.nylas.com/docs/commands/slack-search

# nylas slack search

Search Slack messages across channels.

Written by [Qasim Muhammad](https://cli.nylas.com/authors/qasim-muhammad) Staff SRE

Published February 13, 2026

Updated June 21, 2026

## What does nylas slack search do?

The nylas slack search command searches your Slack workspace for messages matching a query string. Results include the channel, sender, timestamp, and message text. Use --limit to cap the number of results returned. Slack query modifiers like from:@user and in:#channel are supported.

## Usage

```bash
nylas slack search --query QUERY [--limit N]
```

## Flags

| Flag | Description |
| --- | --- |
| --json | Output as JSON |
| --no-color | Disable color output |
| --verbose(-v) | Enable verbose output |
| --config | Custom config file path |
| --help(-h) | Show help for the command |
| --limit | Maximum number of results |
| --yes(-y) | Skip confirmations |
| --query | Search query string |
| --id | Show message IDs |

## Examples

The nylas slack search command searches your Slack workspace for messages matching a query string.

### Search by keyword

```bash
nylas slack search --query "deployment failed" --limit 10
```

### Search messages from a specific user

```bash
nylas slack search --query "from:@alice OAuth token"
```

## Example output

```text
Results for "release" (3 matches)

#general       Alice Chen   Cutting the release now
#engineering   Bob Smith    Release notes are ready for review
#engineering   Alice Chen   Release shipped to production

3 results
```

## Troubleshooting

### No results for known messages

Slack search requires the search:read scope on your token. Verify at api.slack.com/apps.

### Results missing messages from private channels

User tokens (xoxp-) can search private channels the user belongs to. Bot tokens cannot search private channels.

## Related commands

[nylas slack auth removeRemove stored Slack token](https://cli.nylas.com/docs/commands/slack-auth-remove)

[nylas slack auth setSet the Slack API token for workspace integration.](https://cli.nylas.com/docs/commands/slack-auth-set)

[nylas slack auth statusShow Slack auth status](https://cli.nylas.com/docs/commands/slack-auth-status)

[nylas slack channels infoShow channel details](https://cli.nylas.com/docs/commands/slack-channels-info)

[nylas slack channels listList channels.](https://cli.nylas.com/docs/commands/slack-channels-list)

[nylas slack messages listList recent messages in a Slack channel.](https://cli.nylas.com/docs/commands/slack-messages-list)

Run `nylas slack search --help` for full help output.
