fimo 0.15.0-staging.1 → 0.15.0-staging.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +1 -0
  2. package/assets/content-templates/forms/framework.eta +90 -0
  3. package/assets/content-templates/forms/react.eta +42 -21
  4. package/assets/skills/fimo/SKILL.md +11 -4
  5. package/assets/skills/fimo-cli/SKILL.md +28 -27
  6. package/assets/skills/fimo-cli/references/account.md +0 -2
  7. package/assets/skills/fimo-cli/references/agent-setup.md +7 -9
  8. package/assets/skills/fimo-cli/references/agents.md +0 -2
  9. package/assets/skills/fimo-cli/references/analytics.md +0 -2
  10. package/assets/skills/fimo-cli/references/assets.md +2 -4
  11. package/assets/skills/fimo-cli/references/branches.md +0 -2
  12. package/assets/skills/fimo-cli/references/content.md +9 -11
  13. package/assets/skills/fimo-cli/references/credits.md +0 -2
  14. package/assets/skills/fimo-cli/references/deploy.md +2 -4
  15. package/assets/skills/fimo-cli/references/describe.md +0 -2
  16. package/assets/skills/fimo-cli/references/domains.md +0 -2
  17. package/assets/skills/fimo-cli/references/forms.md +7 -9
  18. package/assets/skills/fimo-cli/references/history.md +0 -2
  19. package/assets/skills/fimo-cli/references/init.md +35 -25
  20. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +0 -2
  21. package/assets/skills/fimo-cli/references/integrations.md +0 -2
  22. package/assets/skills/fimo-cli/references/invite.md +0 -2
  23. package/assets/skills/fimo-cli/references/labels.md +3 -5
  24. package/assets/skills/fimo-cli/references/locales.md +2 -4
  25. package/assets/skills/fimo-cli/references/mcp.md +2 -4
  26. package/assets/skills/fimo-cli/references/media.md +0 -2
  27. package/assets/skills/fimo-cli/references/preview.md +0 -2
  28. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +0 -2
  29. package/assets/skills/fimo-cli/references/projects.md +2 -4
  30. package/assets/skills/fimo-cli/references/schedules.md +0 -2
  31. package/assets/skills/fimo-cli/references/support.md +0 -2
  32. package/assets/skills/fimo-cli/references/webhooks.md +0 -2
  33. package/assets/skills/fimo-code/references/forms.md +24 -10
  34. package/assets/skills/fimo-code/references/frameworks/astro.md +9 -0
  35. package/assets/skills/fimo-code/references/frameworks/next.md +25 -0
  36. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +33 -5
  37. package/assets/skills/fimo-code/references/labels.md +1 -1
  38. package/assets/skills/fimo-migration/SKILL.md +99 -146
  39. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +26 -0
  40. package/assets/skills/fimo-migration/references/inventory/coordinator.md +40 -0
  41. package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +39 -0
  42. package/assets/skills/fimo-migration/references/inventory/locales.md +41 -0
  43. package/assets/skills/fimo-migration/references/workflow.md +3 -2
  44. package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +459 -0
  45. package/assets/skills/fimo-studio/SKILL.md +1 -1
  46. package/assets/skills/fimo-studio/references/project-creation.md +10 -18
  47. package/dist/build/astro/config.js +20 -1
  48. package/dist/build/sveltekit/config.d.ts +2 -1
  49. package/dist/build/sveltekit/config.js +15 -5
  50. package/dist/build/sveltekit/files/edge.js +68 -0
  51. package/dist/build/sveltekit/files/serverless.js +42 -0
  52. package/dist/cli/bundle.json +1 -1
  53. package/dist/cli/index.js +78 -72
  54. package/dist/runtime/astro/server.d.ts +2 -0
  55. package/dist/runtime/astro/server.js +2 -0
  56. package/dist/runtime/forms/client.d.ts +13 -0
  57. package/dist/runtime/forms/client.js +83 -0
  58. package/dist/runtime/forms/index.d.ts +2 -0
  59. package/dist/runtime/forms/index.js +1 -0
  60. package/dist/runtime/index.d.ts +2 -0
  61. package/dist/runtime/index.js +4 -0
  62. package/dist/runtime/next/client.d.ts +2 -0
  63. package/dist/runtime/next/client.js +2 -0
  64. package/dist/runtime/next/server.d.ts +2 -0
  65. package/dist/runtime/next/server.js +2 -0
  66. package/dist/runtime/react-router/index.d.ts +1 -0
  67. package/dist/runtime/react-router/index.js +1 -0
  68. package/dist/runtime/sveltekit/forms.d.ts +15 -0
  69. package/dist/runtime/sveltekit/forms.js +15 -0
  70. package/dist/runtime/sveltekit/index.d.ts +2 -0
  71. package/dist/runtime/sveltekit/index.js +1 -0
  72. package/dist/runtime/sveltekit/labels.d.ts +7 -3
  73. package/dist/runtime/sveltekit/labels.js +1 -1
  74. package/dist/runtime/sveltekit/runtime.d.ts +2 -1
  75. package/dist/runtime/sveltekit/runtime.js +8 -2
  76. package/dist/runtime/templates.d.ts +1 -1
  77. package/dist/runtime/templates.js +1 -1
  78. package/dist/scripts/sync-forms.d.ts +1 -0
  79. package/dist/scripts/sync-forms.js +78 -26
  80. package/package.json +10 -4
  81. package/templates/astro/.fimo/config.json +21 -0
  82. package/templates/astro/AGENTS.md +37 -0
  83. package/templates/astro/CLAUDE.md +5 -0
  84. package/templates/astro/_gitignore +15 -0
  85. package/templates/astro/astro.config.mjs +7 -0
  86. package/templates/astro/package.json +22 -0
  87. package/templates/astro/pnpm-workspace.yaml +7 -0
  88. package/templates/astro/src/components/ProjectOverview.astro +42 -0
  89. package/templates/astro/src/env.d.ts +1 -0
  90. package/templates/astro/src/layouts/Base.astro +81 -0
  91. package/templates/astro/src/pages/index.astro +10 -0
  92. package/templates/astro/src/pages/projects/[slug].astro +26 -0
  93. package/templates/astro/src/pages/projects/index.astro +10 -0
  94. package/templates/astro/src/schemas/Project.json +9 -0
  95. package/templates/astro/src/schemas/Project.ts +29 -0
  96. package/templates/astro/src/schemas/Project.types.ts +70 -0
  97. package/templates/astro/src/schemas/SiteSettings.json +10 -0
  98. package/templates/astro/src/schemas/SiteSettings.ts +31 -0
  99. package/templates/astro/src/schemas/SiteSettings.types.ts +69 -0
  100. package/templates/astro/tsconfig.json +5 -0
  101. package/templates/nextjs/AGENTS.md +10 -5
  102. package/templates/react-router/AGENTS.md +4 -3
  103. package/templates/react-router/package.json +1 -1
  104. package/templates/sveltekit/AGENTS.md +24 -4
  105. package/templates/sveltekit/src/routes/+layout.server.ts +1 -2
@@ -1,7 +1,5 @@
1
1
  # Domains
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  `fimo domains` is the surface for everything URL-related on a project. Three resources live here, and they're easy to confuse — keep them straight:
6
4
 
7
5
  | Resource | What it is | Plan | Per project | Source of truth |
@@ -1,19 +1,17 @@
1
1
  # Forms workflow
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
- > Package contract: run `npx fimo@latest skills get fimo-code --ref forms` for the JSON spec, generated Zod schema, submit helper, and application usage.
3
+ > Package contract: run `fimo skills get fimo-code --ref forms` for the JSON spec, generated Zod schema, submit helper, and application usage.
6
4
 
7
5
  This file covers the **CLI workflow** for forms. Use it when the user wants to add a contact form, signup, feedback form, etc.
8
6
 
9
7
  ## Flow
10
8
 
11
- 1. Write `src/forms/{name}.json` — kebab-case filename (e.g. `contact-us.json`). For the JSON spec and field types, run `npx fimo@latest skills get fimo-code --ref forms`.
9
+ 1. Write `src/forms/{name}.json` — kebab-case filename (e.g. `contact-us.json`). For the JSON spec and field types, run `fimo skills get fimo-code --ref forms`.
12
10
  2. Register with `fimo forms push {name}` — creates the form, obtains its `id`, patches it back into the JSON file.
13
- 3. Pre-build generates `src/forms/{name}.ts` (Zod schema + `submitX` helper). Use the same `fimo-code` reference for the generated API.
11
+ 3. Validation/build generates `src/forms/{name}.ts` (Zod schema, `parseXFormData`, and `submitX` helper). Next.js also gets `{name}.client.ts`; other adapters keep one module. Use the same `fimo-code` reference for the generated API.
14
12
  4. Write the application form using the generated `@/forms/{name}` module and the existing framework conventions.
15
13
 
16
- Steps 1, 3, and 4 reference the `fimo-code` skill (`npx fimo@latest skills get fimo-code`). Step 2 is the CLI command.
14
+ Steps 1, 3, and 4 reference the `fimo-code` skill (`fimo skills get fimo-code`). Step 2 is the CLI command.
17
15
 
18
16
  ## CLI commands
19
17
 
@@ -45,18 +43,18 @@ Use this when the user asks "who filled out the contact form?", "how many signup
45
43
 
46
44
  ## "Add a contact form" recipe
47
45
 
48
- 1. Run `npx fimo@latest skills get fimo-code --ref forms` for the JSON spec.
46
+ 1. Run `fimo skills get fimo-code --ref forms` for the JSON spec.
49
47
  2. Write `src/forms/contact-us.json` with the required fields.
50
48
  3. Run `fimo forms push contact-us` — the `id` is patched back into the JSON automatically.
51
49
  4. Use the same `fimo-code` forms reference for the generated `submitContactUs` + `ContactUsSchema` API.
52
- 5. Run `npx fimo@latest skills get fimo-code --ref labels` and load the detected framework reference for form labels.
50
+ 5. Run `fimo skills get fimo-code --ref labels` and load the detected framework reference for form labels.
53
51
  6. Write the application form using the generated `@/forms/contact-us` module.
54
52
 
55
53
  **Register BEFORE writing app code that depends on the form** — otherwise the generated `.ts` doesn't exist and the runtime fetch 404s.
56
54
 
57
55
  ## When to run sync manually
58
56
 
59
- The `fimo/vite` plugin regenerates `src/forms/*.ts` after form JSON changes during development. Before a production build, regenerate explicitly with:
57
+ The `fimo/vite` plugin regenerates legacy Vite `src/forms/*.ts` after form JSON changes during development. Framework-aware generation runs during validation. Before a production build, regenerate explicitly with:
60
58
 
61
59
  ```bash
62
60
  fimo validate # runs all phases: codegen, lint, route validation, label checks
@@ -1,7 +1,5 @@
1
1
  # Project History
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  History is scoped to the selected project environment. A restore point records the environment's CMS content and the matching Git commit so code and content can be recovered together.
6
4
 
7
5
  Fimo also creates restore points automatically after a successful deploy, on the destination of a completed environment merge, and after direct content editing has been quiet for 30 seconds. Rapid Studio auto-saves are grouped into one content point.
@@ -1,7 +1,5 @@
1
1
  # `fimo init`
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  One-stop project setup: sign in, create a new Fimo project (or link an existing one), install dependencies, and optionally set up Fimo skills for your AI tools.
6
4
 
7
5
  ## Command
@@ -13,17 +11,17 @@ fimo init [dir] [options]
13
11
  `fimo init` runs the full onboarding in one shot:
14
12
 
15
13
  1. **Signs in automatically** — if there's no session it opens the browser loopback login. In `--json` / non-TTY with no session it fails with `NOT_AUTHENTICATED` (run `fimo login` first).
16
- 2. **Resolves the project** — with `--project-id <id>` it links an EXISTING project (clones it); without it, it creates a NEW project. An interactive TTY shows a "Create new / Link existing" picker; non-interactive shells default to create-new. New projects use React Router by default; `--framework nextjs` and `--framework sveltekit` select minimal framework-native shells. An optional `--starter fimo-site@1` adds a React-Router content starter only to a newly created project.
14
+ 2. **Resolves the project** — with `--project-id <id>` it sets up the named Fimo project: a project with no code yet is scaffolded as a fresh site, while an existing repository is cloned. Without it, `init` creates a NEW project. An interactive TTY shows a "Create new / Link existing" picker; non-interactive shells default to create-new. New projects use React Router by default; `--framework astro`, `--framework nextjs`, and `--framework sveltekit` select minimal framework-native shells. An optional `--starter fimo-site@1` adds a content-led starter only to a newly created project without `--project-id`.
17
15
  3. **Installs dependencies** — prompts for the package manager, or honor `--package-manager <pm>` / `--no-install`.
18
16
  4. **Optionally sets up Fimo skills** — confirm prompt, or `--skills` / `--no-skills`.
19
17
 
20
18
  | Flag | Required | Purpose |
21
19
  | ---------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22
20
  | `[dir]` positional | yes in non-TTY for create-new | Target directory (e.g. `my-site`) |
23
- | `--project-id <id>` | no | Link an EXISTING project instead of creating one (clones it). |
21
+ | `--project-id <id>` | no | Set up the named Fimo project: scaffold and push a fresh site when it has no code yet, otherwise clone it. |
24
22
  | `--org <id>` | no | Target organization **id** when creating (use the `ID` column from `fimo orgs list`, NOT the slug). Picker shown interactively if omitted and TTY. |
25
23
  | `--env <name>` | no | Env to check out when linking an existing project (defaults to `main`). |
26
- | `--framework <framework>` | no | New-project scaffold: `react-router` (default), `nextjs` (App Router), or `sveltekit`. Existing repositories are preserved. |
24
+ | `--framework <framework>` | no | New-project scaffold: `react-router` (default), `astro`, `nextjs` (App Router), or `sveltekit`. Existing repositories are preserved. |
27
25
  | `--starter <id>` | no | Opt-in project starter for create-new (currently `fimo-site@1`). It seeds CMS content, labels, a contact form, and manual-only agents. Rejects `--project-id`. |
28
26
  | `--package-manager <pm>` | no | `npm` \| `pnpm` \| `yarn` \| `bun`. |
29
27
  | `--install` / `--no-install` | yes in non-TTY | Install deps after checkout (or skip it). |
@@ -42,7 +40,7 @@ caller one stable result envelope; `--yes` is useful when running in a TTY but
42
40
  is not required in a pipe or CI shell. The starter is never selected by default.
43
41
 
44
42
  ```bash
45
- npx fimo@latest --json init my-site \
43
+ fimo --json init my-site \
46
44
  --starter fimo-site@1 \
47
45
  --org <organizationId> \
48
46
  --no-install \
@@ -59,7 +57,7 @@ singleton, `contact` form, and labels in `main`, writes the form id into
59
57
  writing anything. If dependencies were skipped, install them and run
60
58
  `fimo validate` before starting the app so generated clients are present.
61
59
 
62
- > **Zero-install:** run `npx fimo@latest init` — no global install needed. `fimo projects create` is also an alias of `fimo init` (create-new path).
60
+ > **Zero-install:** the selected `fimo init` invocation needs no global install. `fimo projects create` is also an alias of `fimo init` (create-new path).
63
61
 
64
62
  ### Choose the application framework
65
63
 
@@ -67,27 +65,29 @@ Omit `--framework` for the existing React Router scaffold, or select a
67
65
  minimal framework-native shell explicitly:
68
66
 
69
67
  ```bash
70
- npx fimo@latest init my-next-site --framework nextjs --org <organizationId>
71
- npx fimo@latest init my-svelte-site --framework sveltekit --org <organizationId>
68
+ fimo init my-astro-site --framework astro --org <organizationId>
69
+ fimo init my-next-site --framework nextjs --org <organizationId>
70
+ fimo init my-svelte-site --framework sveltekit --org <organizationId>
72
71
  ```
73
72
 
74
- Both shells include their framework adapter, hosted-preview connector, and
75
- `.fimo/config.json#runtime.framework`. They intentionally contain no schema,
76
- labels, or designed website. After init, load the project rules and `fimo-code`
77
- to build the requested site. The current `fimo-site@1` content starter supports
78
- React Router only.
73
+ Each shell includes its framework adapter, hosted-preview connector, and
74
+ `.fimo/config.json#runtime.framework`. The Astro shell also includes a minimal
75
+ content-backed example with static, on-demand, and dynamic routes plus an English default locale;
76
+ the other shells intentionally contain no schema, labels, or designed website.
77
+ After init, load the project rules and `fimo-code` to build the requested site.
78
+ The current `fimo-site@1` content starter supports React Router only.
79
79
 
80
80
  For `--agents`, pass the AI tool you're running in: `--agents=claude-code` for Claude Code, `--agents=cursor` for Cursor, `--agents=codex` for Codex, etc. When the flag is omitted, env-var detection of the invoking harness (e.g. `CLAUDECODE` / `CLAUDE_CODE_ENTRYPOINT` → claude-code) auto-targets that agent; other agents must be selected explicitly via `--agents`/`-a` or the interactive picker.
81
81
 
82
- ## Linking an existing project
82
+ ## Setting up a project by ID
83
83
 
84
- Pass `--project-id <id>` to link an EXISTING project instead of creating one. This clones the project's git repo into `[dir]` and writes the local `.fimo/project.json`, the same as `fimo clone` (init's `--project-id` path reuses it). Use `--env <name>` to check out a specific env (defaults to `main`). Without `--project-id`, `fimo init` creates a new project.
84
+ Pass `--project-id <id>` to set up a known Fimo project. If the project has no code yet — for example, one just created in Fimo Studio — `init` scaffolds a fresh site into it and pushes the initial commit: the same create-new path, linked to the existing ID. If the project already has code, `init` clones it into `[dir]`, like `fimo clone`. Use `--env <name>` to check out a specific env (defaults to `main`). Without `--project-id`, `fimo init` creates a new project.
85
85
 
86
- ## What gets written (create-new)
86
+ ## What gets written (create-new path)
87
87
 
88
88
  `fimo init` (create-new path) scaffolds:
89
89
 
90
- - The selected project shell: React Router by default, Next.js App Router with `--framework nextjs`, or SvelteKit with `--framework sveltekit`
90
+ - The selected project shell: React Router by default, Astro with `--framework astro`, Next.js App Router with `--framework nextjs`, or SvelteKit with `--framework sveltekit`
91
91
  - `.fimo/project.json` — links this directory to the remote project (read-only after creation)
92
92
  - `.fimo/config.json` — project, route, locale, SEO, and agent policy
93
93
  - `.fimo/agents/` — versioned agent bundles
@@ -118,15 +118,13 @@ cd my-site
118
118
  fimo rename "Acme Coffee"
119
119
  ```
120
120
 
121
- **Then start the local dev loop and ask the developer what they want to build.** Run the app with the project's package-manager `dev` script — `pnpm dev`, `npm run dev`, `yarn dev`, or `bun dev` (match the lockfile) — in the background; it serves the site on localhost with live reload. Edit, show, iterate. You do not need to deploy to see local changes.
121
+ **Then start the local dev loop.** Run the app with the project's package-manager `dev` script — `pnpm dev`, `npm run dev`, `yarn dev`, or `bun dev` (match the lockfile) — in the background; it serves the site on localhost with live reload. Edit, show, iterate. You do not need to deploy to see local changes. If the initiating request did not say what to build, ask the developer — after the first preview below, never as a blocker before initializing.
122
122
 
123
123
  ```bash
124
124
  pnpm dev & # or npm run dev / yarn dev / bun dev — the project's package manager
125
125
  ```
126
126
 
127
- When a unit of work looks done, **offer** to deploy (`fimo deploy` for a hosted preview / shareable link, `fimo deploy --publish` to go live) and run it only after the developer confirms.
128
-
129
- **Optional — warm the sandbox early:** only if you already know a deploy is coming, kick off a background `fimo deploy -m "chore: init" &` so the one-time ~15-30s sandbox provision + dep install happens while you work. This is a perf optimization, not a required step — skip it while you're just iterating locally. See `references/deploy.md` § Warm the sandbox early in a session.
127
+ Outside the first-preview path below, when a unit of work looks done, **offer** to deploy (`fimo deploy` for a hosted preview / shareable link, `fimo deploy --publish` to go live) and run it only after the developer confirms.
130
128
 
131
129
  ## Load the project context
132
130
 
@@ -136,12 +134,24 @@ After `fimo init` completes, the project root has `AGENTS.md` (universal) and `C
136
134
 
137
135
  1. `cd <project-dir>` — switch into the new project.
138
136
  2. `Read` the project rules file: `AGENTS.md` (or `CLAUDE.md` if you're Claude Code).
139
- 3. Run `npx fimo@latest describe --json` and read the detected framework, schemas, locales, and tree.
140
- 4. Load the code skill on demand: `npx fimo@latest skills get fimo-code`.
141
- 5. Follow its decision tree and load only the task reference plus the detected framework reference. For Next.js, start with `npx fimo@latest skills get fimo-code --ref frameworks/next`, then load App Router, Pages Router, or locales only when the project shape requires it. For SvelteKit, start with `npx fimo@latest skills get fimo-code --ref frameworks/sveltekit`. For Astro, `--ref frameworks/astro` is the single framework reference.
137
+ 3. Run `fimo describe --json` with the current invocation prefix and read the detected framework, schemas, locales, and tree.
138
+ 4. Load the code skill on demand with the same prefix: `fimo skills get fimo-code`.
139
+ 5. Follow its decision tree and load only the task reference plus the detected framework reference. For Next.js, start with `fimo skills get fimo-code --ref frameworks/next`, then load App Router, Pages Router, or locales only when the project shape requires it. For SvelteKit, start with `fimo skills get fimo-code --ref frameworks/sveltekit`. For Astro, `fimo skills get fimo-code --ref frameworks/astro` is the single framework reference.
142
140
 
143
141
  Do not batch-load every reference. Progressive disclosure keeps unrelated framework and product guidance out of the coding context.
144
142
 
143
+ ### Create the first hosted preview (create-new path)
144
+
145
+ Whenever `fimo init` created or scaffolded a new project — including a Studio-supplied `--project-id`, since Studio creates the project before any code exists — finish onboarding with exactly one plain preview deploy after init and context loading succeed, unless the user explicitly said not to deploy:
146
+
147
+ ```bash
148
+ fimo deploy -m "chore: first preview" --json
149
+ ```
150
+
151
+ `-m` is required because you run non-interactively; the deploy validates, commits pending changes, pushes, and syncs the hosted preview. It is also the sandbox warm-up — never run a separate warm-up deploy on this path. Read `data.preview_url` and `data.dashboard_url` from the envelope and return both links. If the initiating request described a concrete site, build a minimal meaningful first screen before this single deploy; otherwise deploy the scaffolded site as-is and then ask what to build.
152
+
153
+ This first deploy creates a preview only — never add `--publish`, and treat every later deploy as offer-then-confirm. The rule does not apply when `init` cloned a project with existing code or when the work is a migration; those paths keep their normal deployment approval rules.
154
+
145
155
  ## Adding another AI tool to an existing project later
146
156
 
147
157
  If a teammate joins on a different AI tool (e.g. Cursor) after the project was scaffolded for claude-code only:
@@ -1,7 +1,5 @@
1
1
  # Firecrawl Integration
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  Use Firecrawl when an agent needs to research or inspect public websites: direct web answers, landing-page research, competitor structure analysis, migration prep, link extraction, and factual page snapshots. Do not use Firecrawl for private URLs, logged-in websites, or content the user has not asked you to fetch.
6
4
 
7
5
  Current execution support is `search`, `scrape`, `map`, `crawl`, and `monitor.*`.
@@ -1,7 +1,5 @@
1
1
  # Integrations
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  Use integrations to enable external services for a Fimo project. API keys are stored by Fimo and never printed back to the CLI. Teammates and agents receive access to the integration, not the underlying token.
6
4
 
7
5
  ## Inspect
@@ -1,7 +1,5 @@
1
1
  # Invite users
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  Invite collaborators to your Fimo organization or project. After deploying a website for the first time, suggest inviting team members so they can contribute.
6
4
 
7
5
  ## When to suggest inviting users
@@ -1,8 +1,6 @@
1
1
  # Labels workflow
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
- > Package contract: run `npx fimo@latest skills get fimo-code --ref labels` for the `t()` contract and key rules, then load the detected framework reference for its label readers.
3
+ > Package contract: run `fimo skills get fimo-code --ref labels` for the `t()` contract and key rules, then load the detected framework reference for its label readers.
6
4
  > For locale configuration and route-prefix validation, see **`references/locales.md`**.
7
5
 
8
6
  This file covers the **CLI workflow** for labels: static UI copy such as nav items, buttons, headings, placeholders, alt text, and SEO strings.
@@ -61,9 +59,9 @@ Prefer `fimo validate` — this primitive is for narrow debugging/test use.
61
59
 
62
60
  ## Workflow
63
61
 
64
- 1. Declare literal label keys using the API documented for the detected framework. Run `npx fimo@latest skills get fimo-code --ref labels` before writing them.
62
+ 1. Declare literal label keys using the API documented for the detected framework. Run `fimo skills get fimo-code --ref labels` before writing them.
65
63
  2. Run `fimo validate`.
66
64
  3. Add missing values with `fimo labels set` or `fimo labels set-many`.
67
65
  4. Editors can now change copy in the Fimo admin without code changes.
68
66
 
69
- For helper signatures and code patterns, run `npx fimo@latest skills get fimo-code --ref labels` before writing code that uses `t()`.
67
+ For helper signatures and code patterns, run `fimo skills get fimo-code --ref labels` before writing code that uses `t()`.
@@ -1,8 +1,6 @@
1
1
  # Locales Workflow
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
- This file covers CLI-side locale configuration and validation. For code integration, run `npx fimo@latest skills get fimo-code --ref locales` plus the detected framework's locale reference.
3
+ This file covers CLI-side locale configuration and validation. For code integration, run `fimo skills get fimo-code --ref locales` plus the detected framework's locale reference.
6
4
 
7
5
  ## Configure Locales
8
6
 
@@ -88,7 +86,7 @@ For every framework, the application owns its URL scheme and passes the resolved
88
86
 
89
87
  Inspect the existing locale provider, route table, switcher, redirects, and public URLs before editing configuration. Preserve working URL behavior during the migration.
90
88
 
91
- Preserve the existing locale provider, router, switcher, redirects, and public URLs. Use framework helpers only when they fit that architecture. Next.js projects run `npx fimo@latest skills get fimo-code --ref frameworks/next/locales`; React Router projects load the React Router setup reference; Astro projects run `npx fimo@latest skills get fimo-code --ref frameworks/astro` and pass the page-resolved locale into server reads and `getLabels`.
89
+ Preserve the existing locale provider, router, switcher, redirects, and public URLs. Use framework helpers only when they fit that architecture. Next.js projects run `fimo skills get fimo-code --ref frameworks/next/locales`; React Router projects load the React Router setup reference; Astro projects run `fimo skills get fimo-code --ref frameworks/astro` and pass the page-resolved locale into server reads and `getLabels`.
92
90
 
93
91
  ## Labels And Content
94
92
 
@@ -1,7 +1,5 @@
1
1
  # Project MCP
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  The **Project MCP** lets an AI coding client use Fimo's project workflows through the Model Context Protocol. It is
6
4
  the same Fimo tool surface exposed in two ways:
7
5
 
@@ -17,13 +15,13 @@ The local and remote Project MCP modes share the same catalog. The public Docs M
17
15
  Authenticate the CLI first:
18
16
 
19
17
  ```bash
20
- npx fimo@latest login
18
+ fimo login
21
19
  ```
22
20
 
23
21
  Then configure the MCP client to launch:
24
22
 
25
23
  ```text
26
- npx fimo@latest mcp
24
+ fimo mcp
27
25
  ```
28
26
 
29
27
  For clients that accept a JSON command configuration, the equivalent entry is:
@@ -1,7 +1,5 @@
1
1
  # AI media tasks
2
2
 
3
- > **Run via `npx fimo@latest <command>`** so the task catalog and CLI stay aligned.
4
-
5
3
  Use task commands for AI media. The command describes the outcome; Fimo chooses and can change the underlying generation route without changing agent instructions.
6
4
 
7
5
  ```bash
@@ -1,7 +1,5 @@
1
1
  # Preview URL (without deploying)
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  **Use `fimo preview url` whenever you need the current preview link — to open it, screenshot it, hand it to another tool, or verify a change you've already deployed. Never trigger a `fimo deploy` just to refresh a URL.**
6
4
 
7
5
  `fimo deploy` is a milestone command: it commits, pushes, syncs the sandbox, and only then prints the preview URL. `fimo preview url` skips all of that. It calls the API directly, gets a fresh 15-min token, and prints the URL. No commit, no push, no restart. Sub-second on a warm sandbox.
@@ -1,7 +1,5 @@
1
1
  # Project Variables And Secrets
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  Use project variables for values that are safe to expose to the browser. Use project secrets for hidden values such as API keys, tokens, webhooks, and service credentials.
6
4
 
7
5
  There is no private-variable mode. If leaking the value would be a problem, use `fimo secrets`.
@@ -1,14 +1,12 @@
1
1
  # Managing projects
2
2
 
3
- > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
-
5
3
  Commands for listing projects across an org, cloning a remote project locally, and managing the lifecycle of a single project (delete, publish, unpublish, rename). Most lifecycle commands operate on the **current project** (read from `.fimo/project.json`, or the legacy `.fimo.settings.json`, in the cwd) by default; for `delete`, `publish`, and `unpublish` you can pass an explicit `[projectId]` to target another. (`rename` only edits the linked local project; see below.)
6
4
 
7
5
  ## The `fimo projects` namespace
8
6
 
9
7
  ```bash
10
8
  fimo projects list [--org <id>] # list projects in an org (defaults to active org)
11
- fimo projects create [dir] [--org <id>] [--framework react-router|nextjs] [--install|--no-install]
9
+ fimo projects create [dir] [--org <id>] [--framework react-router|astro|nextjs|sveltekit] [--install|--no-install]
12
10
  fimo projects clone [projectId] [dir] [--env <name>] # clone an existing project locally
13
11
  fimo projects delete [projectId] [-C <dir>] [-y] # delete (defaults to current project)
14
12
  fimo projects publish [projectId] [-C <dir>] # make the project live (publish from main)
@@ -29,7 +27,7 @@ fimo projects rename <name> [projectId] [-C <dir>] # set seo.siteName in the l
29
27
  fimo clone [projectId] [dir] [--env <name>] # same as `fimo projects clone`
30
28
  ```
31
29
 
32
- Use the top-level shortcut for the common "get this project onto my machine" workflow. After clone succeeds, `cd` into the printed directory, `Read` the project's `AGENTS.md`, and load the code skill with `npx fimo@latest skills get fimo-code` before generating code.
30
+ Use the top-level shortcut for the common "get this project onto my machine" workflow. After clone succeeds, `cd` into the printed directory, `Read` the project's `AGENTS.md`, and load the code skill with `fimo skills get fimo-code` before generating code.
33
31
 
34
32
  ## Top-level shortcuts (current project)
35
33
 
@@ -1,7 +1,5 @@
1
1
  # Scheduled Commands
2
2
 
3
- > **Run via `npx fimo@latest <command>`** - always the latest CLI, no install needed.
4
-
5
3
  `fimo schedules` manages recurring commands for one project environment. It uses the current checkout environment by default, or the environment passed with `--env <name>`.
6
4
 
7
5
  The command starts in that environment's sandbox. Commands can still target another environment explicitly, for example with `fimo schemas list --env preview`.
@@ -1,7 +1,5 @@
1
1
  # Reporting a problem to Fimo
2
2
 
3
- > **Run via `npx fimo@latest <command>`** - always the latest CLI, no install needed.
4
-
5
3
  `fimo support report` sends a project-scoped problem to Fimo support. It automatically includes the project, current environment, and CLI version so support can start investigating without asking the user to repeat that context.
6
4
 
7
5
  ## When to prepare it
@@ -1,7 +1,5 @@
1
1
  # Outbound webhooks
2
2
 
3
- > **Run via `npx fimo@latest <command>`** so the event catalog and delivery commands match the platform.
4
-
5
3
  > **Beta:** Test each destination and inspect its delivery history before depending on it in production.
6
4
 
7
5
  Use `fimo webhooks` to send project events to external HTTPS endpoints. The CLI and Studio edit the same project-wide configurations and delivery history. The CLI has no provider presets: inspect the destination's API documentation, then pass its URL, headers, and JSON body explicitly.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > For the CLI workflow (`fimo forms push`, "Add a contact form" recipe), see **`fimo-cli/references/forms.md`**.
4
4
 
5
- This file covers the **package surface**: the JSON spec you write, the generated Zod schema + `submitX` helper you import, the React patterns. Version-locked to the project's `fimo` package.
5
+ This file covers the **package surface**: the JSON spec, generated Zod schema, `parseXFormData`, and `submitX` helper. Version-locked to the project's `fimo` package. The application owns form markup, actions, routing, locale, and UX.
6
6
 
7
7
  ## Form JSON spec
8
8
 
@@ -43,7 +43,7 @@ This file covers the **package surface**: the JSON spec you write, the generated
43
43
 
44
44
  ## Generated TS client
45
45
 
46
- After pre-build (or `fimo deploy`), `src/forms/{name}.ts` exists with:
46
+ After `fimo forms push` and the next validation/build, `src/forms/{name}.ts` exists with:
47
47
 
48
48
  ```ts
49
49
  export const FORM_ID = '<uuid>';
@@ -51,20 +51,28 @@ export const ContactUsSchema = z.object({
51
51
  /* fields */
52
52
  });
53
53
  export type ContactUsData = z.infer<typeof ContactUsSchema>;
54
- export async function submitContactUs(data): Promise<{ success: boolean; errors?: Record<string, string> }>;
54
+ export function parseContactUsFormData(formData: FormData): ContactUsData;
55
+ export function submitContactUs(
56
+ data: ContactUsData,
57
+ client?
58
+ ): Promise<{
59
+ success: boolean;
60
+ status: number;
61
+ errors?: Record<string, string>;
62
+ }>;
55
63
  ```
56
64
 
57
- Re-exported by `src/forms/index.ts`.
65
+ The schema, parser, submitter, and form id are re-exported by `src/forms/index.ts`.
58
66
 
59
- The `submitX` helper handles fetch + file uploads (presigned URLs) automatically. Never hand-roll fetch or validation.
67
+ The `submitX` helper uses the framework adapter's shared Fimo transport and handles presigned file uploads automatically. Never hand-roll the Fimo API fetch or validation.
60
68
 
61
- ## React code pattern
69
+ ## Common code pattern
62
70
 
63
- Always import from `@/forms/{name}` — never hand-roll fetch, never hand-roll validation.
71
+ Always import the generated module. Keep the native form and pending/error state in the framework's normal pattern:
64
72
 
65
73
  ```tsx
66
74
  import { useState } from 'react';
67
- import { ContactUsSchema, submitContactUs } from '@/forms/contact-us';
75
+ import { ContactUsSchema, parseContactUsFormData, submitContactUs } from '@/forms/contact-us';
68
76
  import type { ContactUsData } from '@/forms/contact-us';
69
77
 
70
78
  export function ContactForm() {
@@ -76,8 +84,7 @@ export function ContactForm() {
76
84
  setErrors({});
77
85
  setLoading(true);
78
86
 
79
- const raw = Object.fromEntries(new FormData(e.currentTarget));
80
- const parsed = ContactUsSchema.safeParse(raw);
87
+ const parsed = ContactUsSchema.safeParse(parseContactUsFormData(new FormData(e.currentTarget)));
81
88
  if (!parsed.success) {
82
89
  const fieldErrors: Record<string, string> = {};
83
90
  for (const issue of parsed.error.issues) fieldErrors[issue.path[0] as string] = issue.message;
@@ -97,6 +104,13 @@ export function ContactForm() {
97
104
 
98
105
  **File fields**: pass the raw `File` from `<input type="file">` to `submitX` — it handles the presigned upload automatically. **Never base64-encode.**
99
106
 
107
+ ## Framework bindings
108
+
109
+ - **Vite/React:** `submitX(data)` keeps using the existing `fimo/ui` runtime and preserves the current generated API.
110
+ - **Next.js:** server modules import `@/forms/name`; client components import `@/forms/name.client`. Both expose the same `submitX(data)` shape.
111
+ - **Astro:** import the generated server module and call `submitX(data)` in an Astro action or endpoint. Astro keeps the HTML form and redirect.
112
+ - **SvelteKit:** use `createFimoFormClient({ event })` in a server action and pass it as the second argument: `submitX(data, client)`.
113
+
100
114
  ## Labels and copy
101
115
 
102
116
  Wrap every visible string in `t('key')` and create the DB value with `fimo labels set` — see `references/labels.md`. This includes form labels, placeholders, button text, success/error messages.
@@ -75,6 +75,15 @@ const [settings, stories, labels] = await Promise.all([
75
75
 
76
76
  The native surface is `Text`, `RichText`, `Image`, `StaticImage`, `Video`, `Date`, `Boolean`, and `Json` (component table: `references/ui.md`). Pass tracked values whole so Studio can resolve their source; use `String(value)` only for attributes and URLs.
77
77
 
78
+ ## Forms
79
+
80
+ Generated forms use the native Astro server adapter. Keep the form element,
81
+ action, redirect, and error UI in Astro; call `submitX(data)` from an Astro
82
+ action or endpoint. Use `parseXFormData(new FormData(request))` to normalize
83
+ browser values before submitting. Do not import the server form module into a
84
+ client island; add a project endpoint if the form is intentionally browser-
85
+ submitted.
86
+
78
87
  ## Static and on-demand rendering
79
88
 
80
89
  Keep the application's per-route rendering choice:
@@ -82,6 +82,31 @@ Never write the registry by hand and never create alternate `*.schema.json` file
82
82
 
83
83
  ## Server and client boundaries
84
84
 
85
+ Forms follow the same boundary. Server actions and route handlers import the
86
+ generated server form module; a Client Component imports its generated
87
+ `.client.ts` module. Both expose `submitX(data)` and use the shared Fimo form
88
+ transport; do not call the tenant API directly.
89
+
90
+ ```tsx
91
+ 'use client';
92
+
93
+ import { parseContactUsFormData, submitContactUs } from '@/forms/contact-us.client';
94
+
95
+ export function ContactForm() {
96
+ return (
97
+ <form
98
+ action={async (formData) => {
99
+ await submitContactUs(parseContactUsFormData(formData));
100
+ }}
101
+ >
102
+ <input name="email" type="email" required />
103
+ <textarea name="message" required />
104
+ <button type="submit">Send</button>
105
+ </form>
106
+ );
107
+ }
108
+ ```
109
+
85
110
  Server Components, route handlers, `getStaticProps`, and `getServerSideProps` import from `fimo/next` and generated server modules:
86
111
 
87
112
  ```ts
@@ -59,17 +59,28 @@ export async function load(event) {
59
59
  }
60
60
  ```
61
61
 
62
- Resolve the locale with the application's existing policy, then fetch labels in
63
- the root server layout and publish the snapshot to descendants:
62
+ Pass `createFimo` the locale the application resolved. Omit it and Fimo sends
63
+ `.fimo/config.json#i18n.defaultLocale`, or no locale at all when none is
64
+ configured, so the API answers with the project default. Never hardcode a locale
65
+ to satisfy the signature.
66
+
67
+ `getLabels` follows the same rule: pass the locale the application resolved, or
68
+ omit it and the API answers with the project default, whose locale the returned
69
+ snapshot reports. Fetch labels in the root server layout and publish the
70
+ snapshot to descendants. Fimo resolves its injected content API URL internally;
71
+ do not import a Fimo environment variable or hardcode a tenant URL:
64
72
 
65
73
  ```ts
66
74
  // src/routes/+layout.server.ts
67
- import { env } from '$env/dynamic/public';
68
75
  import { getLabels } from 'fimo/sveltekit';
69
76
 
70
77
  export async function load(event) {
71
- const locale = 'en'; // replace with the application's resolved locale
72
- return { labels: await getLabels({ apiUrl: env.PUBLIC_FIMO_API_URL, event, locale }) };
78
+ // If the app resolves a locale from its URL or session, pass it:
79
+ // const locale = resolveLocale(event.url); // your app's resolver
80
+ // return { labels: await getLabels({ event, locale }) };
81
+
82
+ // Otherwise, omit it and use the Fimo project default.
83
+ return { labels: await getLabels({ event }) };
73
84
  }
74
85
  ```
75
86
 
@@ -94,6 +105,23 @@ component that renders them. Use `Text`, `RichText`, `Image`, `Video`, `Date`,
94
105
  formats plain numeric values for display; numeric fields currently have no
95
106
  source metadata, so it is not a Studio-editable primitive.
96
107
 
108
+ ## Forms
109
+
110
+ Use a `+page.server` action so SvelteKit owns the request and redirect. Pass its
111
+ event to `createFimoFormClient` and use the generated parser/helper:
112
+
113
+ ```ts
114
+ import { createFimoFormClient } from 'fimo/sveltekit';
115
+ import { parseContactUsFormData, submitContactUs } from '$lib/forms/contact-us';
116
+
117
+ export const actions = {
118
+ default: async (event) => {
119
+ const data = parseContactUsFormData(await event.request.formData());
120
+ return submitContactUs(data, createFimoFormClient({ event }));
121
+ },
122
+ };
123
+ ```
124
+
97
125
  ## Live preview
98
126
 
99
127
  `FimoProvider` owns the Studio browser bridge. On mount it reads
@@ -41,7 +41,7 @@ The label contract is shared; acquisition differs by runtime:
41
41
  - Next server: `getLabels({ locale? })` from `fimo/next`.
42
42
  - Next client: `useLabels()` from `fimo/next/client`, under `FimoProvider`.
43
43
  - React Router/Vite client: `Label` and `useLabels()` from `fimo/ui`, under the existing framework integration.
44
- - SvelteKit: resolve the locale in the root server load and return `getLabels({ apiUrl, event, locale })`. Wrap the root layout with `FimoProvider` from `fimo/sveltekit/components`; the snapshot supplies its locale. Descendants use `Label` from that entrypoint or `useLabels().t()` from `fimo/sveltekit`. Pass the same resolved locale to `createFimo({ content, event, locale })` in content loads.
44
+ - SvelteKit: pass the application's resolved locale to `getLabels({ apiUrl, event, locale })`, or omit it to let the API choose the project default. Wrap the root layout with `FimoProvider` from `fimo/sveltekit/components`; the snapshot supplies its locale. Descendants use `Label` from that entrypoint or `useLabels().t()` from `fimo/sveltekit`. Apply the same explicit-or-omitted rule to `createFimo({ content, event, locale? })` in content loads.
45
45
  - Astro server page: `getLabels({ locale? })` from `fimo/astro`; no provider.
46
46
 
47
47
  Load the matching framework reference before choosing a provider or server reader.