跳轉到主要內容

Documentation Index

Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

openclaw webhooks

Webhook 輔助程式與整合。目前此介面範圍限於 Gmail Pub/Sub 流程,這些流程會與內建的 gog 監看器整合。

子命令

openclaw webhooks gmail setup --account <email> [...]
openclaw webhooks gmail run   [--account <email>] [...]
子命令說明
gmail setup設定 Gmail watch、Pub/Sub topic/subscription,以及 OpenClaw Webhook 傳遞目標。
gmail run執行 gog watch serve 加上 watch 自動續期迴圈。

webhooks gmail setup

設定 Gmail watch、Pub/Sub,以及 OpenClaw Webhook 傳遞。
openclaw webhooks gmail setup --account you@example.com
openclaw webhooks gmail setup --account you@example.com --project my-gcp-project --json
openclaw webhooks gmail setup --account you@example.com --hook-url https://gateway.example.com/hooks/gmail

必填

旗標說明
--account <email>要監看的 Gmail 帳戶。

Pub/Sub 選項

旗標預設值說明
--project <id>(無)GCP 專案 ID(OAuth 用戶端擁有者)。
--topic <name>gog-gmail-watchPub/Sub topic 名稱。
--subscription <name>gog-gmail-watch-pushPub/Sub subscription 名稱。
--label <label>INBOX要監看的 Gmail label。
--push-endpoint <url>(無)明確的 Pub/Sub push endpoint。會覆寫 Tailscale。

OpenClaw 傳遞選項

旗標預設值說明
--hook-url <url>(無)OpenClaw Webhook URL。
--hook-token <token>(無)OpenClaw Webhook token。
--push-token <token>(無)轉送給 gog watch serve 的 push token。

gog watch serve 選項

旗標預設值說明
--bind <host>127.0.0.1gog watch serve 綁定主機。
--port <port>8788gog watch serve 連接埠。
--path <path>/gmail-pubsubgog watch serve 路徑。
--include-bodytrue包含電子郵件本文片段。傳入 --no-include-body 可停用。
--max-bytes <n>20000每個本文片段的最大位元組數。
--renew-minutes <n>720(12 小時)每 N 分鐘續期 Gmail watch。

Tailscale 暴露

旗標預設值說明
--tailscale <mode>funnel透過 tailscale 暴露 push endpoint:funnelserveoff
--tailscale-path <path>(無)tailscale serve/funnel 的路徑。
--tailscale-target <t>(無)Tailscale serve/funnel 目標(連接埠、host:port 或 URL)。

輸出

旗標說明
--json列印機器可讀摘要,而不是文字。

webhooks gmail run

在前景執行 gog watch serve 加上 watch 自動續期迴圈。
openclaw webhooks gmail run --account you@example.com
run 接受與 setup 相同的 gog watch serve、OpenClaw 傳遞、Pub/Sub 和 Tailscale 旗標,但下列除外:
  • --accountrun 上是選用(會回退到已設定的帳戶)。
  • run 接受 --project--push-endpoint--json
  • run 旗標沒有內建預設值;缺少的值會回退到 setup 寫入的值。
分類旗標
Pub/Sub--account--topic--subscription--label
OpenClaw 傳遞--hook-url--hook-token--push-token
gog watch serve--bind--port--path--include-body--max-bytes--renew-minutes
Tailscale--tailscale--tailscale-path--tailscale-target
對於 run--topic 值是完整的 Pub/Sub topic 路徑(projects/.../topics/...),而不只是簡短的 topic 名稱。

端對端流程

請參閱 Gmail Pub/Sub 整合,了解與這些 CLI 命令搭配使用的 GCP 專案、OAuth 和 Gateway 端設定。

相關