Command

nylas slack send

Send a message to a Slack channel.

Written by Qasim Muhammad Staff SRE

What does nylas slack send do?

The nylas slack send command posts a message to any Slack channel your token has access to. Specify the channel with --channel and the message with --text. To reply in a thread, use the dedicated nylas slack reply command instead.

Usage

nylas slack send --channel CHANNEL --text TEXT

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
--channelChannel ID or name
--textMessage text to send
--yes(-y)Skip the send confirmation prompt
--channel-idChannel ID

Examples

Send to a channel

nylas slack send --channel general --text "Deploy complete for v2.4.1"

Skip the confirmation prompt in scripts

nylas slack send --channel deploys --text "Build #482 green" --yes

Example output

Send to #general as Alice Chen:
  "Hello team!"

✓ Message sent to #general

Troubleshooting

not_in_channel error

Invite the bot to the channel first with /invite @your-bot-name, or use a user token instead.

Message sends but shows as bot instead of user

Bot tokens (xoxb-) always post as the bot. Use a user token (xoxp-) to post as yourself.

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