fimo 0.18.0 → 0.20.0
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.
- package/assets/skills/fimo-cli/SKILL.md +7 -4
- package/assets/skills/fimo-cli/references/agents.md +4 -1
- package/assets/skills/fimo-cli/references/branches.md +2 -2
- package/assets/skills/fimo-cli/references/deploy.md +23 -9
- package/assets/skills/fimo-cli/references/hosting.md +114 -0
- package/assets/skills/fimo-cli/references/init.md +2 -2
- package/assets/skills/fimo-cli/references/integrations/firecrawl.md +2 -0
- package/assets/skills/fimo-cli/references/preview.md +26 -20
- package/assets/skills/fimo-migration/references/qa.md +7 -0
- package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +107 -97
- package/dist/runtime/app/FimoProviders.js +1 -1
- package/dist/runtime/app/prefetch.js +1 -1
- package/dist/runtime/i18n/locale.d.ts +2 -3
- package/dist/runtime/i18n/locale.js +2 -27
- package/dist/runtime/paths/get-fimo-paths.js +1 -1
- package/dist/runtime/react-router/legacy/routes.js +1 -1
- package/dist/runtime/routes/index.d.ts +161 -2
- package/dist/runtime/routes/index.js +335 -3
- package/dist/runtime/seo/resolver.js +1 -1
- package/dist/runtime/shared/fimo-config.types.d.ts +4 -29
- package/dist/runtime/templates.d.ts +19 -0
- package/dist/runtime/templates.js +33 -0
- package/dist/scripts/validate-route-metadata.js +1 -1
- package/package.json +4 -3
- package/templates/react-router/package.json +1 -1
- package/dist/runtime/routes/contract.d.ts +0 -116
- package/dist/runtime/routes/contract.js +0 -377
|
@@ -60,16 +60,18 @@ pnpm dev # run the app locally (use the pr
|
|
|
60
60
|
fimo credits # inspect the owning org's AI credit balance (read-only)
|
|
61
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
|
|
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
|
|
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
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
72
|
|
|
73
|
+
**`fimo validate` does not type check.** Run the project's own `typecheck` or `check` script after changing code.
|
|
74
|
+
|
|
73
75
|
## Decision Tree
|
|
74
76
|
|
|
75
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.
|
|
@@ -85,6 +87,7 @@ Load the matching reference when the user's request fires its trigger. Recipes t
|
|
|
85
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**
|
|
86
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`
|
|
87
89
|
- "Deploy / publish / go live / push my changes" → `references/deploy.md`
|
|
90
|
+
- "Add a redirect / security headers / CSP / HSTS / clean URLs / trailing slash" → `references/hosting.md`
|
|
88
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`
|
|
89
92
|
- "Schedule a command / cron / nightly publish / recurring checks / `fimo schedules`" → `references/schedules.md`
|
|
90
93
|
- "Set env vars / configure API keys / add project secrets / local `.env.local` / `fimo vars` / `fimo secrets`" → `references/project-vars-and-secrets.md`
|
|
@@ -118,7 +121,7 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
|
|
|
118
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.
|
|
119
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`.
|
|
120
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.
|
|
121
|
-
- **When a user-visible unit of work looks done outside first-time onboarding** → **offer** to deploy (`fimo deploy` for a hosted preview
|
|
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`.
|
|
122
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.
|
|
123
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.
|
|
124
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`.
|
|
@@ -132,7 +135,7 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
|
|
|
132
135
|
- **Editing `.fimo/project.json`** — read-only; it's the link between local and remote project. Treat as a generated file.
|
|
133
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`.
|
|
134
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.
|
|
135
|
-
- **Running `fimo deploy` just to get
|
|
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`.
|
|
136
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".
|
|
137
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.
|
|
138
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.
|
|
@@ -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
|
|
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
|
|
@@ -26,7 +26,7 @@ fimo --branch <name> <command> # peek at another Branch for one command (does n
|
|
|
26
26
|
|
|
27
27
|
| Command | git analogue | What it does |
|
|
28
28
|
| ----------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
-
| `fimo branch` | `git branch` | List Branches (current marked `*`). `-v`
|
|
29
|
+
| `fimo branch` | `git branch` | List Branches (current marked `*`). `-v` includes deleted Branches. |
|
|
30
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
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
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. |
|
|
@@ -55,7 +55,7 @@ All of these accept the global `--branch` override; legacy `--env` remains an al
|
|
|
55
55
|
fimo checkout -b feat/seo # branch off main: git branch + Branch provisioned
|
|
56
56
|
# …generate / edit code, schemas, content, translations…
|
|
57
57
|
fimo deploy -m "feat: seo pass" # deploy a preview of the feat/seo Branch
|
|
58
|
-
fimo preview url #
|
|
58
|
+
fimo preview url # canonical URL to open / screenshot the feat/seo preview
|
|
59
59
|
fimo status # see what changed vs main, surface by surface
|
|
60
60
|
fimo checkout main # back to main
|
|
61
61
|
fimo merge feat/seo # merge the Branch back into main (resolve conflicts)
|
|
@@ -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 **
|
|
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 **
|
|
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
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` —
|
|
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
|
|
|
@@ -35,16 +35,27 @@ fimo deploy -m "<commit message>" --publish --json
|
|
|
35
35
|
|
|
36
36
|
Read these fields from `data`:
|
|
37
37
|
|
|
38
|
-
| Field
|
|
39
|
-
|
|
|
40
|
-
| `preview_url`
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
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,
|
|
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
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`.
|
|
47
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.
|
|
58
|
+
|
|
48
59
|
## Framework hosting
|
|
49
60
|
|
|
50
61
|
Fimo preview resolves `runtime.commands` override → package script → detected
|
|
@@ -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.
|
|
@@ -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.
|
|
@@ -135,7 +135,7 @@ fimo rename "Acme Coffee"
|
|
|
135
135
|
pnpm dev & # or npm run dev / yarn dev / bun dev — the project's package manager
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
Outside the first-preview path below, when a unit of work looks done, **offer** to deploy (`fimo deploy` for a hosted preview
|
|
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.
|
|
139
139
|
|
|
140
140
|
## Load the project context
|
|
141
141
|
|
|
@@ -159,7 +159,7 @@ Whenever `fimo init` created or scaffolded a new project — including a Studio-
|
|
|
159
159
|
fimo deploy -m "chore: first preview" --json
|
|
160
160
|
```
|
|
161
161
|
|
|
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.
|
|
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.
|
|
163
163
|
|
|
164
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.
|
|
165
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.
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
# Preview URL (without deploying)
|
|
2
2
|
|
|
3
|
-
**Use `fimo preview url` whenever you need the current preview
|
|
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`
|
|
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 #
|
|
11
|
-
fimo --branch feat/redesign preview url #
|
|
10
|
+
fimo preview url # current Branch (from git)
|
|
11
|
+
fimo --branch feat/redesign preview url # specific Branch
|
|
12
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
|
-
`--env <name>` remains a compatibility alias for `--branch <name>`. The API and
|
|
16
|
-
JSON response still use the legacy `env` field and `/env/` dashboard path.
|
|
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.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
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:
|
|
20
25
|
|
|
21
26
|
```json
|
|
22
27
|
{
|
|
@@ -26,32 +31,33 @@ JSON response still use the legacy `env` field and `/env/` dashboard path.
|
|
|
26
31
|
"data": {
|
|
27
32
|
"project_id": "prj_abc",
|
|
28
33
|
"env": "main",
|
|
29
|
-
"preview_url": "https
|
|
30
|
-
"
|
|
31
|
-
"
|
|
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"
|
|
32
39
|
}
|
|
33
40
|
}
|
|
34
41
|
```
|
|
35
42
|
|
|
36
|
-
Agents
|
|
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.
|
|
37
44
|
|
|
38
45
|
## When to use it
|
|
39
46
|
|
|
40
|
-
- **You
|
|
41
|
-
- **
|
|
42
|
-
- **
|
|
43
|
-
- **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.
|
|
44
50
|
|
|
45
51
|
## When NOT to use it
|
|
46
52
|
|
|
47
|
-
- **You changed code and want it on the preview** —
|
|
48
|
-
- **You need the live
|
|
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`.
|
|
49
55
|
|
|
50
56
|
## Cold sandbox case
|
|
51
57
|
|
|
52
|
-
|
|
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.
|
|
53
59
|
|
|
54
60
|
## See also
|
|
55
61
|
|
|
56
|
-
- `references/deploy.md` — when you
|
|
62
|
+
- `references/deploy.md` — when you need to push code.
|
|
57
63
|
- `references/branches.md` — Branch semantics and the global `--branch <name>` flag.
|
|
@@ -112,6 +112,13 @@ Owned by the runtime lane; verified here read-only.
|
|
|
112
112
|
unavailable in the report.
|
|
113
113
|
- Deployment smoke is explicit owner opt-in; never run deploy or publish as a
|
|
114
114
|
QA step.
|
|
115
|
+
- When an approved publication fails, inspect its returned publication ID with
|
|
116
|
+
`fimo publish inspect <id> --json`, then read its build evidence with
|
|
117
|
+
`fimo publish logs <id> --json` before retrying. Provider logs may become
|
|
118
|
+
unavailable after the deployment is reclaimed.
|
|
119
|
+
- When an approved preview deploy fails, capture `fimo logs --json` before
|
|
120
|
+
replacing or retrying the sandbox. Repair from that evidence, then make one
|
|
121
|
+
bounded retry.
|
|
115
122
|
|
|
116
123
|
## Behavior
|
|
117
124
|
|
|
@@ -22,7 +22,7 @@ Give the AI more to work with:
|
|
|
22
22
|
- **+ button**: Opens a dropdown with options:
|
|
23
23
|
- **Attach Assets** -- browse your media library and attach files.
|
|
24
24
|
- **Attach Entries** -- attach CMS content for the AI to reference.
|
|
25
|
-
- **Upload from Computer** -- upload a
|
|
25
|
+
- **Upload from Computer** -- upload a file directly. ZIP archives are supported up to 20 MiB; the AI can download and inspect them under `/tmp` in its sandbox while the original stays attached to the conversation.
|
|
26
26
|
- **Draw** -- opens the drawing tool where you can sketch a wireframe or layout idea for the AI to follow.
|
|
27
27
|
- **@ mentions**: Type **@** in the chat to reference specific files, pages, or content inline.
|
|
28
28
|
|
package/dist/cli/bundle.json
CHANGED