Skip to main content

Send a Message

copera channels message send <channel-id> --body "Hello from the CLI!"
The message appears instantly in the channel if the integration has the required permissions and is a participant of the target channel.

Message Formatting

Messages support Markdown:
copera channels message send <channel-id> --body "## Build Report

* **Status:** Success
* **Duration:** 3m 42s
* **Branch:** main

> All tests passed."
Supported formatting:
  • Headings (H1-H6)
  • Bold and italic
  • Ordered and unordered lists
  • Inline and multiline code blocks
  • Blockquotes
  • Links

Common Patterns

CI/CD notifications

# In a deploy script
copera channels message send $COPERA_CHANNEL_ID \
  --body "Deployed **v${VERSION}** to production at $(date -u +%H:%M) UTC"

Pipe output from other commands

# Send test results summary
echo "## Test Results\n\n$(pnpm test --run 2>&1 | tail -5)" | \
  copera channels message send <channel-id> --body "$(cat)"

Script: alert on failure

#!/bin/bash
if ! pnpm build; then
  copera channels message send $COPERA_CHANNEL_ID \
    --body "Build failed on branch **$(git branch --show-current)**"
fi

Environment Variables

For scripting, set the channel ID as an environment variable:
export COPERA_CLI_AUTH_TOKEN="cp_key_your_token"
export COPERA_CHANNEL_ID="66abc123def456789012abcd"

copera channels message send $COPERA_CHANNEL_ID --body "Automated alert"