Skip to content

appitool slack ​

Sends a message to Slack using either an incoming webhook or a bot token. The bold title and message go in the top-level text; a colored attachment (green for success / red for failure) carries the status bar and footer.

Formatting & Mentions ​

--title and --message are sent unescaped as Slack mrkdwn, so Slack's syntax is parsed and the text is used for mobile notifications:

SyntaxResult
*bold*, _italic_, ~strike~, `code`, > quoteText styling
<https://example.com|label>Link with label
<@U0123456789>User mention (notifies only members of the channel)
<#C0123456789>Channel link
<!here>, <!channel>, <!everyone>Special mentions
<!subteam^S0123456789>User group mention
<!date^1700000000^{date_short}|fallback>Localized date

Mentions use IDs, not display names. Write a literal &, <, or > as &amp;, &lt;, &gt;. In flow notifications, title and message are escaped and shown literally instead.

Delivery Modes ​

ModeCredentialsChannelThreads
Incoming webhook--url / SLACK_URLFixed by the webhookNo
Bot token (chat.postMessage)--token / SLACK_BOT_TOKEN (xoxb-…, chat:write scope)--channel / SLACK_CHANNEL (ID or name)--thread-ts

Destination Resolution ​

  1. --url and --token together is an error.
  2. --token → bot token mode.
  3. --url → webhook mode (never falls back to SLACK_BOT_TOKEN).
  4. Otherwise SLACK_BOT_TOKEN (bot token mode) takes precedence over SLACK_URL (webhook mode).

In bot token mode a channel is required. --channel and --thread-ts are rejected in webhook mode. The bot must be a member of the channel (or have the chat:write.public scope for public channels). On success, the posted message's ts is printed so you can reply to it with --thread-ts.

Synopsis ​

bash
appitool slack -m <message> [options]

Options ​

OptionDefault / .env FallbackDescription
--title <title>appitoolBold first line of the message (mrkdwn, sent as-is).
-m, --message <message>RequiredMessage text (Slack mrkdwn, sent as-is).
--status <status>successAttachment color: success (green) or failure (red).
--url <url>SLACK_URLSlack incoming webhook URL.
--token <token>SLACK_BOT_TOKEN (when --url is omitted)Slack bot token (xoxb-…).
--channel <channel>SLACK_CHANNELChannel ID or name (bot token only).
--thread-ts <ts>—Parent message ts to reply in a thread (bot token only).

Examples ​

bash
# Webhook, using SLACK_URL from .env
appitool slack -m "Release v1.2.0 deployed to TestFlight."

# Mention a user and the channel's active members
appitool slack -m "<!here> *v1.2.0* is live. Thanks <@U0123456789>!"

# Bot token to a specific channel
appitool slack --token "xoxb-…" --channel C0123456789 --title "CI" -m "Build #128 failed." --status failure

# Reply in a thread (ts printed by a previous bot token send)
appitool slack --channel C0123456789 --thread-ts 1700000000.000100 -m "Retry succeeded."

Released under the MIT License.