Install
openclaw skills install opencode-discord-threadUse this skill when OpenClaw should hand a coding task to OpenCode, keep the OpenCode run model-compatible with Z.AI Coding Plan / GLM plans, and mirror execution progress into a Discord thread for live review.
openclaw skills install opencode-discord-threadUse this skill when the user wants OpenClaw to delegate coding work to a local OpenCode run and keep that run visible in Discord.
This skill is optimized for Z.AI Coding Plan workflows. Do not hard-code a stale GLM model id. Prefer an authenticated Z.AI Coding Plan provider and let the caller pass the exact model explicitly when needed.
Use this skill when all of the following are true:
opencode installed and authenticated, ideally through opencode auth login with Z.AI Coding Plan.Avoid this skill when:
--attach http://host:port when available.scripts/run_opencode_discord_bridge.py to launch opencode run --format json, summarize event output, and mirror that stream into Discord.For compatibility with Z.AI Coding Plan:
Z.AI Coding Plan provider rather than assuming a generic provider entry.opencode models or inside OpenCode via /models.--model provider/model only after discovery or when the operator already knows the right id.This keeps the skill resilient when Z.AI changes the exact GLM model catalog.
The bridge supports two modes:
--thread-id.--parent-channel-id and optionally --thread-name.The bridge posts a header message, keeps a rolling status message updated during execution, then posts the final summary and any remaining transcript chunks.
Existing thread:
python3 skills/opencode-discord-thread/scripts/run_opencode_discord_bridge.py \
--repo /path/to/repo \
--thread-id 123456789012345678 \
--prompt "Implement the requested feature and run relevant tests." \
--model zai/glm-4.5
Create a new thread from a parent channel:
python3 skills/opencode-discord-thread/scripts/run_opencode_discord_bridge.py \
--repo /path/to/repo \
--parent-channel-id 123456789012345678 \
--thread-name "OpenCode: feature work" \
--prompt-file /tmp/opencode_prompt.txt
Reuse a warm OpenCode server:
python3 skills/opencode-discord-thread/scripts/run_opencode_discord_bridge.py \
--repo /path/to/repo \
--thread-id 123456789012345678 \
--attach http://127.0.0.1:4096 \
--prompt "Continue the current implementation and summarize the diff."
The bridge reads:
DISCORD_BOT_TOKEN for Discord API access.opencode auth login.If the bridge fails:
opencode --version.opencode auth list.