Oko/Docs

Command reference

oko chat post

Posts a message through Oko’s exact Slack webhook or bot credential; oko sends it.

Invocation#

Command
oko chat post --provider slack [--channel C] [--thread-ts TS] {--text TEXT | --text-file PATH}

Inputs and options#

  • Required message via --text or --text-file (the file wins when both are given).
  • --channel is needed for bot-token delivery; without it the channel_id kept in ~/.oko/slack.json is used.
  • --thread-ts replies in a thread.

Output and state effect#

  • Reads webhook_url and bot_token of the oko-slack Skarbiec item as consumer oko-slack-client. With a webhook it posts there; otherwise it posts with the bot token through chat.postMessage. Prints the delivery path, and for the bot the channel and message ts, as JSON.

Refusals and safe exits#

  • Refuses --webhook/--token arguments, missing message text, unreadable text files, an item holding neither credential, a missing bot channel, a webhook outside https://hooks.slack.com/services/, a webhook HTTP error with its status and body, and a Slack API error with Slack's own error name.

CLI reference#