Flarelink
v0.1.1Build on the Flarelink stack — Cloudflare auth, D1, and R2 — from your AI coding tools.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
flarelink_stack_overview Flarelink stack overview
Read this first. The Flarelink stack (Cloudflare auth via better-auth + KV sessions, D1, R2), its cardinal rules, and the two deployment shapes. Call before building auth/database/file features on Cloudflare.
flarelink_scaffold Scaffold a Flarelink-stack app
How to bootstrap a complete, working Flarelink-stack app (auth + D1 + R2): clone command, one-click deploy, file map, and where to add features.
flarelink_list_patterns List Flarelink code patterns
List the available canonical code patterns (keys + what each is for). Use flarelink_get_pattern to fetch one.
flarelink_get_pattern Get a Flarelink code pattern
Return the canonical, copy-pasteable code for one Flarelink-stack recipe (auth setup, route guards, identifier-safe D1 queries, R2 uploads/presigning, wrangler bindings, SDK usage). Prefer these over inventing your own — they encode the security + cost rules.
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Which pattern to fetch. Use flarelink_list_patterns to see the options. |
flarelink_sdk_reference @flarelink/client SDK reference
Signatures and return shapes for the @flarelink/client SDK (auth / storage / db). Use when the app talks to a hosted Flarelink auth Worker rather than embedding better-auth.
| Parameter | Type | Description |
|---|---|---|
surface | string | Which surface to return. Defaults to all. |
flarelink_cost_patterns Cloudflare cost-optimization patterns
Design guidance (not a live usage meter) for keeping a Cloudflare bill near zero. Optionally describe the feature you are building to get targeted hints first.
| Parameter | Type | Description |
|---|---|---|
feature | string | Optional: describe the feature/data shape (e.g. "user avatar uploads") for targeted hints. |
flarelink_whoami Flarelink — who am I
Verify the FLARELINK_API_KEY and show the signed-in user plus the active Cloudflare connection and project. Call this first to confirm management tools are wired up.
flarelink_list_projects Flarelink — list projects
List the Flarelink projects on the active Cloudflare connection.
flarelink_list_databases Flarelink — list D1 databases
List the D1 databases attached to the active Flarelink project (id, name, whether it hosts the auth module).
flarelink_query_database Flarelink — query a D1 database
Run a SQL statement against one of the project's D1 databases via Flarelink. Use bound parameters (? placeholders + params) — never concatenate user input. Returns rows + query meta (duration, rows_read/written). This runs with full database access; prefer SELECT unless you intend to write.
| Parameter | Type | Description |
|---|---|---|
databaseId * | string | D1 database id (uuid) — from flarelink_list_databases. |
sql * | string | SQL with ? placeholders for any values. |
params | array | Values bound to the ? placeholders, in order. |
flarelink_list_buckets Flarelink — list R2 buckets
List the R2 buckets attached to the active Flarelink project.