Command

nylas slack search

Search Slack messages across channels.

Written by Qasim Muhammad Staff SRE

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

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

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations
--querySearch query string
--limitMaximum number of results
--idShow message IDs

Examples

Search by keyword

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

Search messages from a specific user

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

Example output

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.

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