Configure and prove a chat channel with non-interactive one-liners; secrets only as SecretRefs.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-configure-channel-4724022559f5 ,按照其中的说明把「configure-channel」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Never print or persist secret values; channel tokens enter config only as SecretRefs, or through the in-session connect_channel flow where the operator types the secret into a masked prompt. Never hand-edit config files on disk. Every run ends with the observable Prove result or an exact explanation of why it could not be proven.
openclaw channels list --all
openclaw channels status
openclaw config get channels --json # "Config path not found" is normal before first setup
Confirm the exact config path before writing — key names differ per channel (channels.telegram.botToken, channels.discord.token, ...):
openclaw config schema --json | jq '.properties.channels.properties.telegram'
Confirm the intended account and access changes with the operator before writing. Preserve existing approved allowlist entries, dmPolicy, and groupPolicy unless their replacement or change is explicitly approved; never broaden access to make a probe pass.
Preferred shell path — token staged as an env var on the gateway process or in a 0600 file, wired as a SecretRef (Telegram example):
openclaw config set channels.telegram.botToken --ref-provider default --ref-source env --ref-id TELEGRAM_BOT_TOKEN
With the bot connected and DM policy pairing, ask the operator to DM it. Read Your Telegram user id in the pairing reply, or run openclaw logs --follow and read senderUserId in that sender's telegram pairing request entry. Stop following once captured; keep unrelated logs private. If the current policy prevents this flow, use an already verified ID or report the discovery blocker; do not broaden access.
Use the numeric Telegram user ID, not a phone number, username, chat/group ID, or bot ID. In this single-user example, 123456789 is a placeholder: replace it with the verified, approved user ID and retain any other approved entries.
openclaw config set channels.telegram.allowFrom '["123456789"]' --strict-json
Multi-field changes in one validated write:
openclaw config patch --stdin <<'JSON'
{ channels: { telegram: { enabled: true, groupPolicy: "allowlist" } } }
JSON
In-session alternative: call the connect_channel tool action with the channel id — the operator enters the token in a masked prompt, never in chat. Avoid openclaw channels add --token <value>: it puts the secret in argv and process listings.
openclaw doctor --lint
openclaw channels status --probe
doctor --lint can exit 1 for findings: read the report and continue the remaining checks. Ordinary doctor and doctor --non-interactive can write config/state; do not use them for diagnosis before approval. Apply openclaw doctor --fix --non-interactive only after explicit approval, then re-check status.
Send one real, clearly labeled test message and confirm delivery from the command result (use --dry-run first to inspect the payload):
openclaw message send --channel telegram --target <chatId> --message "OpenClaw channel test — please ignore" --dry-run
openclaw message send --channel telegram --target <chatId> --message "OpenClaw channel test — please ignore"
If sending fails, report the exact account, permission, destination, or network blocker without exposing credentials.
State the channel and account changed, the exact config paths written (never values), the test destination, and the observed delivery result. List any remaining operator action.
Further reference: https://docs.openclaw.ai/channels/telegram (and the matching page for other channels)