fimo 0.15.0 → 0.16.0-experimental.2

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
@@ -1,8 +1,13 @@
1
1
  # Project History
2
2
 
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.
3
+ History is scoped to the selected project Branch. A restore point records the
4
+ Branch's CMS content and the matching Git commit so code and content can be
5
+ recovered together.
4
6
 
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.
7
+ Fimo also creates restore points automatically after a successful deploy, on the
8
+ destination of a completed Branch merge, and after direct content editing has
9
+ been quiet for 30 seconds. Rapid Studio auto-saves are grouped into one content
10
+ point.
6
11
 
7
12
  ```bash
8
13
  fimo history list
@@ -13,7 +18,9 @@ fimo history restore <version-id>
13
18
 
14
19
  Studio chat can run `history list` and `history show`. Create and restore remain available through the standalone CLI and Studio's History page.
15
20
 
16
- Use the global `--env <name>` option to target a different environment. Use `--project <id>` when there is no local `.fimo/project.json`.
21
+ Use the global `--branch <name>` option to target a different Branch. The legacy
22
+ `--env <name>` spelling remains a compatibility alias. Use `--project <id>` when
23
+ there is no local `.fimo/project.json`.
17
24
 
18
25
  ## Pagination and usage
19
26
 
@@ -27,7 +34,7 @@ The list also reports compressed snapshot usage and the current retention period
27
34
 
28
35
  ## Restore safety
29
36
 
30
- Before replacing code and content, Fimo creates an automatic `restore-safety` point from the environment's current state. Restoring that point is the fast recovery path when the selected result is not what the user expected.
37
+ Before replacing code and content, Fimo creates an automatic `restore-safety` point from the Branch's current state. Restoring that point is the fast recovery path when the selected result is not what the user expected.
31
38
 
32
39
  Pretty mode asks for confirmation. Agents and other non-interactive callers must pass both `--json` and `--yes`:
33
40
 
@@ -37,6 +44,6 @@ fimo --json history restore <version-id> --yes
37
44
 
38
45
  If another history create, update, delete, or restore is already running, the command fails with `HISTORY_BUSY`. Retry after the active history operation finishes. Do not loop without a delay.
39
46
 
40
- If content or Git restore does not finish cleanly, the command fails with `RESTORE_INCOMPLETE` and names the automatic safety point. Stop active editing, inspect the environment, and retry the restore. Collaborative-editor resync continues in the background after code and content are ready.
47
+ If content or Git restore does not finish cleanly, the command fails with `RESTORE_INCOMPLETE` and names the automatic safety point. Stop active editing, inspect the Branch, and retry the restore. Collaborative-editor resync continues in the background after code and content are ready.
41
48
 
42
- Normal CMS requests and Git pushes do not wait for snapshot creation. Their queued restore-point capture takes the history-operation lock later and retries if another History operation is active. Unsaved collaborative-editor changes are not captured. Avoid starting a restore while someone is actively editing the same environment.
49
+ Normal CMS requests and Git pushes do not wait for snapshot creation. Their queued restore-point capture takes the history-operation lock later and retries if another History operation is active. Unsaved collaborative-editor changes are not captured. Avoid starting a restore while someone is actively editing the same Branch.
@@ -0,0 +1,114 @@
1
+ # Hosting: how a published project is served
2
+
3
+ Declare redirects, headers, rewrites, and URL shape in
4
+ `.fimo/config.json#hosting`. This is the only place Fimo reads them from.
5
+
6
+ ## Fields
7
+
8
+ ```json
9
+ {
10
+ "hosting": {
11
+ "redirects": [{ "source": "/", "destination": "/fr", "permanent": false }],
12
+ "rewrites": [{ "source": "/blog/:slug", "destination": "/posts/:slug" }],
13
+ "headers": [
14
+ {
15
+ "source": "/(.*)",
16
+ "headers": [{ "key": "X-Frame-Options", "value": "DENY" }]
17
+ }
18
+ ],
19
+ "cleanUrls": true,
20
+ "trailingSlash": false
21
+ }
22
+ }
23
+ ```
24
+
25
+ | Field | Effect |
26
+ | --------------- | ------------------------------------------------------------------- |
27
+ | `redirects` | Send the browser elsewhere. `permanent: true` is 308, otherwise 307 |
28
+ | ↳ `statusCode` | Use instead of `permanent` for an exact 301, 302, 307, or 308 |
29
+ | `rewrites` | Serve a different path without changing the URL |
30
+ | `headers` | Add response headers on matching paths |
31
+ | `cleanUrls` | Serve `/about` for `/about.html` and 308 the extension away |
32
+ | `trailingSlash` | `true` requires a trailing slash, `false` forbids one |
33
+
34
+ Every field is optional. Only what you declare is emitted.
35
+
36
+ ## Matching
37
+
38
+ `source` matches the pathname only, never the query string.
39
+
40
+ | Pattern | Matches |
41
+ | --------------- | -------------------------------------- |
42
+ | `/about` | exactly that path |
43
+ | `/blog/:slug` | one segment, captured as `slug` |
44
+ | `/proxy/:rest*` | any number of segments, including none |
45
+ | `/(.*)` | everything |
46
+
47
+ Captured names are reusable in `destination`: `/blog/:slug` →
48
+ `/posts/:slug`. `destination` may be an absolute path or an external URL.
49
+
50
+ ## Conditions
51
+
52
+ Any redirect, rewrite, or header rule can require more than a path match. `has`
53
+ applies the rule only when every condition holds; `missing` only when none of
54
+ them are present.
55
+
56
+ ```json
57
+ {
58
+ "redirects": [
59
+ {
60
+ "source": "/(.*)",
61
+ "has": [{ "type": "header", "key": "x-vercel-ip-country", "value": "GB" }],
62
+ "destination": "/uk/:path*"
63
+ }
64
+ ],
65
+ "rewrites": [
66
+ {
67
+ "source": "/",
68
+ "missing": [{ "type": "cookie", "key": "consent" }],
69
+ "destination": "/consent"
70
+ }
71
+ ]
72
+ }
73
+ ```
74
+
75
+ | `type` | Matches on |
76
+ | -------- | ---------------------------------------------------- |
77
+ | `header` | a request header, including CDN-injected geo headers |
78
+ | `cookie` | a cookie |
79
+ | `query` | a query parameter |
80
+ | `host` | the hostname the request arrived on — takes no `key` |
81
+
82
+ Omit `value` to match on presence alone, as the `consent` cookie above does.
83
+
84
+ **Prefer doing this in the application when it can.** Middleware, a loader, or a
85
+ server component can be run and tested locally; a condition here only takes
86
+ effect once published, so a mistake is found in production. Reach for `has` when
87
+ the app cannot act — a redirect that must happen before any code runs, or a
88
+ header on a static asset.
89
+
90
+ ## Rules
91
+
92
+ - **Prefer the framework's own router.** Use `hosting` for what the router
93
+ cannot express: cross-origin moves, security headers, host-level URL shape.
94
+ Do not mirror `.fimo/config.json#routes` here.
95
+ - **`permanent: true` is cached by browsers and hard to take back.** Omitting it
96
+ gives a temporary redirect, which is the one you can change your mind about.
97
+ Set it only when the old URL is genuinely retired. Reach for `statusCode` only
98
+ when you need a literal 301 or 302; it wins over `permanent`.
99
+ - **With `cleanUrls: true`, drop the extension everywhere.** A `source` or
100
+ `destination` of `/about.html` will not match; write `/about`.
101
+ - **Set `trailingSlash` on any site with more than one page.** Leaving it unset
102
+ serves `/about` and `/about/` as separate URLs, which search engines index as
103
+ duplicates.
104
+ - **An empty `hosting: {}` means no platform routing**, which is different from
105
+ omitting `hosting` entirely — that leaves legacy SPA behaviour untouched.
106
+ - **Not supported:** cron jobs (use `fimo schedules`), image optimization (use
107
+ Fimo media), per-function runtime settings, deployment regions.
108
+
109
+ ## Verify
110
+
111
+ `fimo validate` rejects an unknown `hosting` key, so a typo fails locally
112
+ rather than silently doing nothing in production. Behaviour itself only takes
113
+ effect once published — check the live URL after `fimo deploy --publish`, not
114
+ the preview.
@@ -20,7 +20,8 @@ fimo init [dir] [options]
20
20
  | `[dir]` positional | yes in non-TTY for create-new | Target directory (e.g. `my-site`) |
21
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. |
22
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. |
23
- | `--env <name>` | no | Env to check out when linking an existing project (defaults to `main`). |
23
+ | `--branch <name>` | no | Branch to check out when linking an existing project (defaults to `main`). |
24
+ | `--env <name>` | no | Compatibility alias for `--branch <name>`. |
24
25
  | `--framework <framework>` | no | New-project scaffold: `react-router` (default), `astro`, `nextjs` (App Router), or `sveltekit`. Existing repositories are preserved. |
25
26
  | `--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`. |
26
27
  | `--package-manager <pm>` | no | `npm` \| `pnpm` \| `yarn` \| `bun`. |
@@ -71,17 +72,27 @@ fimo init my-svelte-site --framework sveltekit --org <organizationId>
71
72
  ```
72
73
 
73
74
  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.
75
+ `.fimo/config.json#runtime.framework`, plus an application-owned optional locale
76
+ boundary that keeps the default locale unprefixed. The Astro shell also includes a minimal
77
+ content-backed example with static, on-demand, and dynamic routes; the other shells intentionally
78
+ contain no schema, labels, or designed website.
79
+
80
+ Set the primary locale from the request: when several are explicitly named, use the first as default;
81
+ if none is requested, keep `en` and tell the user. Update `.fimo/config.json#i18n`, the framework-native
82
+ locale boundary, matcher, and HTML language default. Do not keep `en` solely because the shell starts
83
+ there. Do not add `/en`, a language picker, global path-prefix configuration, or localized schemas unless
84
+ the site needs them.
77
85
  After init, load the project rules and `fimo-code` to build the requested site.
86
+ If you replace a shell's code with a site that uses another framework or none,
87
+ fix `runtime.framework` in the same change
88
+ (`fimo-code` → `references/frameworks/hosting.md`).
78
89
  The current `fimo-site@1` content starter supports React Router only.
79
90
 
80
91
  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
92
 
82
93
  ## Setting up a project by ID
83
94
 
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.
95
+ 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 `--branch <name>` to check out a specific Branch (defaults to `main`); `--env <name>` remains a compatibility alias. Without `--project-id`, `fimo init` creates a new project.
85
96
 
86
97
  ## What gets written (create-new path)
87
98
 
@@ -89,7 +100,7 @@ Pass `--project-id <id>` to set up a known Fimo project. If the project has no c
89
100
 
90
101
  - 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
102
  - `.fimo/project.json` — links this directory to the remote project (read-only after creation)
92
- - `.fimo/config.json` — project, route, locale, SEO, and agent policy
103
+ - `.fimo/config.json` — project, optional Studio Pages route metadata, locale, SEO, and agent policy
93
104
  - `.fimo/agents/` — versioned agent bundles
94
105
  - `.env` — framework-specific tenant content API URLs for local development
95
106
  - `AGENTS.md` + `CLAUDE.md` — project rules (from the template) read by AGENTS.md-compatible tools and Claude Code. Both point the agent at `fimo skills get` to load the real skills on demand.
@@ -124,7 +135,7 @@ fimo rename "Acme Coffee"
124
135
  pnpm dev & # or npm run dev / yarn dev / bun dev — the project's package manager
125
136
  ```
126
137
 
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.
138
+ Outside the first-preview path below, when a unit of work looks done, **offer** to deploy (`fimo deploy` for a hosted project preview, `fimo deploy --publish` to go live) and run it only after the developer confirms.
128
139
 
129
140
  ## Load the project context
130
141
 
@@ -148,7 +159,7 @@ Whenever `fimo init` created or scaffolded a new project — including a Studio-
148
159
  fimo deploy -m "chore: first preview" --json
149
160
  ```
150
161
 
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.
162
+ `-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.studio_url` from the envelope and return both links. `data.dashboard_url` remains a deprecated compatibility alias for `data.studio_url`. 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
163
 
153
164
  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
165
 
@@ -247,3 +247,5 @@ Visual/content QA before publish:
247
247
  ```bash
248
248
  fimo integrations run firecrawl scrape --url "$(fimo preview url)" --formats markdown,links --json
249
249
  ```
250
+
251
+ Because command substitution captures stdout, `fimo preview url` emits the raw `sandbox_url` in this example. For JSON workflows, pass `data.sandbox_url` to Firecrawl and refresh it after `data.sandbox_expires_at`. The stable `data.preview_url` is an authenticated browser viewer and is not the Firecrawl destination.
@@ -15,21 +15,17 @@ fimo locales remove es --yes --json
15
15
 
16
16
  Studio chat can run `locales list`. Manage the locale lifecycle through Studio Settings or the standalone CLI.
17
17
 
18
- These commands update the selected environment through the locale lifecycle API. The API commits `.fimo/config.json` to the Fimo branch, then the CLI synchronizes the **whole local branch** to that commit. They refuse a dirty config, a local-ahead branch, or a diverged branch before applying the remote change. `--yes` bypasses only the explanatory prompt.
18
+ These commands update the selected Branch through the locale lifecycle API. The API commits `.fimo/config.json` to the Fimo Branch, then the CLI synchronizes the **whole local branch** to that commit. They refuse a dirty config, a local-ahead branch, or a diverged branch before applying the remote change. `--yes` bypasses only the explanatory prompt.
19
19
 
20
20
  If a mutation exits with code `2` and `data.code` is `LOCALE_APPLIED_SYNC_REQUIRED`, the remote operation succeeded (`data.applied` is `true`) but the local fast-forward did not. **Do not retry the locale command.** Run the commands in `data.sync.recovery`, resolve the checkout, and confirm with `fimo status` or `fimo locales list`.
21
21
 
22
- Edit `.fimo/config.json` only for declarative routing behavior:
22
+ Edit `.fimo/config.json` only for declarative locale and route metadata:
23
23
 
24
24
  ```jsonc
25
25
  {
26
26
  "i18n": {
27
27
  "defaultLocale": "en",
28
28
  "locales": ["en"],
29
- "routing": {
30
- "strategy": "path-prefix", // only supported strategy: /es/about for Spanish; default locale can stay /about
31
- "prefixDefaultLocale": false, // when false, omit /en for the default locale
32
- },
33
29
  },
34
30
  }
35
31
  ```
@@ -37,7 +33,7 @@ Edit `.fimo/config.json` only for declarative routing behavior:
37
33
  - `defaultLocale` is the locale used by `fimo validate`, `fimo labels set` without `--locale`, and content commands without `--locale`. Change it with `fimo locales set-default`.
38
34
  - `locales` must include `defaultLocale`. Add and remove values with `fimo locales add` and `fimo locales remove`.
39
35
  - Locale tags should be structurally valid, for example `en`, `es`, `pt-BR`, or `zh-Hans`.
40
- - `routing.strategy` currently supports `path-prefix`.
36
+ - New projects do not need a global routing strategy. The route contract declares locale placement with `/:locale`; legacy `i18n.routing.strategy` values are read only for compatibility while migrating.
41
37
  - If multiple locales are configured, create or update labels and localized content for every configured locale. Create schemas with `i18n: { "enabled": false }` only once.
42
38
 
43
39
  `fimo locales remove` permanently deletes that locale's stored entries and labels.
@@ -55,38 +51,66 @@ Validation checks:
55
51
  - malformed locale tags
56
52
  - `defaultLocale` missing from `locales`
57
53
  - unsupported routing strategies
58
- - canonical routes in `.fimo/config.json` that claim reserved locale prefixes, for example `/es`
59
- - top-level dynamic routes that could capture locale prefixes unless the project uses Fimo's React Router helper
54
+ - routes in `.fimo/config.json` that hardcode a locale prefix, for example `/es/pricing`
55
+ - two routes that answer the same URL once the locale segment is removed
56
+ - a `:locale` segment that is not first, or that declares `schema`, `queryField`, `displayField`
57
+ - an entry param declared `optional`, or missing `schema` / `queryField`
58
+ - top-level dynamic routes other than `:locale` that could capture locale prefixes
60
59
  - missing default-locale DB labels
61
60
 
62
61
  ## Route Metadata Rule
63
62
 
64
- Keep `.fimo/config.json#routes` canonical and unlocalized:
63
+ Write the locale into a route's path with the reserved `:locale` segment, never as a literal prefix. The descriptor `type` is optional: `locale` infers `"locale"`, while every other parameter defaults to `"entry"`:
65
64
 
66
65
  ```json
67
66
  {
68
67
  "routes": {
68
+ "blog-post": {
69
+ "label": "Blog post",
70
+ "path": "/:locale/blog/:slug",
71
+ "params": {
72
+ "locale": { "type": "locale", "optional": true },
73
+ "slug": { "schema": "BlogPost", "queryField": "slug", "displayField": "title" }
74
+ }
75
+ },
69
76
  "pricing": {
70
77
  "label": "Pricing",
71
- "path": "/pricing"
78
+ "path": "/:locale/pricing",
79
+ "params": { "locale": { "type": "locale", "optional": true } }
72
80
  }
73
81
  }
74
82
  }
75
83
  ```
76
84
 
77
- Do not add `/es/pricing` as a second Fimo route. The route selector localizes canonical routes for the active preview locale. In React Router projects, use the package helper:
85
+ | Declared path | `params.locale` | URLs the route answers |
86
+ | --------------------- | ----------------------------------------- | --------------------------------------------------- |
87
+ | `/:locale/blog/:slug` | omitted | `/blog/hello` for `en`, `/fr/blog/bonjour` for `fr` |
88
+ | `/:locale/blog/:slug` | `{ "type": "locale", "optional": false }` | `/en/blog/hello` and `/fr/blog/bonjour` |
89
+ | `/:locale/pricing` | omitted | `/pricing` for `en`, `/fr/pricing` for `fr` |
90
+
91
+ - `locale` is reserved. It is read from the URL, so it never takes `schema` or `queryField` and never becomes a CMS query. Every other param is content-backed and needs both.
92
+ - `optional: true` means omit the configured default locale from the URL. With `i18n.defaultLocale: "en"`, `/pricing` is English and `/fr/pricing` is French.
93
+ - `optional: false` prefixes every locale, including the default (`/en/pricing` and `/fr/pricing`). Changing `i18n.defaultLocale` chooses the fallback locale; it does not by itself change this prefix policy.
94
+ - A route with no `:locale` segment stays application-owned. Studio shows it once and neither adds nor interprets a locale segment.
95
+ - Do not add `/es/pricing` as a second route. A locale segment does not make two routes distinct.
96
+
97
+ Register the same shape in the router. React Router spells the omittable segment `:locale?`:
78
98
 
79
99
  ```ts
80
- import { fimoRoutes } from 'fimo/react-router/routes';
100
+ route(':locale?/blog/:slug', './pages/BlogPost.tsx');
81
101
  ```
82
102
 
83
- For every framework, the application owns its URL scheme and passes the resolved locale into Fimo. Canonical route metadata is optional unless the project wants Fimo Studio route selection/navigation.
103
+ These canonical entries are also the optional metadata used by Studio Pages. See `references/pages.md` for content-backed `params` and declared `sources`.
104
+
105
+ For every framework, the application owns its URL scheme, resolves the locale, and passes it into Fimo. Studio stores the locale the app reports for the current location — including when only the locale changed — and reads content in it. Route metadata is optional unless the project wants Fimo Studio route selection/navigation.
106
+
107
+ Astro and Next express the same optional-locale semantic with paired native filesystem route trees: an unprefixed default-locale tree and a prefixed non-default tree. Neither framework supports an optional single-segment filesystem folder.
84
108
 
85
109
  ## Migrate An Existing Locale System
86
110
 
87
111
  Inspect the existing locale provider, route table, switcher, redirects, and public URLs before editing configuration. Preserve working URL behavior during the migration.
88
112
 
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`.
113
+ Preserve the existing locale provider, router, switcher, redirects, and public URLs. Next.js projects run `fimo skills get fimo-code --ref frameworks/next/locales`; React Router projects load the React Router setup reference and its focused route-ownership migration when upgrading; Astro projects run `fimo skills get fimo-code --ref frameworks/astro` and pass the page-resolved locale into server reads and `getLabels`.
90
114
 
91
115
  ## Labels And Content
92
116
 
@@ -40,15 +40,15 @@ For clients that accept a JSON command configuration, the equivalent entry is:
40
40
  Do not add shell output or logging around the command: stdout is reserved for MCP JSON-RPC frames. Diagnostics are
41
41
  written to stderr.
42
42
 
43
- ## Project and environment scope
43
+ ## Project and Branch scope
44
44
 
45
45
  When launched inside a linked Fimo project, `fimo mcp` reads the project from `.fimo.settings.json` and uses the
46
- current git branch as the default environment. This keeps an AI client working against the same project environment as
47
- the checkout.
46
+ current git branch as the default Branch. This keeps an AI client working against the same Branch as the checkout.
48
47
 
49
48
  Outside a linked project, the server still works, but each project-scoped tool call must provide `projectId` and
50
- `env`. The client can also pass an environment override when launching the CLI. Never edit `.fimo.settings.json`
51
- manually to change scope.
49
+ `env` (the compatibility-preserved wire field for a Branch name). The canonical catalog tool is `branches_list`;
50
+ `envs_list` remains a compatibility alias. The client can also pass a Branch override when launching the CLI. Never
51
+ edit `.fimo.settings.json` manually to change scope.
52
52
 
53
53
  The CLI credential represents the signed-in user's Fimo authority. If an MCP server is invoked from a Fimo agent
54
54
  session, the session's frozen capability snapshot still limits the operations available to that agent.
@@ -57,13 +57,13 @@ session, the session's frozen capability snapshot still limits the operations av
57
57
 
58
58
  The Project MCP catalog covers:
59
59
 
60
- - **Identity and navigation** — current user, projects, and environments.
60
+ - **Identity and navigation** — current user, projects, and Branches.
61
61
  - **Content** — schemas, collection entries, search, create/update/delete, bounded bulk operations, and Singles.
62
62
  - **Labels** — list, read, set, batch-set, and delete localized labels.
63
63
  - **Media** — list and inspect assets, generate images or videos, create folders, move, and delete assets. Binary
64
64
  upload remains `fimo assets upload`.
65
65
  - **Forms** — create, read, update, and delete forms; inspect submissions and statistics.
66
- - **Files** — read, glob, grep, write, edit, and delete project files within the scoped environment. Sensitive files
66
+ - **Files** — read, glob, grep, write, edit, and delete project files within the scoped Branch. Sensitive files
67
67
  such as credentials and `.env` files are excluded.
68
68
  - **Agents** — list agents, start a run, and inspect run status.
69
69
 
@@ -76,7 +76,7 @@ Local MCP uses the stored CLI credential (or `FIMO_API_TOKEN` when explicitly co
76
76
  browser OAuth consent screen. Remote MCP uses Fimo OAuth with `read`, `write`, and `agents` scopes; the user selects
77
77
  the optional capabilities during consent.
78
78
 
79
- In both modes, Fimo still checks the user's project permissions, environment access, input validation, and file safety
79
+ In both modes, Fimo still checks the user's project permissions, Branch access, input validation, and file safety
80
80
  rules for every operation. MCP does not grant access to projects the user cannot already access.
81
81
 
82
82
  For ChatGPT, Claude, or another remote MCP client, use the setup guide in the public [MCP documentation](https://fimo.ai/docs/ai/mcp)
@@ -0,0 +1,70 @@
1
+ # Pages route metadata
2
+
3
+ Pages can mirror the application's routes in Fimo Studio. It gives editors a route tree and, for each selected route, a page-shaped workspace for its Labels, Single, bound entries, and Collection results. The CLI writes this optional metadata to `.fimo/config.json` under `routes.<id>`; it does not replace the application router or move or duplicate content.
4
+
5
+ ## Route shape
6
+
7
+ A route has three separate parts:
8
+
9
+ - `path` is the URL pattern, such as `/blog/:slug`.
10
+ - `params` optionally binds path placeholders to Collection entries so Studio can select a concrete route in the page header.
11
+ - `sources` optionally names the Labels, Single, and Collection results editors manage after selecting a route.
12
+
13
+ Each param key matches a `:placeholder` in `path`. `schema` selects the Collection, `queryField` is the entry field stored in the URL, and `displayField` is the field Studio shows to editors. Use `id` or the built-in `slug` for `queryField`; a custom URL field must set both `"required": true` and `"unique": true` in its schema. Params resolve in path order, so a later param query may use an earlier selection:
14
+
15
+ ```bash
16
+ fimo pages set <id> --path '/shop/:category/:product' --params '{"category":{"schema":"Category","queryField":"slug","displayField":"name"},"product":{"schema":"Product","queryField":"slug","displayField":"name","query":{"where":{"category":"$params.category.id"},"sort":"name"}}}'
17
+ ```
18
+
19
+ `sources` is a named object under `routes.<id>.sources`. It is not an array or a route definition. Keep its keys stable and descriptive:
20
+
21
+ ```json
22
+ {
23
+ "copy": {
24
+ "type": "labels",
25
+ "match": ["blog.*"]
26
+ },
27
+ "settings": {
28
+ "type": "single",
29
+ "schema": "BlogSettings"
30
+ },
31
+ "relatedPosts": {
32
+ "type": "collection",
33
+ "schema": "BlogPost",
34
+ "query": {
35
+ "where": {
36
+ "category": "$params.slug.category"
37
+ },
38
+ "sort": "-publishedAt",
39
+ "limit": 4
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Pass that same object as JSON:
46
+
47
+ ```bash
48
+ fimo pages set <id> --sources '{"copy":{"type":"labels","match":["blog.*"]},"settings":{"type":"single","schema":"BlogSettings"},"relatedPosts":{"type":"collection","schema":"BlogPost","query":{"where":{"category":"$params.slug.category"},"sort":"-publishedAt","limit":4}}}'
49
+ ```
50
+
51
+ The three source types select matching Labels, one-off Singles, or Collection results. A Collection source's optional `query` uses the normal content query shape.
52
+
53
+ ## Params queries and source queries
54
+
55
+ Both use the normal content query shape and may read an earlier bound value with `$params.<param>.<field>`, but they run at different stages and narrow different things:
56
+
57
+ - A dependent param query runs while Studio resolves the header selectors. On `/shop/:category/:product`, the product query narrows which products can become the `:product` URL segment after a category is chosen.
58
+ - A Collection source query runs after Studio has resolved and selected the route. On `/blog/:slug`, `relatedPosts` uses the selected post's `$params.slug.category` to narrow the entries shown in that route's editor; it does not create more routes.
59
+
60
+ ## Commands
61
+
62
+ ```bash
63
+ fimo pages list
64
+ fimo pages list --expand
65
+ fimo pages set <id> --path /about --label About
66
+ fimo pages set <id> --clear-params
67
+ fimo pages set <id> --clear-sources
68
+ fimo pages rename <id> <new-id>
69
+ fimo pages delete <id>
70
+ ```
@@ -1,19 +1,27 @@
1
1
  # Preview URL (without deploying)
2
2
 
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.**
3
+ **Use `fimo preview url` whenever you need the current hosted preview — to open it, screenshot it, hand it to another tool, or verify a change you already deployed. Never trigger `fimo deploy` just to retrieve a URL.**
4
4
 
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.
5
+ `fimo deploy` commits, pushes, and syncs the sandbox before it prints destinations. `fimo preview url` skips those deployment steps and only resolves the current Branch's preview destinations.
6
6
 
7
7
  ## Commands
8
8
 
9
9
  ```bash
10
- fimo preview url # URL for the current env (from the git branch)
11
- fimo --env feat/redesign preview url # URL for a specific env
12
- fimo preview url --env main --json # structured output for agents / scripts
10
+ fimo preview url # current Branch (from git)
11
+ fimo --branch feat/redesign preview url # specific Branch
12
+ fimo preview url --branch main --json # structured output for agents / scripts
13
+ fimo preview url --all # print every destination as named raw URLs
14
+ curl -L "$(fimo preview url)" # fetch the raw sandbox preview
13
15
  ```
14
16
 
15
- - **Interactive mode** shows named Preview and Fimo links. When piped, it prints only the raw preview URL, so `fimo preview url | xargs open` and `curl "$(fimo preview url)"` keep working.
16
- - **JSON mode** (or `FIMO_OUTPUT=json`) emits the standard envelope:
17
+ `--env <name>` remains a compatibility alias for `--branch <name>`. The API and JSON response still use the legacy `env` field and `/env/` dashboard path.
18
+
19
+ ## Human and machine behavior
20
+
21
+ - **Interactive terminal:** shows the stable `preview_url` and `studio_url` as named links. `preview_url` opens a full-screen Fimo viewer and requires a logged-in user with access to the project.
22
+ - **Piped or captured output:** prints only the short-lived `sandbox_url`. This preserves commands such as `curl -L "$(fimo preview url)"` and gives browsers, screenshot tools, and crawlers the directly fetchable site.
23
+ - **`--all`:** prints `preview_url`, `studio_url`, `sandbox_url`, and `sandbox_expires_at` as named raw values for a person inspecting every destination.
24
+ - **JSON mode** (or `FIMO_OUTPUT=json`): returns both destinations explicitly:
17
25
 
18
26
  ```json
19
27
  {
@@ -23,32 +31,33 @@ fimo preview url --env main --json # structured output for agen
23
31
  "data": {
24
32
  "project_id": "prj_abc",
25
33
  "env": "main",
26
- "preview_url": "https://...",
27
- "dashboard_url": "https://fimo.ai/app/projects/prj_abc/env/main/preview",
28
- "expires_at": "2026-06-02T18:42:00.000Z"
34
+ "preview_url": "https://fimo.ai/preview/prj_abc/main",
35
+ "sandbox_url": "https://preview.provider.example/session",
36
+ "sandbox_expires_at": "2026-08-20T18:42:00.000Z",
37
+ "studio_url": "https://fimo.ai/app/projects/prj_abc/env/main/preview",
38
+ "dashboard_url": "https://fimo.ai/app/projects/prj_abc/env/main/preview"
29
39
  }
30
40
  }
31
41
  ```
32
42
 
33
- Agents should read `data.preview_url` or `data.dashboard_url`, never parse the human output. The dashboard URL is stable; `expires_at` is the preview token's hard deadline. If you're caching the preview URL for more than ~10 minutes, re-run the command.
43
+ Agents must use `data.sandbox_url` for curl, Firecrawl, screenshots, and other machine reads. Use `data.preview_url` for the authenticated full-screen viewer and `data.studio_url` for the Branch inside Fimo Studio. `data.dashboard_url` is a deprecated compatibility alias for `data.studio_url`. The raw sandbox URL expires; resolve it again when `sandbox_expires_at` is near or has passed. The stable human URLs do not need to be regenerated.
34
44
 
35
45
  ## When to use it
36
46
 
37
- - **You changed something with `fimo deploy` and now want to look at it** — `fimo preview url` then open the URL.
38
- - **You need a URL for a screenshot, an agent-browser session, an analytics check, or a manual smoke test** — go straight here.
39
- - **You're polling the preview in a loop** — call `fimo preview url` once per loop body. Within ~5 minutes the API reuses the same token (cheap), beyond that you'll get a fresh one automatically.
40
- - **The previous URL stopped working** — the 15-min token expired. Re-run `fimo preview url`, don't redeploy.
47
+ - **You deployed a change and want to inspect it** — open the interactive `preview_url`.
48
+ - **An agent or tool needs to read the site** — pipe the command or use `data.sandbox_url` from JSON.
49
+ - **The raw URL expired** — run `fimo preview url` again; do not redeploy.
41
50
 
42
51
  ## When NOT to use it
43
52
 
44
- - **You changed code and want it on the preview** — that's still `fimo deploy`. `fimo preview url` only returns a URL; it doesn't push your local edits.
45
- - **You need the live, published URL** (the `*.fimo.site` or custom domain) — that comes from `fimo deploy --publish` / `fimo publish` and lives on the project, not in this command. See `references/deploy.md` and `references/domains.md`.
53
+ - **You changed code and want it on the preview** — use `fimo deploy`. This command only retrieves destinations.
54
+ - **You need the live published URL** — use `fimo deploy --publish` or `fimo publish`; see `references/deploy.md` and `references/domains.md`.
46
55
 
47
56
  ## Cold sandbox case
48
57
 
49
- If the env's sandbox has been torn down (long idle period, explicit teardown), the first `fimo preview url` lazy-provisions one — same ~60–90 s cost a `fimo deploy` would have paid. Subsequent calls are sub-second again. You don't need to do anything special; just wait it out.
58
+ Resolving `sandbox_url` may take roughly 60–90 seconds when an idle sandbox must be provisioned or restarted. The stable `preview_url` performs the same authenticated resolution when a project member opens it.
50
59
 
51
60
  ## See also
52
61
 
53
- - `references/deploy.md` — when you actually need to push code.
54
- - `references/branches.md` — env semantics and the global `--env <name>` flag.
62
+ - `references/deploy.md` — when you need to push code.
63
+ - `references/branches.md` — Branch semantics and the global `--branch <name>` flag.
@@ -66,7 +66,7 @@ fimo agents validate
66
66
 
67
67
  `fimo agents secrets add` edits `.fimo/agents/<name>/config.yaml`. It does not create or rotate the secret value. Use `fimo secrets add` to create the value or `fimo secrets update` to rotate it.
68
68
 
69
- `fimo agents validate` checks that required agent secrets exist in the project. A running agent keeps the environment it started with; the next run reads the deployed agent config again.
69
+ `fimo agents validate` checks that required agent secrets exist in the project. A running agent keeps the Branch it started with; the next run reads the deployed agent config again.
70
70
 
71
71
  ## Choosing Between Them
72
72
 
@@ -7,7 +7,7 @@ Commands for listing projects across an org, cloning a remote project locally, a
7
7
  ```bash
8
8
  fimo projects list [--org <id>] # list projects in an org (defaults to active org)
9
9
  fimo projects create [dir] [--org <id>] [--framework react-router|astro|nextjs|sveltekit] [--install|--no-install]
10
- fimo projects clone [projectId] [dir] [--env <name>] # clone an existing project locally
10
+ fimo projects clone [projectId] [dir] [--branch <name>] # clone an existing project locally
11
11
  fimo projects delete [projectId] [-C <dir>] [-y] # delete (defaults to current project)
12
12
  fimo projects publish [projectId] [-C <dir>] # make the project live (publish from main)
13
13
  fimo projects unpublish [projectId] [-C <dir>] # take the project offline
@@ -16,7 +16,7 @@ fimo projects rename <name> [projectId] [-C <dir>] # set seo.siteName in the l
16
16
 
17
17
  - **`list`** — projects you can see in the org. Live projects are marked.
18
18
  - **`create`** — identical to `fimo init` (create-new path); see `references/init.md`.
19
- - **`clone`** — clone a remote Fimo project's git repo to your machine and write the local `.fimo/project.json` and agent files. Use `fimo clone <projectId>` when scripting or when the ID is known. In an interactive terminal, bare `fimo clone` opens a project picker for the active org; JSON mode and non-TTY shells require an explicit project ID and fail fast instead of prompting. By default it clones `main`; pass `--env <name>` to clone a specific env. The target directory defaults to the project display name/name, or pass `[dir]` explicitly.
19
+ - **`clone`** — clone a remote Fimo project's git repo to your machine and write the local `.fimo/project.json` and agent files. Use `fimo clone <projectId>` when scripting or when the ID is known. In an interactive terminal, bare `fimo clone` opens a project picker for the active org; JSON mode and non-TTY shells require an explicit project ID and fail fast instead of prompting. By default it clones `main`; pass `--branch <name>` to clone a specific Branch. The legacy `--env <name>` spelling remains a compatibility alias. The target directory defaults to the project display name/name, or pass `[dir]` explicitly.
20
20
  - **`delete`** — destructive; prompts unless `-y`. Removes the remote project.
21
21
  - **`publish` / `unpublish`** — toggle the project's public visibility. `publish` flips the current `main` state live (the same "go live" as `fimo deploy --publish`, minus the git push). This is **not** the versioned release path — for that, see `fimo publish` in `references/branches.md`.
22
22
  - **`rename`** — edits only the linked local project immediately. It requires a project marker in the cwd, and if you pass a `[projectId]` that doesn't match the linked project it errors and exits 1 (so you can't rename a different project). It writes `seo.siteName` into the current or legacy project config; commit and run `fimo deploy` to reconcile the remote `displayName` and deploy the new site name.
@@ -24,7 +24,7 @@ fimo projects rename <name> [projectId] [-C <dir>] # set seo.siteName in the l
24
24
  ## Top-level clone shortcut
25
25
 
26
26
  ```bash
27
- fimo clone [projectId] [dir] [--env <name>] # same as `fimo projects clone`
27
+ fimo clone [projectId] [dir] [--branch <name>] # same as `fimo projects clone`
28
28
  ```
29
29
 
30
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.