Cloudflare コマンド
local/remote を取り違えないための build、migration、dry-run、preflight
| 目的 | 実行するコマンド | remote への作用 |
|---|---|---|
| local D1 migration | pnpm --filter @vector-image-detection/demo run db:migrate:local | なし |
| docs 構文/リンク | pnpm --filter @vector-image-detection/docs run check | なし |
| docs build | pnpm --filter @vector-image-detection/docs run build | なし |
| local credited seed import | pnpm run demo:seed:local | なし(local D1/R2 test resources) |
| placeholder deploy dry-run | pnpm --filter @vector-image-detection/demo run deploy:dry-run:production | なし |
| production config の render | pnpm --filter @vector-image-detection/demo run render:production | なし(生成 file のみ) |
| remote D1 migration | render の直後に pnpm - | 指定 D1 のみ |
| authenticated release gate | pnpm run cloudflare:demo-preflight | readiness GET のみ |
| rendered demo deployment | GitHub Actions の deploy-demo job のみ | 指定 production Worker |
rendered demo deployment に手元用の script はありません。実 deploy は deploy-demo job が wrangler deploy --config .wrangler.production.generated.json --secrets-file <RUNNER_TEMP の file> として実行します。secrets file なしで deploy すると access gate secret を持たない Worker になり、production では serve を拒否するため、この経路は CI に限定しています。
remote D1 migration は必ず render 後の .wrangler.production.generated.json に対して実行します。committed の wrangler.production.jsonc を直接 --config に渡してはいけません — placeholder の database_id(00000000-0000-0000-0000-000000000000)が非空なので、wrangler の D1 lookup(getDatabaseByNameOrBinding/hasUuid)は account への名前解決を一切せずこの placeholder UUID をそのまま使い、--remote を付けても実 account の DB には届かず失敗します。詳しい手順(render に必要な 10 個の env var を含む)は operator runbook を参照してください。
--remote を含む D1 command と明示した resource name は実 account に作用します。production name を shell history、issue、docs、source にハードコードしません。wrangler vectorize create <name> --dimensions=768 --metric=cosine の metric/dimension は作成後に変更できないため、モデルの 768-dimensional embedding と一致することを先に確認してください。
cloudflare:demo-preflight は DEMO_PREFLIGHT_URL、DEMO_PREFLIGHT_TOKEN、3 acknowledgement variables を必要とします。ready response は configuration、D1、migrations、R2、Queue、DLQ、Workers AI、Vectorize、rate limit、operator acknowledgements をすべて pass と報告する必要があります。
pnpm run demo:seed:local は 100 credited thumbnails を deterministic local D1/R2/outbox import に通し、ready/attribution と unchanged rerun を確認します。node apps/ は validation/report 専用で Cloudflare に書き込みません。--remote に --target がなければ失敗し、remote を暗黙選択しません。local seed command は remote target を明示的に拒否します。remote seed は provision 後の authenticated operator action として deferred です。
offline CLI の正確な options は pnpm vis <command> --help を正本とします。vis の command は hosted release workflow ではありません。