Skip to main content

Channel Commands

Channels connect OpenFang agents to messaging platforms. OpenFang supports 40 messaging platforms including Telegram, Discord, Slack, WhatsApp, Signal, Matrix, and more.

openfang channel list

List configured channels and their status.
openfang channel list

Output

CHANNEL         ENV VAR                  STATUS
---------------------------------------------------------------
webchat         (built-in)               Ready
telegram        TELEGRAM_BOT_TOKEN       Ready
discord         DISCORD_BOT_TOKEN        Missing env
slack           SLACK_BOT_TOKEN          Not configured
whatsapp        WHATSAPP_API_KEY         Not configured
signal          SIGNAL_PHONE_NUMBER      Not configured
matrix          MATRIX_HOMESERVER_URL    Not configured
email           EMAIL_SMTP_HOST          Not configured

Status Values

StatusDescription
ReadyChannel is configured and credentials are available
Missing envConfiguration exists but environment variable is missing
Not configuredNo configuration block in config.toml

Checked Channels

  • webchat — Built-in web UI (always ready)
  • telegram — Telegram Bot API
  • discord — Discord Bot
  • slack — Slack Bot
  • whatsapp — WhatsApp Business API
  • signal — Signal Messenger
  • matrix — Matrix Protocol
  • email — SMTP/IMAP
And 32 more (LINE, Mastodon, Twitter/X, Facebook, Instagram, WeChat, etc.).

Example

openfang channel list

openfang channel setup

Interactive setup wizard for a channel integration.
openfang channel setup [<CHANNEL>]

Arguments

ArgumentDescription
<CHANNEL>Channel name (e.g., telegram, discord, slack). If omitted, displays an interactive picker.

Supported Channels

  • telegram
  • discord
  • slack
  • whatsapp
  • email
  • signal
  • matrix

Wizard Steps

Each wizard:
  1. Displays step-by-step instructions for obtaining credentials
  2. Prompts for tokens/credentials
  3. Saves tokens to ~/.openfang/.env with owner-only permissions (0600 on Unix)
  4. Appends the channel configuration block to config.toml (prompts for confirmation)
  5. Warns to restart the daemon if one is running

Examples

# Show list of available channels
openfang channel setup

Example Session (Telegram)

openfang channel setup telegram
Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Telegram Bot Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Step 1: Create a Telegram bot
  1. Open https://t.me/BotFather in Telegram
  2. Send /newbot
  3. Follow the instructions to create your bot
  4. Copy the bot token (looks like 123456:ABC-DEF...)

Step 2: Enter your bot token
Bot token: 123456789:ABCdefGHIjklMNOpqrsTUVwxyz

✓ Token saved to ~/.openfang/.env
✓ Testing token... OK

Step 3: Add configuration to config.toml

[[channels]]
type = "telegram"
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"

Add this to config.toml? [Y/n]: y

✓ Configuration added to ~/.openfang/config.toml

Done! Telegram channel is now configured.

⚠  Restart the daemon to apply changes:
   openfang stop && openfang start

Next steps:
  1. Start the daemon: openfang start
  2. Get your bot username from @BotFather
  3. Send a message to your bot on Telegram
  4. The agent will respond automatically

openfang channel test

Send a test message through a configured channel.
openfang channel test <CHANNEL>

Arguments

ArgumentDescription
<CHANNEL>Channel name to test (e.g., telegram, discord).

Behavior

Requires a running daemon. Sends POST /api/channels/<channel>/test.
This command requires the daemon to be running. Start it with:
openfang start

Examples

# Test Telegram channel
openfang channel test telegram

# Test Discord channel
openfang channel test discord

# Test Slack channel
openfang channel test slack

Example Output

Testing telegram channel...

✓ Test message sent successfully!

Check your Telegram bot to confirm you received:
  "Test message from OpenFang at 2026-03-07 14:23:45"

openfang channel enable

Enable a channel integration.
openfang channel enable <CHANNEL>

Arguments

ArgumentDescription
<CHANNEL>Channel name to enable.

Behavior

  • Daemon mode: Sends POST /api/channels/<channel>/enable. Channel starts immediately.
  • Without daemon: Prints a note that the change will take effect on next start.

Examples

# Enable Discord channel
openfang channel enable discord

# Enable Slack channel
openfang channel enable slack

Output

✓ Discord channel enabled

The channel is now active and will receive messages.

openfang channel disable

Disable a channel without removing its configuration.
openfang channel disable <CHANNEL>

Arguments

ArgumentDescription
<CHANNEL>Channel name to disable.

Behavior

  • Daemon mode: Sends POST /api/channels/<channel>/disable. Channel stops immediately.
  • Without daemon: Prints a note to edit config.toml and set enabled = false.

Examples

# Disable Discord channel (keeps config)
openfang channel disable discord

# Disable Telegram channel
openfang channel disable telegram

Output

✓ Discord channel disabled

The channel is now inactive. Configuration is preserved.
To re-enable: openfang channel enable discord

Complete Channel Setup Example

1

Check Channel Status

openfang channel list
2

Setup Telegram

openfang channel setup telegram
Follow the wizard to get your bot token from @BotFather.
3

Restart Daemon

openfang stop
openfang start
4

Test the Channel

openfang channel test telegram
5

Start Chatting

Send a message to your bot on Telegram. The agent will respond automatically!

Configuration Format

Channel configurations are stored in ~/.openfang/config.toml:
config.toml
[[channels]]
type = "telegram"
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"

[[channels]]
type = "discord"
enabled = false
bot_token_env = "DISCORD_BOT_TOKEN"
guild_id = "123456789"

[[channels]]
type = "slack"
enabled = true
bot_token_env = "SLACK_BOT_TOKEN"
signing_secret_env = "SLACK_SIGNING_SECRET"
Credentials are stored in ~/.openfang/.env:
.env
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz
DISCORD_BOT_TOKEN=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAuGhI-Jk.LmNoP_qRsTuVwXyZaBcDeFgHiJkLmN
SLACK_BOT_TOKEN=xoxb-1234567890-1234567890-ABCdefGHIjklMNOpqrsTUVw
SLACK_SIGNING_SECRET=0123456789abcdef0123456789abcdef
The .env file contains secrets. It is automatically created with owner-only permissions (0600 on Unix). Never commit it to version control.

Supported Platforms (40+)

  • Twitter/X
  • Facebook Messenger
  • Instagram DM
  • LinkedIn
  • Reddit
  • Mastodon
  • Bluesky
  • Threads
  • Snapchat
  • TikTok
  • LINE
  • WeChat
  • Viber
  • Threema
  • Wire
  • Keybase
  • Mattermost
  • Rocket.Chat
  • Zulip
  • IRC
  • XMPP
  • Gitter
  • Microsoft Teams
  • Zoom Chat
  • Google Chat
  • Cisco Webex
  • RingCentral
  • 8x8
  • Twilio SMS
  • Vonage SMS
  • MessageBird
  • Plivo

Next Steps

Agent Commands

Connect agents to channels

Channel Development

Create custom channel adapters

Channel API

Manage channels via REST API

CLI Overview

Back to CLI overview

Build docs developers (and LLMs) love