harahara
ChannelsChannels & Gateway

Channels & Gateway

Drive hara from a chat app — ten platforms, with voice, files, images, and resumable per-chat sessions.

Run a gateway

hara gateway is an opt-in daemon that lets you drive your local hara from a chat app. Each inbound message spawns a headless run on that chat's own resumable session; the reply comes back in chat. The daemon connects out (long-poll or WebSocket), so it needs no public webhook — it runs fine on your laptop behind NAT.

hara gateway --platform <name>

Platforms at a glance

PlatformTransportImagesNotes
Telegramlong-poll✅ two-waytoken from @BotFather
WeChatiLink long-poll✅ two-wayQR login
DiscordWebSocket✅ two-wayneeds Message Content Intent
Feishu / LarkWS long-connection✅ two-wayp2p DMs (v1)
SlackSocket Mode✅ two-wayApp + Bot tokens
MattermostWebSocket + REST✅ two-wayself-host or cloud
Matrix/sync long-poll✅ two-wayunencrypted rooms (v1)
DingTalkStream Modetext onlyreply window is per-message
WeComAI-Bot WS✅ two-wayconnects out; AES media
Signalsignal-cli (JSON-RPC)✅ two-wayneeds a local signal-cli daemon

Common setup

  • HARA_GATEWAY_ALLOWED — comma-separated user ids allowed to drive the bot. Empty = nobody (safe default; the gateway is never wide-open).
  • --cwd <dir> — point it at a real project. The default is a safe scratch workspace (~/.hara/workspace), so a full-auto bot never lands on a real repo by accident.
  • Each (chat × directory) is a stable, resumable session.
  • Session hygiene: a chat idle past 8 hours starts its next message on a fresh thread (one-time notice with /resume <id>; the old thread persists). Tune with HARA_GATEWAY_IDLE_HOURS; 0 disables.

Credentials per platform

PlatformEnv
TelegramHARA_TELEGRAM_TOKEN
WeChathara gateway --platform weixin --login (QR; the scanner is auto-allowed)
DiscordHARA_DISCORD_TOKEN
Feishu / LarkHARA_FEISHU_APP_ID · HARA_FEISHU_APP_SECRET (+ HARA_FEISHU_DOMAIN=lark)
SlackHARA_SLACK_APP_TOKEN (xapp-…) · HARA_SLACK_BOT_TOKEN (xoxb-…)
MattermostHARA_MATTERMOST_URL · HARA_MATTERMOST_TOKEN
MatrixHARA_MATRIX_HOMESERVER · HARA_MATRIX_TOKEN · HARA_MATRIX_USER_ID
DingTalkHARA_DINGTALK_CLIENT_ID · HARA_DINGTALK_CLIENT_SECRET
WeComHARA_WECOM_BOT_ID · HARA_WECOM_SECRET (create an AI Bot in the WeCom admin console)
SignalHARA_SIGNAL_RPC_URL · HARA_SIGNAL_NUMBER (run a local signal-cli daemon)
# Telegram
HARA_TELEGRAM_TOKEN= HARA_GATEWAY_ALLOWED=<your id> hara gateway --platform telegram
 
# Slack (Socket Mode — connects out, no Request URL)
HARA_SLACK_APP_TOKEN=xapp-… HARA_SLACK_BOT_TOKEN=xoxb-… HARA_GATEWAY_ALLOWED=U0123 \
  hara gateway --platform slack

In-chat commands

CommandDoes
/pwd · /cd <dir>show / switch the project the chat operates in
/sessions · /new · /resume <id>list / fork / jump between threads in the current dir
/voice · /say <text>toggle spoken replies · speak one message
/send <path>send a file (image inline, anything else as an attachment)

Anything else is a task — hara runs it on that chat's session and replies.

Voice & media

  • Voice in — a voice note is transcribed and handed to hara as text, tagged so it knows it came from voice.
  • Voice out — replies can be spoken via pluggable TTS (below).
  • Images & files — send a photo and hara sees it (inline for a vision model, else described via your visionModel); ask it to send a file back and it uses the send_file tool. Both work in plain conversation on every platform marked two-way above.

Text-to-speech

Env varFor
HARA_TTS_PROVIDERsay (macOS, default) · openai · cmd
HARA_TTS_VOICEvoice name (e.g. Tingting for Mandarin on macOS)
HARA_TTS_MODEL · HARA_TTS_BASE_URL · HARA_TTS_API_KEYan OpenAI-compatible /audio/speech endpoint
HARA_TTS_CMDlocal command — text on stdin, {out} → output path

Keep it running

hara gateway runs in the foreground; supervise it with launchd / systemd / pm2, or:

nohup hara gateway --platform <name> > ~/.hara/<name>-gw.log 2>&1 &
Was this helpful?
harahara
A product by Nanhara · Apache-2.0 · v0.139.0

© 2026 Nanhara Technologies