|
| 1 | +--- |
| 2 | +name: flare-edge-cli |
| 3 | +description: Use this skill when the task is to scaffold, validate, build, develop, deploy, inspect, operate, or tear down Go-based Cloudflare Workers with flare-edge-cli. Trigger on requests about Cloudflare edge functions, Go/Wasm Workers, Workers AI in Go, or cleanup of ephemeral Cloudflare resources created through flare-edge-cli. |
| 4 | +license: MIT |
| 5 | +metadata: |
| 6 | + author: Gladium AI |
| 7 | + version: 1.0.0 |
| 8 | + category: developer-tools |
| 9 | + tags: |
| 10 | + - cloudflare |
| 11 | + - workers |
| 12 | + - golang |
| 13 | + - wasm |
| 14 | + - workers-ai |
| 15 | + - deployment |
| 16 | +--- |
| 17 | + |
| 18 | +# Flare Edge CLI |
| 19 | + |
| 20 | +Use this skill to operate `flare-edge-cli` safely and consistently. |
| 21 | + |
| 22 | +## Use This Skill For |
| 23 | + |
| 24 | +- Creating a new Go-based Cloudflare Worker project |
| 25 | +- Validating Go-for-Wasm compatibility before build or deploy |
| 26 | +- Building and running local dev flows for Workers |
| 27 | +- Deploying or operating KV, D1, R2, routes, secrets, releases, and logs |
| 28 | +- Creating or testing Go-based Workers AI projects |
| 29 | +- Tearing down disposable Workers and attached side effects |
| 30 | + |
| 31 | +## Core Rules |
| 32 | + |
| 33 | +- Prefer `flare-edge-cli` over raw `wrangler` when the task fits the CLI surface. |
| 34 | +- Prefer `--json` output when another agent or program will consume the result. |
| 35 | +- Keep project work scoped to an explicit `--path` when you are not already inside the generated project directory. |
| 36 | +- Do not run `auth logout --all` unless the user explicitly asks to clear Cloudflare auth. |
| 37 | +- For disposable test environments, finish with `flare-edge-cli teardown` so remote side effects are removed. |
| 38 | +- If a task involves real Cloudflare AI usage, note that local dev still uses remote Workers AI and may incur charges. |
| 39 | + |
| 40 | +## Quick Workflow |
| 41 | + |
| 42 | +1. Verify prerequisites. |
| 43 | +2. Initialize or inspect the project. |
| 44 | +3. Run compatibility and build checks. |
| 45 | +4. Use `dev` for local validation. |
| 46 | +5. Use `deploy` for live rollout. |
| 47 | +6. Use service-specific commands for KV, D1, R2, secrets, routes, logs, and releases. |
| 48 | +7. Use `teardown` for cleanup when the environment is temporary. |
| 49 | + |
| 50 | +## Prerequisites |
| 51 | + |
| 52 | +- `flare-edge-cli` available on `PATH`, or use the repo-local binary/build path. |
| 53 | +- Go installed. |
| 54 | +- Wrangler installed. |
| 55 | +- Cloudflare auth already configured. |
| 56 | + |
| 57 | +For the latest install flow and release-binary behavior, see [references/install-and-release.md](references/install-and-release.md). |
| 58 | + |
| 59 | +## Standard Command Path |
| 60 | + |
| 61 | +For a standard Worker: |
| 62 | + |
| 63 | +```bash |
| 64 | +flare-edge-cli doctor --json |
| 65 | +flare-edge-cli project init my-worker --template edge-http |
| 66 | +flare-edge-cli compat check --path ./my-worker --json |
| 67 | +flare-edge-cli build --path ./my-worker --json |
| 68 | +flare-edge-cli dev --path ./my-worker --local |
| 69 | +flare-edge-cli deploy --path ./my-worker --json |
| 70 | +``` |
| 71 | + |
| 72 | +For an AI Worker: |
| 73 | + |
| 74 | +```bash |
| 75 | +flare-edge-cli project init my-ai-worker --template ai-chat |
| 76 | +flare-edge-cli build --path ./my-ai-worker --json |
| 77 | +flare-edge-cli dev --path ./my-ai-worker --local |
| 78 | +flare-edge-cli deploy --path ./my-ai-worker --json |
| 79 | +``` |
| 80 | + |
| 81 | +Load [references/ai-workers.md](references/ai-workers.md) when the task is about AI templates, current model defaults, or how to test Workers AI locally. |
| 82 | + |
| 83 | +## Cleanup |
| 84 | + |
| 85 | +If you create temporary infrastructure or disposable test projects, tear them down explicitly: |
| 86 | + |
| 87 | +```bash |
| 88 | +flare-edge-cli teardown --path ./my-worker --json |
| 89 | +``` |
| 90 | + |
| 91 | +Use `--keep-bindings` only when the user wants to preserve KV, D1, or R2 resources. |
| 92 | + |
| 93 | +## Troubleshooting |
| 94 | + |
| 95 | +- Start with `flare-edge-cli doctor`. |
| 96 | +- If deployment succeeds but the Worker fails at runtime, use `flare-edge-cli logs tail`. |
| 97 | +- If a command mutates Cloudflare resources, verify whether the target project path and Worker name are correct before rerunning it. |
| 98 | +- If a project mixes manual Wrangler edits with CLI-managed config, inspect both `flare-edge.json` and `wrangler.jsonc`. |
| 99 | + |
| 100 | +For common command sequences and operational guidance, read [references/workflows.md](references/workflows.md). |
0 commit comments