fimo 0.15.0 → 0.16.0-experimental.1

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 (183) hide show
  1. package/assets/astro/components/DateTime.astro +22 -0
  2. package/assets/astro/components/index.d.ts +1 -0
  3. package/assets/astro/components/index.js +1 -0
  4. package/assets/content-templates/forms/react.eta +3 -3
  5. package/assets/content-templates/shared/types.eta +2 -0
  6. package/assets/skills/fimo-cli/SKILL.md +20 -14
  7. package/assets/skills/fimo-cli/references/account.md +1 -1
  8. package/assets/skills/fimo-cli/references/agents.md +13 -10
  9. package/assets/skills/fimo-cli/references/branches.md +39 -38
  10. package/assets/skills/fimo-cli/references/content.md +2 -2
  11. package/assets/skills/fimo-cli/references/credits.md +1 -1
  12. package/assets/skills/fimo-cli/references/deploy.md +30 -14
  13. package/assets/skills/fimo-cli/references/history.md +13 -6
  14. package/assets/skills/fimo-cli/references/hosting.md +114 -0
  15. package/assets/skills/fimo-cli/references/init.md +19 -8
  16. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +2 -0
  17. package/assets/skills/fimo-cli/references/locales.md +39 -15
  18. package/assets/skills/fimo-cli/references/mcp.md +8 -8
  19. package/assets/skills/fimo-cli/references/pages.md +70 -0
  20. package/assets/skills/fimo-cli/references/preview.md +29 -20
  21. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +1 -1
  22. package/assets/skills/fimo-cli/references/projects.md +3 -3
  23. package/assets/skills/fimo-cli/references/schedules.md +8 -5
  24. package/assets/skills/fimo-cli/references/support.md +1 -1
  25. package/assets/skills/fimo-cli/references/webhooks.md +9 -5
  26. package/assets/skills/fimo-code/SKILL.md +12 -0
  27. package/assets/skills/fimo-code/assets/react-router-locales/LocaleLayout.tsx +12 -0
  28. package/assets/skills/fimo-code/assets/react-router-locales/routes.ts +7 -6
  29. package/assets/skills/fimo-code/references/best-practices/astro.md +47 -0
  30. package/assets/skills/fimo-code/references/best-practices/next.md +42 -0
  31. package/assets/skills/fimo-code/references/best-practices/sveltekit.md +17 -0
  32. package/assets/skills/fimo-code/references/content/richtext.md +5 -0
  33. package/assets/skills/fimo-code/references/content/schema.md +4 -1
  34. package/assets/skills/fimo-code/references/frameworks/astro.md +5 -3
  35. package/assets/skills/fimo-code/references/frameworks/compatibility.md +13 -8
  36. package/assets/skills/fimo-code/references/frameworks/hosting.md +28 -20
  37. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +6 -0
  38. package/assets/skills/fimo-code/references/frameworks/next/locales.md +12 -2
  39. package/assets/skills/fimo-code/references/frameworks/next.md +7 -0
  40. package/assets/skills/fimo-code/references/frameworks/react-router.md +15 -7
  41. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +15 -8
  42. package/assets/skills/fimo-code/references/labels.md +9 -1
  43. package/assets/skills/fimo-code/references/locales.md +8 -2
  44. package/assets/skills/fimo-code/references/migrations/react-router-route-ownership.md +93 -0
  45. package/assets/skills/fimo-code/references/ui.md +21 -2
  46. package/assets/skills/fimo-migration/SKILL.md +297 -53
  47. package/assets/skills/fimo-migration/agents/openai.yaml +2 -2
  48. package/assets/skills/fimo-migration/references/content.md +119 -35
  49. package/assets/skills/fimo-migration/references/decision.md +72 -0
  50. package/assets/skills/fimo-migration/references/forms.md +38 -6
  51. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +179 -23
  52. package/assets/skills/fimo-migration/references/import-contract.md +71 -19
  53. package/assets/skills/fimo-migration/references/manifest.md +11 -161
  54. package/assets/skills/fimo-migration/references/media.md +33 -1
  55. package/assets/skills/fimo-migration/references/platforms.md +26 -2
  56. package/assets/skills/fimo-migration/references/qa.md +185 -13
  57. package/assets/skills/fimo-migration/references/url-evidence.md +242 -0
  58. package/assets/skills/fimo-migration/references/workers/content-execution.md +39 -0
  59. package/assets/skills/fimo-migration/references/workers/content-planner.md +64 -0
  60. package/assets/skills/fimo-migration/references/workers/framework.md +37 -0
  61. package/assets/skills/fimo-migration/references/workers/url-observer.md +71 -0
  62. package/assets/skills/fimo-migration/references/workers/validator.md +31 -0
  63. package/assets/skills/fimo-migration/references/workers.md +104 -0
  64. package/assets/skills/fimo-migration/references/workflow.md +152 -192
  65. package/assets/skills/fimo-migration/scripts/apply-decision.mjs +534 -0
  66. package/assets/skills/fimo-migration/scripts/build-canonical-manifest.mjs +7 -4
  67. package/assets/skills/fimo-migration/scripts/write-migration-report.mjs +191 -4
  68. package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
  69. package/assets/skills/fimo-studio/references/cms.md +25 -7
  70. package/assets/skills/fimo-studio/references/webhooks.md +3 -3
  71. package/assets/sveltekit/components/DateTime.svelte +35 -0
  72. package/assets/sveltekit/components/FimoProvider.svelte +2 -2
  73. package/assets/sveltekit/components/index.d.ts +1 -0
  74. package/assets/sveltekit/components/index.js +1 -0
  75. package/dist/build/next/config.d.ts +4 -1
  76. package/dist/build/next/config.js +21 -5
  77. package/dist/build/sveltekit/vite.d.ts +3 -4
  78. package/dist/build/sveltekit/vite.js +3 -4
  79. package/dist/build/vite/plugins/runtime-env.d.ts +2 -1
  80. package/dist/build/vite/plugins/runtime-env.js +14 -10
  81. package/dist/cli/bundle.json +1 -1
  82. package/dist/cli/index.js +145 -124
  83. package/dist/runtime/app/FimoProviders.js +25 -14
  84. package/dist/runtime/app/prefetch.d.ts +3 -1
  85. package/dist/runtime/app/prefetch.js +11 -55
  86. package/dist/runtime/astro/preview.js +7 -9
  87. package/dist/runtime/content/client/internal.js +1 -0
  88. package/dist/runtime/i18n/locale.d.ts +6 -3
  89. package/dist/runtime/i18n/locale.js +16 -41
  90. package/dist/runtime/next/client-runtime.js +5 -1
  91. package/dist/runtime/next/client.d.ts +3 -2
  92. package/dist/runtime/next/client.js +2 -1
  93. package/dist/runtime/next/labels.d.ts +2 -2
  94. package/dist/runtime/next/labels.js +2 -2
  95. package/dist/runtime/next/preview.d.ts +13 -0
  96. package/dist/runtime/next/preview.js +34 -0
  97. package/dist/runtime/next/primitives/server.d.ts +2 -0
  98. package/dist/runtime/next/primitives/server.js +8 -0
  99. package/dist/runtime/next/provider.d.ts +5 -0
  100. package/dist/runtime/next/provider.js +17 -3
  101. package/dist/runtime/next/server-runtime.js +4 -1
  102. package/dist/runtime/next/server.d.ts +1 -1
  103. package/dist/runtime/next/server.js +1 -1
  104. package/dist/runtime/paths/get-fimo-paths.d.ts +6 -5
  105. package/dist/runtime/paths/get-fimo-paths.js +43 -42
  106. package/dist/runtime/preview/location.d.ts +19 -2
  107. package/dist/runtime/preview/location.js +16 -2
  108. package/dist/runtime/primitives/index.d.ts +1 -0
  109. package/dist/runtime/primitives/index.js +1 -0
  110. package/dist/runtime/react/primitives/editable/DateTime.d.ts +4 -0
  111. package/dist/runtime/react/primitives/editable/DateTime.js +13 -0
  112. package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +7 -1
  113. package/dist/runtime/react/primitives/renderers/DateRenderer.js +11 -8
  114. package/dist/runtime/react-router/{routes.d.ts → legacy/routes.d.ts} +6 -1
  115. package/dist/runtime/react-router/{routes.js → legacy/routes.js} +22 -7
  116. package/dist/runtime/routes/index.d.ts +162 -0
  117. package/dist/runtime/routes/index.js +335 -0
  118. package/dist/runtime/routing/AppRoutesProvider.js +4 -3
  119. package/dist/runtime/seo/resolver.d.ts +5 -0
  120. package/dist/runtime/seo/resolver.js +10 -42
  121. package/dist/runtime/shared/fimo-config.types.d.ts +14 -13
  122. package/dist/runtime/shared/preview-location.d.ts +1 -22
  123. package/dist/runtime/shared/preview-location.js +5 -93
  124. package/dist/runtime/sveltekit/preview.d.ts +12 -3
  125. package/dist/runtime/sveltekit/preview.js +13 -8
  126. package/dist/runtime/sveltekit/runtime.js +4 -1
  127. package/dist/runtime/templates.d.ts +19 -0
  128. package/dist/runtime/templates.js +33 -0
  129. package/dist/scripts/sync-forms.js +1 -1
  130. package/dist/scripts/sync-schemas.js +1 -4
  131. package/dist/scripts/validate-fimo-config.js +5 -1
  132. package/dist/scripts/validate-page-registry.d.ts +2 -0
  133. package/dist/scripts/validate-page-registry.js +167 -0
  134. package/dist/scripts/validate-route-metadata.js +132 -41
  135. package/package.json +10 -5
  136. package/release.json +2 -2
  137. package/templates/astro/.fimo/config.json +13 -5
  138. package/templates/astro/AGENTS.md +6 -1
  139. package/templates/astro/astro.config.mjs +7 -0
  140. package/templates/astro/package.json +1 -1
  141. package/templates/astro/pnpm-workspace.yaml +0 -3
  142. package/templates/astro/src/components/ProjectOverview.astro +9 -6
  143. package/templates/astro/src/layouts/Base.astro +1 -1
  144. package/templates/astro/src/locales.ts +4 -0
  145. package/templates/astro/src/pages/[locale]/index.astro +19 -0
  146. package/templates/astro/src/pages/[locale]/projects/[slug].astro +35 -0
  147. package/templates/astro/src/pages/[locale]/projects/index.astro +19 -0
  148. package/templates/astro/src/pages/index.astro +5 -2
  149. package/templates/astro/src/pages/projects/[slug].astro +4 -2
  150. package/templates/astro/src/pages/projects/index.astro +5 -2
  151. package/templates/nextjs/.fimo/config.json +2 -1
  152. package/templates/nextjs/AGENTS.md +6 -0
  153. package/templates/nextjs/package.json +1 -1
  154. package/templates/nextjs/src/app/(default)/layout.tsx +10 -0
  155. package/templates/nextjs/src/app/[locale]/layout.tsx +22 -0
  156. package/templates/nextjs/src/app/[locale]/page.tsx +1 -0
  157. package/templates/nextjs/src/components/Document.tsx +26 -0
  158. package/templates/nextjs/src/components/FimoPreviewBridge.tsx +13 -0
  159. package/templates/nextjs/src/locales.ts +13 -0
  160. package/templates/react-router/.fimo/config.json +3 -6
  161. package/templates/react-router/AGENTS.md +5 -0
  162. package/templates/react-router/package.json +2 -2
  163. package/templates/react-router/pnpm-workspace.yaml +1 -3
  164. package/templates/react-router/react-router.config.ts +4 -10
  165. package/templates/react-router/src/pages/LocaleLayout.tsx +12 -0
  166. package/templates/react-router/src/root.tsx +2 -4
  167. package/templates/react-router/src/routes.ts +5 -3
  168. package/templates/sveltekit/.fimo/config.json +2 -1
  169. package/templates/sveltekit/AGENTS.md +6 -0
  170. package/templates/sveltekit/package.json +1 -1
  171. package/templates/sveltekit/src/app.html +1 -1
  172. package/templates/sveltekit/src/hooks.server.ts +11 -0
  173. package/templates/sveltekit/src/locales.ts +8 -0
  174. package/templates/sveltekit/src/params/locale.ts +5 -0
  175. package/templates/sveltekit/src/routes/+layout.server.ts +6 -1
  176. package/templates/sveltekit/src/routes/+layout.svelte +5 -0
  177. package/assets/skills/fimo-migration/references/inventory/coordinator.md +0 -40
  178. package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +0 -39
  179. package/assets/skills/fimo-migration/references/inventory/locales.md +0 -41
  180. package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +0 -459
  181. package/templates/nextjs/src/app/layout.tsx +0 -17
  182. /package/templates/nextjs/src/app/{page.tsx → (default)/page.tsx} +0 -0
  183. /package/templates/sveltekit/src/routes/{+page.svelte → [[locale=locale]]/+page.svelte} +0 -0
@@ -0,0 +1,22 @@
1
+ ---
2
+ import { getFimoSource } from 'fimo/astro';
3
+
4
+ interface Props {
5
+ value: globalThis.Date | String | string | number | null | undefined;
6
+ locale?: string;
7
+ options?: Intl.DateTimeFormatOptions;
8
+ [key: string]: unknown;
9
+ }
10
+
11
+ const { value, locale, options, ...props } = Astro.props;
12
+ const rawValue = value instanceof String ? value.toString() : value;
13
+ const date = rawValue == null ? null : new globalThis.Date(rawValue as string | number | globalThis.Date);
14
+ const validDate = date && !Number.isNaN(date.getTime()) ? date : null;
15
+ // The whole instant, not just the day: a `datetime` field exists to name a
16
+ // moment, and truncating it here would throw the time away on every page.
17
+ const dateTime = validDate?.toISOString();
18
+ const content = validDate?.toLocaleString(locale, options ?? { dateStyle: 'medium', timeStyle: 'short' });
19
+ const source = getFimoSource(value);
20
+ ---
21
+
22
+ {validDate && <time {...props} datetime={dateTime} data-fimo-source={source}>{content}</time>}
@@ -1,5 +1,6 @@
1
1
  export { default as Boolean } from './Boolean.astro';
2
2
  export { default as Date } from './Date.astro';
3
+ export { default as DateTime } from './DateTime.astro';
3
4
  export { default as Image } from './Image.astro';
4
5
  export { default as Json } from './Json.astro';
5
6
  export { default as RichText } from './RichText.astro';
@@ -1,5 +1,6 @@
1
1
  export { default as Boolean } from './Boolean.astro';
2
2
  export { default as Date } from './Date.astro';
3
+ export { default as DateTime } from './DateTime.astro';
3
4
  export { default as Image } from './Image.astro';
4
5
  export { default as Json } from './Json.astro';
5
6
  export { default as RichText } from './RichText.astro';
@@ -78,7 +78,7 @@ const fileFieldKeys = Object.entries(form.fields)
78
78
 
79
79
  import { z } from "zod";
80
80
 
81
- export const FORM_ID = <%= quote(form.id ?? 'undefined') %>;
81
+ export const FORM_ID = <%= form.id ? quote(form.id) : 'undefined' %>;
82
82
 
83
83
  export const <%= form.pascal %>Schema = z.object({
84
84
  <% Object.entries(form.fields).forEach(([key, field]) => { -%>
@@ -154,8 +154,8 @@ export async function submit<%= form.pascal %>(data: <%= form.pascal %>Data): Pr
154
154
  status: number;
155
155
  errors?: Record<string, string>;
156
156
  }> {
157
- if (!FORM_ID || FORM_ID === "undefined") {
158
- throw new Error(`Form "${FORM_ID || "unknown"}" has not been pushed. Run fimo forms push first.`);
157
+ if (!FORM_ID) {
158
+ throw new Error(<%= quote(`Form "${form.name}" has not been pushed. Run fimo forms push first.`) %>);
159
159
  }
160
160
 
161
161
  <% if (hasFileFields) { -%>
@@ -97,6 +97,7 @@ function getTypeForField(field) {
97
97
  case 'boolean':
98
98
  return 'FimoBoolean';
99
99
  case 'date':
100
+ case 'datetime':
100
101
  return 'string';
101
102
  case 'json':
102
103
  return 'Record<string, any>';
@@ -126,6 +127,7 @@ function getInputTypeForField(field) {
126
127
  case 'boolean':
127
128
  return 'boolean';
128
129
  case 'date':
130
+ case 'datetime':
129
131
  return 'string';
130
132
  case 'json':
131
133
  return 'Record<string, unknown>';
@@ -2,7 +2,7 @@
2
2
  name: fimo-cli
3
3
  description: >-
4
4
  Use the `fimo` CLI to create or operate a Fimo project: content, forms,
5
- media, labels/locales, deploys, environments, domains, analytics,
5
+ media, labels/locales, deploys, Branches, Environments, domains, analytics,
6
6
  integrations, Fimo agents, collaboration, accounts, and credits. Also use
7
7
  for AI agent or MCP setup and confirmed Fimo platform blockers.
8
8
  ---
@@ -15,7 +15,7 @@ This skill describes **what the CLI does and the workflows it drives**. For the
15
15
 
16
16
  Use `fimo <command> --help` for full flag details on any command.
17
17
 
18
- > **Webhooks are beta.** Verify a destination with `fimo webhooks test <id> --wait` and inspect its delivery history before depending on it in production.
18
+ > Verify a destination with `fimo webhooks test <id> --wait` and inspect its delivery history before depending on it in production.
19
19
 
20
20
  ## Running the CLI
21
21
 
@@ -42,9 +42,9 @@ Pretty output may hide URLs behind clickable labels. Agents should use `--json`
42
42
 
43
43
  A Fimo project is identified by `.fimo/project.json`, written by `fimo init`. This file connects the local directory to the remote Fimo project. **Never edit it manually.** Most CLI commands find it by walking up from the cwd.
44
44
 
45
- ## Critical: commands target the env of the current git branch
45
+ ## Critical: commands target the Branch matching the current git branch
46
46
 
47
- A project can have multiple **envs** — each is a git branch _plus_ its own DB, sandbox, preview, and assets. Project-scoped commands (`deploy`, `status`, `entries`, `diff`, …) operate on the env of the **current git branch**, and print a one-line banner saying which one. New projects start on `main`. Override for a single command with the global `--env <name>` flag; never edit the link file to switch. The full git-shaped workflow (`branch` / `checkout` / `switch` / `pull` / `diff` / `merge` / `status` / `publish`) lives in `references/branches.md`.
47
+ A project can have multiple **Branches** — each is a git branch _plus_ its own DB, sandbox, preview, and assets. Project-scoped commands (`deploy`, `status`, `entries`, `diff`, …) operate on the Branch matching the **current git branch**, and print a one-line banner saying which one. New projects start on `main`. Override for a single command with the canonical `--branch <name>` flag; the legacy `--env <name>` spelling remains a compatibility alias. Never edit the link file to switch. The full git-shaped workflow (`branch` / `checkout` / `switch` / `pull` / `diff` / `merge` / `status` / `publish`) lives in `references/branches.md`.
48
48
 
49
49
  ## Quick Start
50
50
 
@@ -58,22 +58,27 @@ fimo clone # interactively choose an existin
58
58
  cd my-site # then load skills on demand: fimo skills get fimo-code
59
59
  pnpm dev # run the app locally (use the project's PM: pnpm/npm run/yarn/bun) — your iteration loop
60
60
  fimo credits # inspect the owning org's AI credit balance (read-only)
61
- fimo history list # inspect this environment's restore points
61
+ fimo history list # inspect this Branch's restore points
62
62
  fimo validate # run all checks + codegen; fails on missing DB labels
63
- fimo deploy # ON-DEMAND: hosted preview / shareable link (runs validate internally)
63
+ fimo deploy # ON-DEMAND: hosted project preview (runs validate internally)
64
64
  fimo deploy --publish # ON-DEMAND: publish live (only when the developer says "ship it")
65
65
  ```
66
66
 
67
- The working loop is local: run the app with the project's package-manager `dev` script (`pnpm dev` / `npm run dev` / `yarn dev` / `bun dev` — match the lockfile), ask the developer what they want, edit, and iterate against the live localhost server. Outside the first-time onboarding rule below, `fimo deploy` is **not** a required final step — reach for it only when the developer wants a hosted preview, a shareable link, or to go live, and only on their signal (see `references/deploy.md`).
67
+ The working loop is local: run the app with the project's package-manager `dev` script (`pnpm dev` / `npm run dev` / `yarn dev` / `bun dev` — match the lockfile), ask the developer what they want, edit, and iterate against the live localhost server. Outside the first-time onboarding rule below, `fimo deploy` is **not** a required final step — reach for it only when the developer wants a hosted project preview or to go live, and only on their signal (see `references/deploy.md`).
68
68
 
69
69
  `fimo validate` is the single entrypoint for "prove this project is ready" — it covers schema/form codegen, route metadata checks, lint, and missing label checks for `i18n.defaultLocale` from `.fimo/config.json` (fallback: `en`). Use `fimo labels set` / `set-many` to create or update label values in the DB. The underlying phases are also available individually under the hidden `fimo scripts` namespace for advanced/debug use.
70
70
 
71
+ Keep `fimo validate --json` at the front of the project's `build` script, which is where the bundled templates put it. The hosted build runs that script, so validation runs on the exact code being published and a rejected build reports the failing rule instead of a generic build error. Removing it is the developer's call, but do not drop it while editing `package.json` for other reasons.
72
+
73
+ **`fimo validate` does not type check.** Run the project's own `typecheck` or `check` script after changing code.
74
+
71
75
  ## Decision Tree
72
76
 
73
77
  Load the matching reference when the user's request fires its trigger. Recipes that involve writing code also need the `fimo-code` skill's package references — they're called out where relevant.
74
78
 
75
79
  - "Create a new Fimo project / scaffold a site / start a new website / add the opt-in content starter / link an existing project locally" → `references/init.md`
76
- - "Add a content type / blog / products / pages / CMS" → `references/content.md` (workflow) **+ run `fimo skills get fimo-code --ref content/schema` and load the detected framework reference**
80
+ - "Add a content type / blog / products / content schemas / CMS" → `references/content.md` (workflow) **+ run `fimo skills get fimo-code --ref content/schema` and load the detected framework reference**
81
+ - "Declare Pages routes / configure Pages sources or route params / control what Studio shows for a route" → `references/pages.md`
77
82
  - "Add a contact / signup / feedback / newsletter form" → `references/forms.md` (workflow) **+ run `fimo skills get fimo-code --ref forms` for the JSON spec and generated client**
78
83
  - "View form submissions / who filled out the contact form / inspect what users sent / how many signups" → `references/forms.md` § Reading submissions
79
84
  - "Upload an image / hero / cover / existing media file" → `references/assets.md` (workflow: upload, browse, open, delete) **+ run `fimo skills get fimo-code --ref assets` for the `FimoMedia` shape and rendering**
@@ -82,7 +87,8 @@ Load the matching reference when the user's request fires its trigger. Recipes t
82
87
  - "Enable locales / configure default locale / integrate an existing locale system" → `references/locales.md` **+ run `fimo skills get fimo-code --ref locales` and load the detected framework locale reference**
83
88
  - "What's in this project / show the project structure / describe the project / what schemas does it have / how many routes / project tree / show me what's here" → `references/describe.md`
84
89
  - "Deploy / publish / go live / push my changes" → `references/deploy.md`
85
- - "Get the preview URL / open the preview / what's the URL for this env / refresh the preview link / I just want to see the site / the preview URL stopped working" → `references/preview.md`
90
+ - "Add a redirect / security headers / CSP / HSTS / clean URLs / trailing slash" → `references/hosting.md`
91
+ - "Get the preview URL / open the preview / what's the URL for this Branch / refresh the preview link / I just want to see the site / the preview URL stopped working" → `references/preview.md`
86
92
  - "Schedule a command / cron / nightly publish / recurring checks / `fimo schedules`" → `references/schedules.md`
87
93
  - "Set env vars / configure API keys / add project secrets / local `.env.local` / `fimo vars` / `fimo secrets`" → `references/project-vars-and-secrets.md`
88
94
  - "React to form submissions / publish changes / agent runs / analytics reports / media activity / send events to Resend, Slack, GitHub, Zapier, or an HTTP endpoint / configure or debug outbound webhooks" → `references/webhooks.md`
@@ -90,14 +96,14 @@ Load the matching reference when the user's request fires its trigger. Recipes t
90
96
  - "Firecrawl / scrape a public website / competitor research / agent web research" → `references/integrations.md` **+ load `references/integrations/firecrawl.md`**
91
97
  - "Check credits / credit balance / can I keep using AI / billing credits / running low / how many credits are left" → `references/credits.md`
92
98
  - "List history / create a restore point / recover content and code / restore a previous version / snapshot usage or retention" → `references/history.md`
93
- - "Create a branch / feature environment / new env / switch envs / merge envs / diff two envs / env status / what changed on this branch / sync from parent / cut a release / tag a version / go to prod" → `references/branches.md`
99
+ - "Create a Branch / feature Branch / switch Branches / merge Branches / diff two Branches / Branch status / what changed on this Branch / sync from parent / cut a release / tag a version / go to prod" → `references/branches.md`
94
100
  - "List my projects / clone an existing project locally / check out a project / delete this project / unpublish / rename the project / manage projects across the org" → `references/projects.md`
95
101
  - "Migrate an existing Webflow / Framer / Squarespace / Wix / Carrd site from only a published URL" → load the `fimo-migration` skill and start with `fimo migrate <url> [dir]` to prepare the agent-ready migration draft
96
102
  - "Migrate from an exported project, source repository, Webflow code export plus CMS CSVs, Framer CMS CSVs, Squarespace XML/CSV, Wix CSVs, Carrd/static export, or downloaded site files" → load the `fimo-migration` skill and use the source repo/export as the migration source of truth
97
103
  - "How do AI agents read my site / markdown for agents" → `references/deploy.md`
98
104
  - "Modify the URL of the website / change my project's address / connect a custom domain (e.g. blog.example.com) / rename the Fimo-provided `*.fimo.site` subdomain / buy a new domain through Fimo / set up a domain" → `references/domains.md`
99
105
  - "Invite a collaborator / add Marc / share with client" → `references/invite.md`
100
- - "Login / log out / who am I / switch organization" → `references/account.md` — note: switching **org** is `fimo orgs switch`; bare `fimo switch` switches **env** (see `references/branches.md`)
106
+ - "Login / log out / who am I / switch organization" → `references/account.md` — note: switching **org** is `fimo orgs switch`; bare `fimo switch` changes the active **Fimo Branch** (see `references/branches.md`)
101
107
  - "Create / scaffold / run / validate an agent / agent bundle / wire or enable its triggers / list agent templates / view agent runs, reports, or logs (`fimo agents *`)" → `references/agents.md`
102
108
  - "Install Fimo for my agent / fimo skills install / set up Claude Code, Codex, or Cursor for Fimo" → `references/agent-setup.md`
103
109
  - "Connect an agent to a Fimo project through MCP / configure `fimo mcp` / expose Fimo tools to a local MCP client" → `references/mcp.md`
@@ -115,11 +121,11 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
115
121
  - **When `fimo init` created or scaffolded a new project (create-new path, including a Studio-supplied `--project-id`)** → after init and context loading succeed, run the single first-preview deploy and return the preview and dashboard links — see `references/init.md` § Create the first hosted preview. That deploy is also the sandbox warm-up; never run a separate warm-up deploy. Skip it only if the user explicitly said not to deploy. Linking a project with existing code and migrations keep their own approval rules.
116
122
  - **Right after `fimo init`** → suggest `fimo rename "<Display Name>"` to set a human-readable name (the default post-init name is an auto-generated slug). Infer the name from what the user is building (e.g. "Acme Coffee" for a café, "Jane Doe Portfolio" for a personal site). See `references/init.md`.
117
123
  - **Right after `fimo init`** → start the app locally with the project's package-manager `dev` script (`pnpm dev` / `npm run dev` / `yarn dev` / `bun dev`) in the background. This localhost server with live reload is your iteration loop — edit, show, repeat. No deploy is needed to see local changes. If the initiating request did not say what to build, ask the developer — after the first preview on the create-new path, never as a blocker before initializing.
118
- - **When a user-visible unit of work looks done outside first-time onboarding** → **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 — or immediately if they ask. Never deploy ordinary edits on your own. See `references/deploy.md`.
124
+ - **When a user-visible unit of work looks done outside first-time onboarding** → **offer** to deploy (`fimo deploy` for a hosted project preview, `fimo deploy --publish` to go live) and run it only after the developer confirms — or immediately if they ask. Never deploy ordinary edits on your own. See `references/deploy.md`.
119
125
  - **Optional, outside new-project onboarding (its first preview already warms the sandbox), if you already know a deploy is coming** → warm the sandbox early with `fimo deploy -m "chore: init" &` in the background so the one-time ~15-30s provision + dep install happens while you work and the real deploy lands warm (~4-10s). This is a perf optimization, not a requirement. See `references/deploy.md` § Warm the sandbox early in a session.
120
126
  - **Iterative code-only deploys** → once you are deploying, `fimo deploy --no-restart` skips the sandbox dev-server restart on HMR-safe edits. See `references/deploy.md` § Skipping the dev-server restart for when it's safe.
121
127
  - **You need the current preview URL but haven't changed code** (opening it, screenshotting it, handing it to another tool, the previous URL expired) → `fimo preview url`, never a no-op `fimo deploy`. See `references/preview.md`.
122
- - **When the user wants to try something risky / explore a redesign without touching the live site** → suggest a feature env: `fimo checkout -b <name>` gives an isolated branch + DB + preview. Deploy previews there, then `fimo merge` it back and `fimo publish`. See `references/branches.md`.
128
+ - **When the user wants to try something risky / explore a redesign without touching the live site** → suggest a feature Branch: `fimo checkout -b <name>` gives an isolated Branch + DB + preview. Deploy previews there, then `fimo merge` it back and `fimo publish`. See `references/branches.md`.
123
129
  - **After completing or safely preserving the user's main work, when a confirmed Fimo platform failure still materially blocks the task after one safe recovery attempt, or a confirmed missing capability blocks completion or forces a fragile or heavily manual workaround** → use the built-in `supportReport` tool. Do not wait for the user to ask and do not stop after only describing the gap. See `references/support.md`.
124
130
  - **After the first successful `fimo deploy`** → suggest `fimo invite` if the project involves multiple people. Typical roles: `edit` for developers/content editors, `view` or `comment` for clients/stakeholders, `full` for project leads. See `references/invite.md`.
125
131
  - **When the user wants to modify the URL of their website** → walk through `references/domains.md`. The CLI surface covers renaming the Fimo-provided subdomain (`fimo domains rename-default`, free), attaching a domain they already own (`fimo domains add`, Premium), and buying a new domain through Fimo (`fimo domains buy`, Premium). The auto-generated default URL on every project is a fallback, not a final choice — proactively offer this after `fimo deploy --publish` if the user mentioned a real brand or domain.
@@ -129,7 +135,7 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
129
135
  - **Editing `.fimo/project.json`** — read-only; it's the link between local and remote project. Treat as a generated file.
130
136
  - **Treating `fimo deploy` as the working loop or a required final step** — the loop is local (`pnpm dev` etc.). Deploy commits + pushes + round-trips the sandbox; it's for hosted previews / going live, on-demand. Iterate locally and deploy at logical breakpoints. See `references/deploy.md`.
131
137
  - **Deploying without the developer asking or confirming** — new-project onboarding authorizes exactly one automatic first preview deploy (unless the user said not to deploy); every other deploy is offer-then-confirm. Don't auto-deploy after finishing an ordinary edit.
132
- - **Running `fimo deploy` just to get a fresh preview URL** — that's a commit + push + sandbox sync for what should be a sub-second read. Use `fimo preview url` instead. See `references/preview.md`.
138
+ - **Running `fimo deploy` just to get the current preview URL** — that's a commit + push + sandbox sync when only destination resolution is needed. Use `fimo preview url` instead. See `references/preview.md`.
133
139
  - **Using `fimo deploy --publish` casually** — `--publish` makes the site live to the public. Plain `fimo deploy` (preview) is the default. Use `--publish` only when the user says "ship it" / "go live" / "publish".
134
140
  - **Bare `fimo init` in a non-interactive shell** — will hang. Always pass `[dir]`, `--no-install` (or `--install`), `--no-skills` (or `--skills`), and `--org`/`--agents` as needed explicitly when scripted.
135
141
  - **Using a starter on an existing project** — `--starter` is create-new only. Keep `--project-id` flows blank and use explicit content/form/label commands when changing an existing project.
@@ -26,7 +26,7 @@ fimo orgs switch # interactive picker to change the active o
26
26
  fimo orgs switch --org <id-or-slug> # explicit switch (required in non-TTY)
27
27
  ```
28
28
 
29
- > **`fimo switch` is NOT the org switcher.** Bare `fimo switch <name>` is an alias for `fimo checkout` — it switches the active **env** (git branch). Org switching is `fimo orgs switch`. See `references/branches.md`.
29
+ > **`fimo switch` is NOT the org switcher.** Bare `fimo switch <name>` is an alias for `fimo checkout` — it changes the active **Fimo Branch**. A Fimo Branch keeps its code, database, sandbox, content, and preview together. Org switching is `fimo orgs switch`. See `references/branches.md`.
30
30
 
31
31
  ## Inviting collaborators
32
32
 
@@ -7,7 +7,7 @@ The `fimo agents` namespace authors and operates **agent bundles** — multi-fil
7
7
  The namespace splits cleanly in two:
8
8
 
9
9
  - **Bundle authoring** — `create`, `list-templates`, `list`, `validate`, `secrets add/remove/list`. Local config editing, no API call except the project-level validation path. Operates on the files under `.fimo/agents/<name>/` (or root `agents/<name>/` for legacy projects).
10
- - **Cloud ops** — `run`, `runs`, `report`, `logs`. Env-aware, talk to the server. Default `--env` is `main`; `--project` defaults to the linked project in `.fimo/project.json` or legacy `.fimo.settings.json`.
10
+ - **Cloud ops** — `run`, `runs`, `report`, `logs`. Branch-aware, talk to the server. Default `--branch` is `main`; the legacy `--env` spelling remains an alias. `--project` defaults to the linked project in `.fimo/project.json` or legacy `.fimo.settings.json`.
11
11
 
12
12
  The bundle lives in **git** (`.fimo/agents/<name>/`, or legacy root `agents/<name>/`), not the database. The DB only mirrors what `config.yaml` declares on `main` (which triggers are wired) plus **run sessions**. So the bundle reaches the server through `fimo deploy` — and that push to `main` is also what wires its triggers. There is no activate command: deploying IS the enablement act, and removing a trigger from `config.yaml` tears it down on the next deploy.
13
13
 
@@ -78,7 +78,7 @@ There is no all-capabilities wildcard; keeping the list explicit makes each agen
78
78
  | `webhooks:write` | Create, modify, delete, or trigger webhooks | High |
79
79
  | `schedules:read` | Read schedule configs and run history | Low |
80
80
  | `schedules:write` | Create, change, or trigger scheduled runs | Critical |
81
- | `fimo:logs:read` | Read production logs | Low |
81
+ | `fimo:logs:read` | Read project deployment logs | Low |
82
82
  | `fimo:analytics:read` | Read analytics data | Low |
83
83
  | `fimo:preview:read` | Read a current preview URL | Low |
84
84
  | `fimo:history:read` | Read project restore points | Low |
@@ -92,6 +92,9 @@ If a capability is missing, the related command is denied and the agent should c
92
92
  blocker. Add the capability to `capabilities.yaml`, run `fimo agents validate <name>`, deploy the bundle, and start a
93
93
  new run. A denied capability does not grant access to anything else.
94
94
 
95
+ Studio chat and project-bound Slack turns receive `fimo:logs:read`. Autonomous agents receive it only when their
96
+ `capabilities.yaml` declares it; use `fimo logs` with the deploy guidance when diagnosing a failed preview.
97
+
95
98
  Example for a content editor that can read and update entries but cannot change schemas:
96
99
 
97
100
  ```yaml
@@ -99,23 +102,23 @@ Example for a content editor that can read and update entries but cannot change
99
102
  - cms:write
100
103
  ```
101
104
 
102
- ## Cloud ops (env-aware)
105
+ ## Cloud ops (Branch-aware)
103
106
 
104
107
  ```bash
105
- fimo agents run <name> [--env <env>] [--project <id>] [--skip-drift-check] [-C <dir>]
106
- fimo agents runs <name> [--limit <n>] [--env <env>] [--project <id>] [-C <dir>]
107
- fimo agents report <name> [--session <id>] [--env <env>] [--project <id>] [-C <dir>]
108
+ fimo agents run <name> [--branch <branch>] [--project <id>] [--skip-drift-check] [-C <dir>]
109
+ fimo agents runs <name> [--limit <n>] [--branch <branch>] [--project <id>] [-C <dir>]
110
+ fimo agents report <name> [--session <id>] [--branch <branch>] [--project <id>] [-C <dir>]
108
111
  fimo agents logs <name> [--session <id>] [--project <id>] [-C <dir>]
109
112
  ```
110
113
 
111
- - **`run <name>`** — fire the agent's `manual` trigger on the server; prints a `sessionId` on success. Skips with `no-manual-trigger` when `config.yaml` declares none, or `trigger-not-wired` when the push-to-main sync recorded the trigger but refused to wire it (see the wiring note below). **Pre-flight drift check**: if `.fimo/agents/<name>/` (or the legacy root bundle) has uncommitted git changes, the command refuses — the server would dispatch the _deployed_ version, so deploy first. Pass `--skip-drift-check` to dispatch the deployed bundle anyway. Defaults `--env` to `main`.
112
- - **`runs <name>`** — list past run sessions for the agent in a compact table (id, started, duration, status, trigger, env, cost). Default `--limit 20`; `--env` filters to one env.
113
- - **`report <name>`** — print a run's **report**: the agent's final message, captured when the run finishes (for a read-only agent like `seo-audit` this _is_ the audit; for a write agent it's a "what I changed" summary). With no `--session`, the most recent run for `<name>` is used (combine with `--env` to scope); `--session <id>` targets a specific run. Output is raw markdown, so it stays readable in the terminal and pipes cleanly (e.g. `fimo agents report seo-audit | glow`). If the run hasn't finished, or produced no message, it says so (and shows the stop reason when there is one). This is the command to read what a run actually produced — see the `logs` note below.
114
+ - **`run <name>`** — fire the agent's `manual` trigger on the server; prints a `sessionId` on success. Skips with `no-manual-trigger` when `config.yaml` declares none, or `trigger-not-wired` when the push-to-main sync recorded the trigger but refused to wire it (see the wiring note below). **Pre-flight drift check**: if `.fimo/agents/<name>/` (or the legacy root bundle) has uncommitted git changes, the command refuses — the server would dispatch the _deployed_ version, so deploy first. Pass `--skip-drift-check` to dispatch the deployed bundle anyway. Defaults `--branch` to `main`; legacy `--env` remains an alias.
115
+ - **`runs <name>`** — list past run sessions for the agent in a compact table (id, started, duration, status, trigger, Branch, cost). Default `--limit 20`; `--branch` filters to one Branch. The response's legacy `env` field is still present for API compatibility.
116
+ - **`report <name>`** — print a run's **report**: the agent's final message, captured when the run finishes (for a read-only agent like `seo-audit` this _is_ the audit; for a write agent it's a "what I changed" summary). With no `--session`, the most recent run for `<name>` is used (combine with `--branch` to scope); `--session <id>` targets a specific run. Output is raw markdown, so it stays readable in the terminal and pipes cleanly (e.g. `fimo agents report seo-audit | glow`). If the run hasn't finished, or produced no message, it says so (and shows the stop reason when there is one). This is the command to read what a run actually produced — see the `logs` note below.
114
117
  - **`logs <name>`** — stream a run's log (defaults to the latest session; `--session <id>` targets one). **Note:** the log-streaming endpoint is still a server-side stub at time of writing — the command prints a placeholder rather than real log lines. To read a finished run's output today, use `report`.
115
118
 
116
119
  ## How triggers get wired
117
120
 
118
- Agents are not env-scoped: they belong to the project, are read from `main`, and their triggers are global. A branch env has no agents of its own — Studio's agents view shows main's agents whichever env you are on, and a bundle sitting only on a feature branch appears nowhere until it reaches main.
121
+ Agents are not Branch-scoped: they belong to the project, are read from `main`, and their triggers are global. A Branch has no agents of its own — Studio's agents view shows main's agents whichever Branch you are on, and a bundle sitting only on a feature Branch appears nowhere until it reaches main.
119
122
 
120
123
  Pushing `.fimo/agents/<name>/config.yaml` (or a legacy root bundle) to `main` is the whole enablement act — `fimo deploy` does it. The server reconciles the file into its trigger rows on every push: a `schedule` trigger gets a cron, a `webhook` trigger gets its path, and `manual` becomes runnable. Removing a trigger from the file deletes it (cron torn down, path released) on the next deploy; deleting the agent's directory removes the whole deployment.
121
124
 
@@ -1,48 +1,49 @@
1
- # Envs &amp; branches (git-shaped workflow)
1
+ # Branches (git-shaped workflow)
2
2
 
3
- > **Beta:** Branch environments are still in beta. The CLI surface is available for early workflows, but not every command or cross-surface merge path is guaranteed to work reliably yet.
3
+ > **Beta:** Branches are still in beta. The CLI surface is available for early workflows, but not every command or cross-surface merge path is guaranteed to work reliably yet.
4
4
 
5
- A Fimo **env** is a multi-surface clone of the project: a git branch **plus** its own Neon DB branch, sandbox, preview URL, and R2 asset prefix. The CLI mirrors `git` command shapes so the workflow transfers directly — same verbs, multi-surface semantics.
5
+ A Fimo **Branch** is a multi-surface clone of the project: a git branch **plus** its own Neon DB branch, sandbox, preview URL, and R2 asset prefix. The CLI mirrors `git` command shapes so the workflow transfers directly — same verbs, multi-surface semantics. In Project Settings, an **Environment** is a grouping policy such as Production or Preview; it is not this Branch-backed clone.
6
6
 
7
- Every project starts with one env: `main`. You create more for feature work, deploy previews per-env, then merge back and publish.
7
+ Every project starts with one Branch: `main`. You create more for feature work, deploy previews per Branch, then merge back and publish.
8
8
 
9
- ## The env model — how every command picks its target
9
+ ## The Branch model — how every command picks its target
10
10
 
11
- **This is the single most important concept: project-scoped commands target the env of the _current git branch_.** When you're on git branch `feat/seo`, `fimo deploy`, `fimo status`, `fimo entries list`, etc. all operate on the `feat/seo` env's DB / sandbox / preview. The CLI prints a one-line stderr banner telling you which env it resolved.
11
+ **This is the single most important concept: project-scoped commands target the Branch matching the _current git branch_.** When you're on git branch `feat/seo`, `fimo deploy`, `fimo status`, `fimo entries list`, etc. all operate on the `feat/seo` Branch's DB / sandbox / preview. The CLI prints a one-line stderr banner telling you which Branch it resolved.
12
12
 
13
13
  ```bash
14
- fimo --env <name> <command> # peek at another env for one command (does not switch)
14
+ fimo --branch <name> <command> # peek at another Branch for one command (does not switch)
15
15
  ```
16
16
 
17
- - **`--env <name>`** is a global override. `fimo --env main status` inspects `main` while you stay checked out on your feature branch.
17
+ - **`--branch <name>`** is the canonical global override. `fimo --branch main status` inspects `main` while you stay checked out on your feature Branch.
18
+ - **`--env <name>`** remains a compatibility alias for `--branch`; it still carries the legacy `env` wire name.
18
19
  - Git-changing commands use the current branch; cross-branch status only reports the mismatch.
19
- - If the branch maps to no env, the CLI errors with a hint (`fimo branch` to list, `fimo branch <name>` to create) rather than guessing.
20
- - **`main`** is the default env and cannot be deleted.
21
- - **`release/*`** envs are **read-only** — they're tags produced by `fimo publish`, not branches you push to. `fimo deploy` refuses them.
20
+ - If the git branch maps to no Fimo Branch, the CLI errors with a hint (`fimo branch` to list, `fimo branch <name>` to create) rather than guessing.
21
+ - **`main`** is the default Branch and cannot be deleted.
22
+ - **`release/*`** Branches are **read-only** — they're tags produced by `fimo publish`, not branches you push to. `fimo deploy` refuses them.
22
23
  - **`prod`** is protected: it cannot be created, forked from, checked out, or deleted. It's updated by publishing, never by pushing.
23
24
 
24
25
  ## Commands
25
26
 
26
- | Command | git analogue | What it does |
27
- | ----------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28
- | `fimo branch` | `git branch` | List envs (current marked `*`). `-v` adds preview URLs + deleted envs. |
29
- | `fimo branch <name>` | `git branch <name>` | Create an env off the current one. `--from <env>` forks from a different parent. Provisions DB + sandbox + preview + R2 prefix. |
30
- | `fimo branch -d <name>` | `git branch -d` | Delete an env — tears down its sandbox, Neon branch, and R2 prefix. Refuses `main` and `prod`. |
31
- | `fimo checkout <name>` | `git checkout` | Switch to an env (checks out the matching git branch; the app derives its env from that branch at startup). `-b` creates + switches; `--from <env>` sets the parent (with `-b`). |
32
- | `fimo switch <name>` | `git switch` | Switch to an existing env. Takes only `<name>` (no `-b`/`--from`) — use `fimo checkout -b` to create + switch. |
33
- | `fimo pull` | `git pull` | Sync the current env's data plane (DB/assets) down from its parent. `--from <env>` syncs from an explicit ancestor. |
34
- | `fimo diff [from] [to]` | `git diff` | Two-env diff across all surfaces. Defaults `from` = current env, `to` = `main`. `--surface <name>` limits to one; `--json`; `--no-color`. |
35
- | `fimo status` | `git status` | Multi-surface status for the current env vs its parent. See below. |
36
- | `fimo merge <from>` | `git merge` | Merge another env into the current one (multi-surface, atomic, interactive conflict resolver). See below. |
37
- | `fimo publish` | — | Tag `main@HEAD` as `release/<version>` and trigger the prod swap. See "Publishing" below. |
27
+ | Command | git analogue | What it does |
28
+ | ----------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
+ | `fimo branch` | `git branch` | List Branches (current marked `*`). `-v` includes deleted Branches. |
30
+ | `fimo branch <name>` | `git branch <name>` | Create a Branch off the current one. `--from <branch>` forks from a different parent. Provisions DB + sandbox + preview + R2 prefix. |
31
+ | `fimo branch -d <name>` | `git branch -d` | Delete a Branch — tears down its sandbox, Neon branch, and R2 prefix. Refuses `main` and `prod`. |
32
+ | `fimo checkout <name>` | `git checkout` | Switch to a Branch (checks out the matching git branch; the app derives its Branch from that branch at startup). `-b` creates + switches; `--from <branch>` sets the parent. |
33
+ | `fimo switch <name>` | `git switch` | Switch to an existing Branch. Takes only `<name>` (no `-b`/`--from`) — use `fimo checkout -b` to create + switch. |
34
+ | `fimo pull` | `git pull` | Sync the current Branch's data plane (DB/assets) down from its parent. `--from <branch>` syncs from an explicit ancestor. |
35
+ | `fimo diff [from] [to]` | `git diff` | Two-Branch diff across all surfaces. Defaults `from` = current Branch, `to` = `main`. `--surface <name>` limits to one; `--json`; `--no-color`. |
36
+ | `fimo status` | `git status` | Multi-surface status for the current Branch vs its parent. See below. |
37
+ | `fimo merge <from>` | `git merge` | Merge another Branch into the current one (multi-surface, atomic, interactive conflict resolver). See below. |
38
+ | `fimo publish` | — | Tag `main@HEAD` as `release/<version>` and trigger the prod swap. See "Publishing" below. |
38
39
 
39
- All of these accept the global `--env` override. `diff`, `status`, `merge`, and `publish` additionally accept `-C, --cwd <dir>` to point at a project directory.
40
+ All of these accept the global `--branch` override; legacy `--env` remains an alias. `diff`, `status`, `merge`, and `publish` additionally accept `-C, --cwd <dir>` to point at a project directory.
40
41
 
41
- > **`fimo switch` is the ENV switcher, not the org switcher.** To change your active organization, use `fimo orgs switch` — see `references/account.md`.
42
+ > **`fimo switch` changes the active Fimo Branch, not the org.** A Fimo Branch keeps its code, database, sandbox, content, and preview together. To change your active organization, use `fimo orgs switch` — see `references/account.md`.
42
43
 
43
44
  ## The 6 surfaces
44
45
 
45
- `status`, `diff`, and `merge` all reason over the same per-env surfaces, in this order:
46
+ `status`, `diff`, and `merge` all reason over the same per-Branch surfaces, in this order:
46
47
 
47
48
  `code` · `schemas` · `content` · `translations` · `assets` · `forms`
48
49
 
@@ -51,25 +52,25 @@ All of these accept the global `--env` override. `diff`, `status`, `merge`, and
51
52
  ## Typical PR-style flow
52
53
 
53
54
  ```bash
54
- fimo checkout -b feat/seo # branch off main: git branch + env provisioned
55
+ fimo checkout -b feat/seo # branch off main: git branch + Branch provisioned
55
56
  # …generate / edit code, schemas, content, translations…
56
- fimo deploy -m "feat: seo pass" # deploy a preview of the feat/seo env
57
- fimo preview url # fresh URL to open / screenshot the feat/seo preview
57
+ fimo deploy -m "feat: seo pass" # deploy a preview of the feat/seo Branch
58
+ fimo preview url # canonical URL to open / screenshot the feat/seo preview
58
59
  fimo status # see what changed vs main, surface by surface
59
60
  fimo checkout main # back to main
60
- fimo merge feat/seo # merge the env back into main (resolve conflicts)
61
+ fimo merge feat/seo # merge the Branch back into main (resolve conflicts)
61
62
  fimo publish --version 1.4.0 # tag a release + prod swap
62
- fimo branch -d feat/seo # tear down the feature env
63
+ fimo branch -d feat/seo # tear down the feature Branch
63
64
  ```
64
65
 
65
66
  ## `fimo status`
66
67
 
67
- The showcase command — a unified, color-coded report of what's changed on the current env, grouped by surface, with per-surface counts.
68
+ The showcase command — a unified, color-coded report of what's changed on the current Branch, grouped by surface, with per-surface counts.
68
69
 
69
70
  ```bash
70
- fimo status # full report, current env vs parent (or main)
71
+ fimo status # full report, current Branch vs parent (or main)
71
72
  fimo status --short # one line per surface
72
- fimo status --vs main # compare against an explicit env
73
+ fimo status --vs main # compare against an explicit Branch
73
74
  fimo status --content # only the content surface (combine flags freely)
74
75
  fimo status --json # machine-readable
75
76
  ```
@@ -80,7 +81,7 @@ fimo status --json # machine-readable
80
81
  ## `fimo merge`
81
82
 
82
83
  ```bash
83
- fimo merge feat/seo # merge feat/seo into the current env
84
+ fimo merge feat/seo # merge feat/seo into the current Branch
84
85
  fimo merge feat/seo -y # non-interactive: parent-wins on every conflict
85
86
  fimo merge feat/seo --allow-direct-merge # override the "don't merge straight onto main" gate
86
87
  ```
@@ -90,7 +91,7 @@ fimo merge feat/seo --allow-direct-merge # override the "don't merge straight
90
91
 
91
92
  ## `fimo pull`
92
93
 
93
- Syncs the current env's data plane from its parent (or `--from <ancestor>`). Conflicts currently resolve **parent-wins** automatically (a future release adds per-row picks). Use it to refresh a stale feature env with the latest `main` content/schema state.
94
+ Syncs the current Branch's data plane from its parent (or `--from <ancestor>`). Conflicts currently resolve **parent-wins** automatically (a future release adds per-row picks). Use it to refresh a stale feature Branch with the latest `main` content/schema state.
94
95
 
95
96
  ## Publishing — `fimo publish` vs `fimo deploy --publish`
96
97
 
@@ -103,8 +104,8 @@ Use `fimo publish` for versioned prod releases; use `fimo deploy --publish` for
103
104
 
104
105
  ## Anti-patterns
105
106
 
106
- - **Using `git checkout -b` instead of `fimo checkout -b`** — raw git creates the branch but **not** the env's DB / sandbox / preview. Always use `fimo` for branch operations so resources are provisioned atomically. (Running `fimo branch <name>` after the fact provisions them.) The running app itself follows the git branch either way.
107
+ - **Using `git checkout -b` instead of `fimo checkout -b`** — raw git creates the branch but **not** the Branch's DB / sandbox / preview. Always use `fimo` for Branch operations so resources are provisioned atomically. (Running `fimo branch <name>` after the fact provisions them.) The running app itself follows the git branch either way.
107
108
  - **Hardcoding the tenant API URL** — the app derives it from the git branch and `.fimo/project.json`. Set `VITE_API_URL` / `NEXT_PUBLIC_FIMO_API_URL` yourself only as a deliberate override (e.g. a local API); it then wins over derivation on every branch.
108
109
  - **Trying to push to or delete `prod` / `release/*`** — these are read-only/protected. Publish to update prod; never push.
109
110
  - **`fimo merge` straight onto `main` as a habit** — it's gated for a reason. Merge on a branch, then publish.
110
- - **Confusing `fimo switch` (env) with `fimo orgs switch` (org).**
111
+ - **Confusing `fimo switch` (Branch) with `fimo orgs switch` (org).**
@@ -2,12 +2,12 @@
2
2
 
3
3
  > Package contract: load the version-locked `fimo-code` skill with `fimo skills get fimo-code`, then fetch its nested content and detected-framework references for schema JSON, entry values, generated clients, and imports.
4
4
 
5
- This file covers the **CLI workflow** for content. Use it when the user wants to add a content type (blog, products, pages) or manage Singles and entries.
5
+ This file covers the **CLI workflow** for content schemas, Singles, and entries. Use it when the user wants to add a content type (blog, products, reusable content) or manage content records. For route metadata shown in Studio Pages, load `references/pages.md`.
6
6
 
7
7
  ## Choose the write path first
8
8
 
9
9
  - Exactly one homepage, settings document, About page, or campaign page → declare `"isSingleton": true` and write it with `fimo singles update <TypeName>`.
10
- - Repeated posts, products, team members, or reusable pages → keep a collection and create rows with `fimo entries create <TypeName>`.
10
+ - Repeated posts, products, team members, or other reusable records → keep a collection and create rows with `fimo entries create <TypeName>`.
11
11
 
12
12
  Never remove `isSingleton: true` merely because `fimo entries create` rejects the type. `entries` and `singles` are separate command namespaces; inspect `fimo singles --help` when the content is one-off.
13
13
 
@@ -9,7 +9,7 @@ fimo credits --project <project-id>
9
9
  fimo credits -C ./path/to/project
10
10
  ```
11
11
 
12
- This command is **project-scoped but not env-scoped**. It does not depend on the current git branch or `--env`, because credits belong to the project's organization, not to a branch/env.
12
+ This command is **project-scoped but not Branch-scoped**. It does not depend on the current git branch or `--branch`, because credits belong to the project's organization, not to a Branch.
13
13
 
14
14
  ## Pretty Output
15
15
 
@@ -1,14 +1,14 @@
1
1
  # Deploy pipeline
2
2
 
3
- **`fimo deploy` is on-demand, not the working loop and not a required final step.** The loop is local: run the app with the project's package-manager `dev` script (`pnpm dev` / `npm run dev` / `yarn dev` / `bun dev` — match the lockfile), iterate with the developer, and let live reload show changes. Reach for `fimo deploy` only when the developer wants a **hosted preview**, a **shareable link**, or to **go live** — and only on their signal. New-project onboarding counts as the signal for its single automatic first preview deploy (see `references/init.md` § Create the first hosted preview). It commits everything, pushes to the current env's branch, and round-trips that env's sandbox (install + restart); it's a milestone command, not a save step. Batch related edits into one deploy; never deploy after every change.
3
+ **`fimo deploy` is on-demand, not the working loop and not a required final step.** The loop is local: run the app with the project's package-manager `dev` script (`pnpm dev` / `npm run dev` / `yarn dev` / `bun dev` — match the lockfile), iterate with the developer, and let live reload show changes. Reach for `fimo deploy` only when the developer wants a **hosted preview**, a **project-member preview link**, or to **go live** — and only on their signal. New-project onboarding counts as the signal for its single automatic first preview deploy (see `references/init.md` § Create the first hosted preview). It commits everything, pushes to the current Branch, and round-trips that Branch's sandbox (install + restart); it's a milestone command, not a save step. Batch related edits into one deploy; never deploy after every change.
4
4
 
5
- > **Local vs hosted.** The local dev server is localhost only. The Fimo **dashboard preview** and the **shareable preview URL** are served by the deployed sandbox — so if the developer wants to see the site in the dashboard or send someone a link, that requires a `fimo deploy`.
5
+ > **Local vs hosted.** The local dev server is localhost only. The Fimo **dashboard preview** and the authenticated **project-member preview URL** are served by the deployed sandbox — so if the developer wants to see the site in the dashboard or send another project member a link, that requires a `fimo deploy`.
6
6
 
7
- `fimo deploy` uses the current branch. New projects start on `main`; `release/*` is read-only, and `--publish` only runs from `main`. See `references/branches.md` for the multi-env workflow.
7
+ `fimo deploy` uses the current Branch. New projects start on `main`; `release/*` is read-only, and `--publish` only runs from `main`. See `references/branches.md` for the multi-Branch workflow.
8
8
 
9
9
  Before deploying, Fimo fast-forwards a clean checkout that is behind and stops on dirty-behind or diverged branches. This syncs the whole branch, including config commits from Studio or locale commands.
10
10
 
11
- > **Just need the current preview URL?** That's `fimo preview url` — sub-second, no commit, no push. See `references/preview.md`. `fimo deploy` is only for pushing code changes.
11
+ > **Just need the current preview URL?** That's `fimo preview url` — no commit or push. A cold sandbox can still take time to resolve. See `references/preview.md`. `fimo deploy` is only for pushing code changes.
12
12
 
13
13
  ## Commands
14
14
 
@@ -19,7 +19,7 @@ fimo deploy --no-restart # skip dev-server restart (HMR-safe
19
19
  fimo deploy -m "<commit message>" --publish # also publish a new live version
20
20
  ```
21
21
 
22
- - **`fimo deploy`** — commits pending changes, pushes to the current env's branch, syncs that env's preview sandbox, and links to the Preview and Fimo dashboard.
22
+ - **`fimo deploy`** — commits pending changes, pushes to the current Branch, syncs that Branch's preview sandbox, and links to the Preview and Fimo dashboard.
23
23
  - **`fimo deploy --publish`** — same as above, then triggers a live publish and prints the live URL. Runs from `main` only. **Only use `--publish` when the user signals "ship it"** — first-time site completion, or an explicit "publish" / "go live" request. Otherwise stick to plain `fimo deploy`. (For a _versioned_ prod release, use `fimo publish` instead — see below.)
24
24
  - **`-m`** is the commit message used when there are uncommitted local changes; required in non-interactive shells. Omit if the working tree is already clean.
25
25
  - **`--no-restart`** — tells the sandbox to skip the dev-server restart and let Vite HMR pick up the change. Shaves ~3s per deploy. See "Skipping the dev-server restart" below for when it's safe.
@@ -35,15 +35,26 @@ fimo deploy -m "<commit message>" --publish --json
35
35
 
36
36
  Read these fields from `data`:
37
37
 
38
- | Field | Destination |
39
- | --------------- | ----------------------------------------------------------- |
40
- | `preview_url` | Shareable preview. Its token expires, so do not persist it. |
41
- | `dashboard_url` | Stable, authenticated Fimo project and environment page. |
42
- | `app_url` | Public live site, returned after a successful `--publish`. |
38
+ | Field | Destination |
39
+ | -------------------- | ---------------------------------------------------------------- |
40
+ | `preview_url` | Stable, authenticated full-screen viewer for project members. |
41
+ | `sandbox_url` | Short-lived raw site URL for agents, curl, and screenshot tools. |
42
+ | `sandbox_expires_at` | Expiry of the raw sandbox URL. |
43
+ | `studio_url` | Stable, authenticated Fimo Studio project and Branch page. |
44
+ | `dashboard_url` | Deprecated compatibility alias for `studio_url`. |
45
+ | `app_url` | Public live site, returned after a successful `--publish`. |
43
46
 
44
- When reporting the result, present the raw values as named Markdown links. If no code changed and you only need fresh destinations, use `fimo preview url --json` instead of deploying again.
47
+ When reporting the result, open `preview_url` for a person and use `sandbox_url` for machine reads. If no code changed and you only need fresh destinations, use `fimo preview url --json` instead of deploying again.
45
48
 
46
- Public project variables managed with `fimo vars add` and `fimo vars update` are injected into preview/build/deploy environments. Project secrets are not injected into app builds; agents request secrets separately through their own config. See `references/project-vars-and-secrets.md`.
49
+ Public project variables managed with `fimo vars add` and `fimo vars update` are injected into preview/build/deploy runtimes. Project secrets are not injected into app builds; agents request secrets separately through their own config. See `references/project-vars-and-secrets.md`.
50
+
51
+ ## Diagnose a failed publication
52
+
53
+ Use the publication ID returned by the failed command: run `fimo publish inspect <id> --json` for its durable status, then `fimo publish logs <id> --json` for a bounded build-log tail. Logs come from the hosting provider and may be unavailable after its deployment is reclaimed.
54
+
55
+ ## Diagnose a failed preview deploy
56
+
57
+ If the sandbox fails to install dependencies or start the app, run `fimo logs --json` before retrying. Read the newest install and dev-server events first; when the response is truncated, use its `previousCursor` as `fimo logs --before <cursor> --json` to fetch the preceding page. Do not recreate or replace the sandbox before collecting logs, because that can discard the failure evidence.
47
58
 
48
59
  ## Framework hosting
49
60
 
@@ -57,6 +68,9 @@ needed, load the `fimo-code` skill's framework reference:
57
68
  connector and the explicit catch-all used only by plain Vite `BrowserRouter`
58
69
  SPAs; Astro's `fimo()` integration lives in `references/frameworks/astro.md`.
59
70
 
71
+ Redirects, response headers, and URL shape belong in
72
+ `.fimo/config.json#hosting` — see `references/hosting.md`.
73
+
60
74
  ## Warm the sandbox early in a session (optional)
61
75
 
62
76
  This is a **performance optimization, only worth doing when you already know a deploy is coming** (the developer asked to publish, or you're confident they'll want a hosted preview soon). If you're just iterating locally, skip it — don't deploy pre-emptively. New-project onboarding never needs it: its automatic first preview deploy is the warm-up.
@@ -118,12 +132,14 @@ curl -H 'Accept: text/markdown' https://your-site/ # content negotiation
118
132
  curl https://your-site/?format=md # query param
119
133
  ```
120
134
 
135
+ This is a hosting capability: Fimo generates the `.md`, content-negotiation, and `?format=md` responses for supported built pages. Application code must not reimplement any of them — in particular, never add a route that fetches the app's own public URL to convert it to Markdown. For a dynamic page, render Markdown from the same server-side data the page itself uses when the framework supports that; otherwise report the capability as unresolved instead of building a self-fetching route.
136
+
121
137
  ## Recovering from Git drift
122
138
 
123
139
  Most stale states are caught before deploy changes or commits files. Follow the emitted hint: clean a dirty checkout, or reconcile a diverged branch. A push can still lose a race if the remote advances after preflight:
124
140
 
125
141
  ```bash
126
- git pull --rebase fimo <env> # <env> = the branch you're deploying (e.g. main)
142
+ git pull --rebase fimo <branch> # <branch> = the Branch you're deploying (e.g. main)
127
143
  # fix any conflicts
128
144
  fimo deploy
129
145
  ```
@@ -132,7 +148,7 @@ fimo deploy
132
148
 
133
149
  - Source of truth is this git repo.
134
150
  - **Never** edit `.fimo/project.json`; it is generated by `fimo init`.
135
- - Each env deploys to its own branch + preview sandbox; `--publish` and `fimo publish` run from `main` only. See `references/branches.md`.
151
+ - Each Branch deploys to its own preview sandbox; `--publish` and `fimo publish` run from `main` only. See `references/branches.md`.
136
152
 
137
153
  ## After the first successful deploy
138
154