用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/KYRIE66nb/codex-omx-public-config --skill configure-openclaw命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | configure-openclaw |
| description | Configure OpenClaw notification gateway via natural language |
| triggers | ["configure openclaw","setup openclaw","openclaw notifications","openclaw gateway"] |
Set up OpenClaw as a notification gateway so OMX can route session events through your own HTTP endpoint or CLI command.
OpenClaw is a self-hosted notification gateway that lets you receive OMX events however you want — HTTP webhooks to your own server, shell commands, or any integration you build. Unlike platform-specific notifiers (Discord, Slack), OpenClaw gives you full control over message routing and format.
Two gateway modes:
This is an interactive, natural-language configuration skill. Walk the user through setup by asking questions with AskUserQuestion. Write the result to ~/.codex/.omx-config.json.
CONFIG_FILE="$HOME/.codex/.omx-config.json"
if [ -f "$CONFIG_FILE" ]; then
HAS_OPENCLAW=$(jq -r '.notifications.openclaw.enabled // false' "$CONFIG_FILE" 2>/dev/null)
GATEWAY_TYPE=$(jq -r '.notifications.openclaw.gatewayType // empty' "$CONFIG_FILE" 2>/dev/null)
ENDPOINT=$(jq -r '.notifications.openclaw.endpoint // empty' "$CONFIG_FILE" 2>/dev/null)
COMMAND=$(jq -r '.notifications.openclaw.command // empty' "$CONFIG_FILE" 2>/dev/null)
if [ "$HAS_OPENCLAW" = "true" ]; then
echo "EXISTING_CONFIG=true"
echo "GATEWAY_TYPE=$GATEWAY_TYPE"
[ -n "$ENDPOINT" ] && echo "ENDPOINT=$ENDPOINT"
[ -n "$COMMAND" ] && echo "COMMAND=$COMMAND"
else
echo "EXISTING_CONFIG=false"
fi
else
echo "NO_CONFIG_FILE"
fi
If existing config is found, show the user what's currently configured and ask if they want to update or reconfigure.
Use AskUserQuestion:
Question: "Which OpenClaw gateway mode do you want to use?"
Options:
If user chose HTTP:
Use AskUserQuestion:
Question: "Enter your OpenClaw HTTP endpoint URL. OMX will POST JSON event data to this URL."
The user types their URL in the "Other" field.
Validate the URL:
http:// or https://Use AskUserQuestion:
Question: "Add an authorization header to secure requests? (Optional)"
Options:
Authorization: Bearer <token>If they want a Bearer token or custom header, collect the values.
If user chose CLI Command:
Use AskUserQuestion:
Question: "Enter the shell command OMX should run for each notification event. Use these placeholders:
{event} — event name (e.g. session-end){session_id} — session identifier{project} — project name/path{message} — formatted notification messageExample: notify-send 'OMX: {event}' '{message}'
Example: ~/.local/bin/my-notifier --event {event} --msg '{message}'"
The user types their command in the "Other" field.
IMPORTANT: Dual activation gate for CLI Command gateways
CLI command gateways require TWO environment variables to be set:
OMX_OPENCLAW=1 — enables the OpenClaw gatewayOMX_OPENCLAW_COMMAND=1 — specifically enables CLI command executionThis two-gate design prevents accidental command execution when only the config file is present. Remind the user to set both in their shell profile.
Use AskUserQuestion with multiSelect:
Question: "Which events should be routed through OpenClaw?"
Options (multiSelect: true):
Default selection: session-end + ask-user-question.
Read the existing config, merge the OpenClaw settings, and write back:
CONFIG_FILE="$HOME/.codex/.omx-config.json"
mkdir -p "$(dirname "$CONFIG_FILE")"
if [ -f "$CONFIG_FILE" ]; then
EXISTING=$(cat "$CONFIG_FILE")
else
EXISTING='{}'
fi
# ENDPOINT, AUTH_HEADER_NAME, AUTH_HEADER_VALUE are collected from user
echo "$EXISTING" | jq \
--arg endpoint "$ENDPOINT" \
--arg headerName "$AUTH_HEADER_NAME" \
--arg headerValue "$AUTH_HEADER_VALUE" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.openclaw = {
enabled: true,
gatewayType: "http",
endpoint: $endpoint,
headers: (if $headerName == "" then null else {($headerName): $headerValue} end)
}' > "$CONFIG_FILE"
# COMMAND is collected from user
echo "$EXISTING" | jq \
--arg command "$COMMAND" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.openclaw = {
enabled: true,
gatewayType: "command",
command: $command
}' > "$CONFIG_FILE"
# Example: disable session-start if not selected
echo "$(cat "$CONFIG_FILE")" | jq \
'.notifications.events = (.notifications.events // {}) |
.notifications.events["session-start"] = {enabled: false}' > "$CONFIG_FILE"
Regardless of gateway type, explain the activation model:
OpenClaw Activation Gates
─────────────────────────
OpenClaw requires environment variables to be set before it activates.
This prevents accidental notifications in shared or CI environments.
For HTTP Gateway:
export OMX_OPENCLAW=1
For CLI Command Gateway (requires both):
export OMX_OPENCLAW=1
export OMX_OPENCLAW_COMMAND=1
Add these to your ~/.zshrc or ~/.bashrc.
After writing config, offer to test:
Use AskUserQuestion:
Question: "Send a test notification through OpenClaw to verify the setup?"
Options:
curl -s -o /dev/null -w "%{http_code}" \
-H "Content-Type: application/json" \
${AUTH_HEADER_NAME:+-H "$AUTH_HEADER_NAME: $AUTH_HEADER_VALUE"} \
-d '{"event":"test","message":"OMX OpenClaw test notification","session_id":"test"}' \
"$ENDPOINT"
Replace placeholders in the command with test values and run it.
Report success or failure. If it fails, help debug (check URL accessibility, command path, permissions).
Display the final configuration summary:
OpenClaw Gateway Configured!
Type: HTTP / CLI Command
Endpoint: https://your-server/omx-hook (HTTP only)
Command: notify-send 'OMX' '{message}' (CLI only)
Events: session-end, ask-user-question
Config saved to: ~/.codex/.omx-config.json
Activation (add to ~/.zshrc or ~/.bashrc):
export OMX_OPENCLAW=1
export OMX_OPENCLAW_COMMAND=1 # CLI Command gateways only
To reconfigure: /configure-openclaw
To configure other platforms: /configure-notifications
# Required for all OpenClaw gateways
export OMX_OPENCLAW=1
# Required additionally for CLI Command gateways
export OMX_OPENCLAW_COMMAND=1
# HTTP gateway: override endpoint URL
export OMX_OPENCLAW_URL="https://your-server/omx-hook"
基于 SOC 职业分类