fimo 2.2.0-staging.8 → 2.2.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.
Files changed (106) hide show
  1. package/assets/agent-templates/_default/config.yaml +6 -0
  2. package/assets/agent-templates/broken-link-sweeper/config.yaml +1 -0
  3. package/assets/content-templates/shared/types.eta +65 -6
  4. package/assets/skills/fimo-cli/SKILL.md +5 -3
  5. package/assets/skills/fimo-cli/references/agents.md +29 -4
  6. package/assets/skills/fimo-cli/references/assets.md +42 -3
  7. package/assets/skills/fimo-cli/references/branches.md +9 -8
  8. package/assets/skills/fimo-cli/references/content.md +4 -4
  9. package/assets/skills/fimo-cli/references/credits.md +12 -19
  10. package/assets/skills/fimo-cli/references/deploy.md +8 -8
  11. package/assets/skills/fimo-cli/references/forms.md +3 -1
  12. package/assets/skills/fimo-cli/references/history.md +3 -2
  13. package/assets/skills/fimo-cli/references/inbox.md +86 -0
  14. package/assets/skills/fimo-cli/references/init.md +7 -6
  15. package/assets/skills/fimo-cli/references/invite.md +11 -9
  16. package/assets/skills/fimo-cli/references/labels.md +3 -11
  17. package/assets/skills/fimo-cli/references/locales.md +5 -3
  18. package/assets/skills/fimo-cli/references/preview.md +1 -2
  19. package/assets/skills/fimo-cli/references/projects.md +8 -8
  20. package/assets/skills/fimo-cli/references/schedules.md +6 -4
  21. package/assets/skills/fimo-cli/references/webhooks.md +6 -4
  22. package/assets/skills/fimo-code/references/assets.md +22 -11
  23. package/assets/skills/fimo-code/references/content/clients.md +15 -1
  24. package/assets/skills/fimo-code/references/content/schema.md +1 -0
  25. package/assets/skills/fimo-code/references/frameworks/astro.md +1 -1
  26. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +12 -1
  27. package/assets/skills/fimo-code/references/frameworks/next/locales.md +2 -2
  28. package/assets/skills/fimo-code/references/frameworks/next.md +1 -1
  29. package/assets/skills/fimo-code/references/locales.md +4 -2
  30. package/assets/skills/fimo-migration/SKILL.md +54 -16
  31. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +8 -0
  32. package/assets/skills/fimo-migration/references/media.md +11 -0
  33. package/assets/skills/fimo-migration/references/qa.md +30 -4
  34. package/assets/skills/fimo-migration/references/questions-and-improvements.md +188 -0
  35. package/assets/skills/fimo-migration/references/workers/content-planner.md +8 -3
  36. package/assets/skills/fimo-migration/references/workers/validator.md +20 -6
  37. package/assets/skills/fimo-migration/references/workers.md +17 -6
  38. package/assets/skills/fimo-migration/references/workflow.md +36 -6
  39. package/assets/skills/fimo-studio/SKILL.md +3 -1
  40. package/assets/skills/fimo-studio/references/agents.md +25 -0
  41. package/assets/skills/fimo-studio/references/ai-chat.md +1 -2
  42. package/assets/skills/fimo-studio/references/billing-and-credits.md +14 -7
  43. package/assets/skills/fimo-studio/references/visual-editing.md +9 -1
  44. package/assets/skills/fimo-studio/references/webhooks.md +1 -1
  45. package/dist/cli/bundle.json +2 -2
  46. package/dist/cli/index.js +210 -179
  47. package/dist/runtime/content/client/collection-core.js +3 -2
  48. package/dist/runtime/content/client/core-types.d.ts +4 -3
  49. package/dist/runtime/content/client/internal.d.ts +2 -0
  50. package/dist/runtime/content/client/internal.js +54 -25
  51. package/dist/runtime/content/client/singleton-core.js +2 -1
  52. package/dist/runtime/content/index.d.ts +1 -1
  53. package/dist/runtime/content/index.js +1 -1
  54. package/dist/runtime/content/serialization.d.ts +4 -3
  55. package/dist/runtime/content/serialization.js +4 -3
  56. package/dist/runtime/primitives/lib/index.d.ts +1 -1
  57. package/dist/runtime/primitives/lib/index.js +1 -1
  58. package/dist/runtime/primitives/lib/primitives.d.ts +39 -12
  59. package/dist/runtime/primitives/lib/primitives.js +83 -17
  60. package/dist/runtime/primitives/lib/template.js +2 -2
  61. package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
  62. package/dist/runtime/shared/local-runtime-env.js +14 -9
  63. package/dist/runtime/templates.d.ts +9 -2
  64. package/dist/runtime/templates.js +36 -7
  65. package/dist/scripts/validate-schemas.js +10 -15
  66. package/package.json +10 -8
  67. package/release.json +2 -2
  68. package/templates/astro/AGENTS.md +1 -1
  69. package/templates/astro/package.json +2 -2
  70. package/templates/nextjs/AGENTS.md +2 -2
  71. package/templates/nextjs/package.json +3 -3
  72. package/templates/nextjs/src/app/layout.tsx +4 -1
  73. package/templates/react-router/AGENTS.md +2 -2
  74. package/templates/react-router/package.json +4 -4
  75. package/templates/sveltekit/AGENTS.md +1 -1
  76. package/templates/sveltekit/package.json +2 -2
  77. package/templates/vite/AGENTS.md +5 -1
  78. package/templates/vite/package.json +4 -4
  79. package/templates/welcome/manifest.json +655 -0
  80. package/templates/welcome/media/analytics-overview.avif +0 -0
  81. package/templates/welcome/media/autonomous-loop.avif +0 -0
  82. package/templates/welcome/media/editable-preview.avif +0 -0
  83. package/templates/welcome/media/media-library.avif +0 -0
  84. package/templates/welcome/media/slack-teams.avif +0 -0
  85. package/templates/welcome/template/.fimo/agents/welcome-guide/GOAL.md +12 -0
  86. package/templates/welcome/template/.fimo/agents/welcome-guide/capabilities.yaml +3 -0
  87. package/templates/welcome/template/.fimo/agents/welcome-guide/config.yaml +8 -0
  88. package/templates/welcome/template/.fimo/config.json +53 -0
  89. package/templates/welcome/template/src/font.css +60 -0
  90. package/templates/welcome/template/src/pages/ArticleDetail.tsx +104 -0
  91. package/templates/welcome/template/src/pages/Index.tsx +36 -0
  92. package/templates/welcome/template/src/pages/SiteContent.tsx +674 -0
  93. package/templates/welcome/template/src/pages/fallback-content.ts +152 -0
  94. package/templates/welcome/template/src/routes.ts +9 -0
  95. package/templates/welcome/template/src/schemas/Article.json +34 -0
  96. package/templates/welcome/template/src/schemas/Article.ts +54 -0
  97. package/templates/welcome/template/src/schemas/Article.types.ts +93 -0
  98. package/templates/welcome/template/src/schemas/Author.json +17 -0
  99. package/templates/welcome/template/src/schemas/Author.ts +51 -0
  100. package/templates/welcome/template/src/schemas/Author.types.ts +54 -0
  101. package/templates/welcome/template/src/schemas/Category.json +17 -0
  102. package/templates/welcome/template/src/schemas/Category.ts +51 -0
  103. package/templates/welcome/template/src/schemas/Category.types.ts +54 -0
  104. package/templates/welcome/template/src/schemas/HomePage.json +110 -0
  105. package/templates/welcome/template/src/schemas/HomePage.ts +22 -0
  106. package/templates/welcome/template/src/schemas/HomePage.types.ts +116 -0
@@ -3,5 +3,11 @@
3
3
  version: 1
4
4
  description: 'A new Fimo agent. Edit this tagline to describe what it does.'
5
5
  model: openai/gpt-5.6-luna
6
+
7
+ runtime:
8
+ # Per-run spend limit in credits. Remove to allow up to the
9
+ # organization's available balance at admission.
10
+ max_credits: 5000
11
+
6
12
  triggers:
7
13
  - type: manual
@@ -5,6 +5,7 @@ model: openai/gpt-5.6-luna
5
5
  runtime:
6
6
  cloud: true
7
7
  long_running: true
8
+ max_credits: 5000
8
9
 
9
10
  triggers:
10
11
  - type: manual
@@ -24,6 +24,27 @@ import type { <%= referenceImport.pascal %> } from "./<%= referenceImport.pascal
24
24
  /* ──────────── 📄 Type definitions ──────────── */
25
25
  /*───────────────────────────────────────────────────────────────*/
26
26
 
27
+ <% if (Object.values(model.fields || {}).some(holdsMedia)) { -%>
28
+ /**
29
+ * What a media field stores: a reference to a media-library asset. Point at the
30
+ * asset by `id`, or by the `url` an upload returned and Fimo resolves the `id`
31
+ * for you. `alt` belongs to the entry, so it survives replacing the asset. The
32
+ * facts the asset owns are never copied in, so they cannot go stale.
33
+ */
34
+ export type FimoMediaRef = ({ id: string; url?: string } | { id?: string; url: string }) & {
35
+ alt?: string;
36
+ source?: "local" | "external";
37
+ };
38
+
39
+ /**
40
+ * What a read returns for a media field it named in `populate`: the reference
41
+ * plus the facts the asset owns as of that read. `name`, `mime`, `width`, and
42
+ * `height` remain optional when the asset is external, missing, or incomplete.
43
+ * A read that did not name the field returns `FimoMedia` with those facts absent.
44
+ */
45
+ export type FimoPopulatedMedia = FimoMedia & { name?: string; mime?: string };
46
+
47
+ <% } -%>
27
48
  /**
28
49
  * <%= model.pascal %> entity interface
29
50
  */
@@ -131,10 +152,8 @@ function getInputTypeForField(field) {
131
152
  return 'string';
132
153
  case 'json':
133
154
  return 'Record<string, unknown>';
134
- case 'media': {
135
- const media = 'Pick<FimoMedia, "url" | "alt" | "name" | "mime" | "width" | "height">';
136
- return field.multiple ? `${media}[]` : media;
137
- }
155
+ case 'media':
156
+ return field.multiple ? 'FimoMediaRef[]' : 'FimoMediaRef';
138
157
  case 'reference': {
139
158
  const raw = Array.isArray(field.targets) && field.targets.length > 0 ? 'FimoPolymorphicReference' : 'FimoReference';
140
159
  return field.many ? `${raw}[]` : `${raw} | null`;
@@ -176,6 +195,32 @@ function getBlocksType(field, input) {
176
195
  return `${item}[]`;
177
196
  }
178
197
 
198
+ /** A media field, or a blocks field with a media value in some variant. */
199
+ function holdsMedia(field) {
200
+ if (field.type === 'media') {
201
+ return true;
202
+ }
203
+ if (field.type !== 'blocks') {
204
+ return false;
205
+ }
206
+ const schema = field.schema || {};
207
+ const variants = Array.isArray(schema.oneOf) ? schema.oneOf : [schema];
208
+ return variants.some((variant) => Object.values(variant.fields || {}).some(holdsMedia));
209
+ }
210
+
211
+ /**
212
+ * What the field becomes when `populate` names it. A media field gains the
213
+ * asset facts; a blocks field keeps its declared item types — the media inside
214
+ * it is populated at runtime, but naming which variant carries which value is
215
+ * beyond what this flat contract can say, so the type stays conservative.
216
+ */
217
+ function getPopulatedTypeForField(field) {
218
+ if (field.type === 'media') {
219
+ return field.multiple ? 'FimoPopulatedMedia[]' : 'FimoPopulatedMedia';
220
+ }
221
+ return getBlocksType(field, false);
222
+ }
223
+
179
224
  function getStringLiteralUnion(field) {
180
225
  if (!Array.isArray(field.options) || field.options.length === 0) {
181
226
  return null;
@@ -202,17 +247,26 @@ function isConditionalField(field) {
202
247
  return field.showIf !== undefined || field.showIfAny !== undefined;
203
248
  }
204
249
 
205
- const populatedReferenceFields = Object.entries(model.fields || {}).filter(([, field]) => {
250
+ const modelFields = Object.entries(model.fields || {});
251
+ const populatedReferenceFields = modelFields.filter(([, field]) => {
206
252
  if (field.type !== 'reference') {
207
253
  return false;
208
254
  }
209
255
  return (Array.isArray(field.targetRefs) && field.targetRefs.length > 0) || typeof field.targetPascal === 'string';
210
256
  });
257
+ const populatedMediaFields = modelFields.filter(([, field]) => holdsMedia(field));
258
+ const populatableFields = [...populatedReferenceFields, ...populatedMediaFields];
211
259
  -%>
212
260
 
213
- <% if (populatedReferenceFields.length === 0) { -%>
261
+ <% if (populatableFields.length === 0) { -%>
214
262
  export type <%= model.pascal %>References = Record<never, never>;
215
263
  <% } else { -%>
264
+ /**
265
+ * What each populatable field returns when a read names it in `populate`: a
266
+ * reference field resolves to its target entry, a media field to the asset's
267
+ * current facts, a blocks field to the same items with every media value
268
+ * inside them filled. Fields absent here are returned as stored.
269
+ */
216
270
  export interface <%= model.pascal %>References {
217
271
  <%
218
272
  populatedReferenceFields.forEach(([key, field]) => {
@@ -235,6 +289,11 @@ populatedReferenceFields.forEach(([key, field]) => {
235
289
  <%= key %>: <%= type %>;
236
290
  <%
237
291
  });
292
+ populatedMediaFields.forEach(([key, field]) => {
293
+ -%>
294
+ <%= key %>: <%= getPopulatedTypeForField(field) %>;
295
+ <%
296
+ });
238
297
  -%>
239
298
  }
240
299
  <% } -%>
@@ -44,7 +44,7 @@ A Fimo project is identified by `.fimo/project.json`, written by `fimo init`. Th
44
44
 
45
45
  ## Critical: commands target the Branch matching the current git branch
46
46
 
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 still works, but passing both with different values fails (`BRANCH_OPTION_CONFLICT`) instead of picking one. 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 removed `--env <name>` spelling is rejected. 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
 
@@ -83,7 +83,7 @@ Load the matching reference when the user's request fires its trigger. Recipes t
83
83
  - "Declare Pages routes / configure Pages sources or route params / control what Studio shows for a route" → `references/pages.md`
84
84
  - "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**
85
85
  - "View form submissions / who filled out the contact form / inspect what users sent / how many signups" → `references/forms.md` § Reading submissions
86
- - "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**
86
+ - "Upload, inspect, replace, safely remove, or permanently destroy an image / hero / cover / existing media file" → `references/assets.md` **+ run `fimo skills get fimo-code --ref assets` for the `FimoMedia` shape and rendering**
87
87
  - "Generate AI image / video / draft preview / image edit / cover from a prompt" → `references/media.md` (task commands, quality, recipes, and verification) **+ run `fimo skills get fimo-code --ref assets` for the `FimoMedia` shape if you'll plug the result into UI**
88
88
  - "Add labels / update static copy / fix missing `t()` values" → `references/labels.md` (workflow) **+ run `fimo skills get fimo-code --ref labels` and load the detected framework reference**
89
89
  - "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**
@@ -106,6 +106,7 @@ Load the matching reference when the user's request fires its trigger. Recipes t
106
106
  - "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`
107
107
  - "Invite a collaborator / add Marc / share with client" → `references/invite.md`
108
108
  - "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`)
109
+ - "Check the Inbox / what are my agents waiting on / answer a blocked agent / an agent asked me a question / approve or deny what an agent asked for (`fimo inbox *`)" → `references/inbox.md`. Never answer on the person's behalf.
109
110
  - "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`
110
111
  - "Install Fimo for my agent / fimo skills install / set up Claude Code, Codex, or Cursor for Fimo" → `references/agent-setup.md`
111
112
  - "Add, inspect, search, or run a remote MCP server / use `fimo mcp`" → `references/mcp.md`
@@ -130,6 +131,7 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
130
131
  - **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`.
131
132
  - **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`.
132
133
  - **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`.
134
+ - **When a project agent has stopped and is waiting on a person** → `fimo inbox list --topic agent_question --unread` surfaces it. Show the stored form to the person, collect their explicit answer, and submit it with `fimo inbox answer`. See `references/inbox.md`.
133
135
  - **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`.
134
136
  - **After the automatic first-preview deploy on the create-new path, before the project has been published** → if there is no custom domain and the free default `*.fimo.site` slug still looks generated or was never explicitly chosen, offer to find a cleaner free subdomain. It needs no DNS. Never claim one without explicit user confirmation: suggest candidates, let the user choose, then rename it. Choosing the slug does not publish the site; the URL starts resolving only after the first successful `fimo deploy --publish`. Skip this nudge if the user already chose the default slug, attached a custom domain, or declined. See `references/domains.md` § Offer a cleaner default URL before first publish.
135
137
  - **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).
@@ -146,6 +148,6 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
146
148
  - **Adding another deploy tool (Vercel, Netlify, Cloudflare Pages)** — Fimo handles deploys; don't bolt another platform on.
147
149
  - **Committing secrets** — hidden values use `fimo secrets`; public browser-safe values use `fimo vars`. Local env files are ignored and must not become deploy inputs.
148
150
  - **Hardcoding tokens in flags** — use the credentials written by `fimo login` (one file per backend at `~/.config/fimo/credentials/<host>-<hash>.json`).
149
- - **Treating the daily allowance as extra credits** — `fimo credits` already includes spendable daily free credits in "Available now"; the allowance section is accounting context, not an amount to add.
151
+ - **Treating the daily allowance as extra credits** — the allowance section appears only for legacy Premium organizations, and `fimo credits` already includes its spendable credits in "Available now"; it is accounting context, not an amount to add.
150
152
  - **Trying to refill credits from the CLI** — `fimo credits` is read-only. Buying/refilling credits belongs in the billing UI for now.
151
153
  - **`fimo agents run` to push bundle changes** — it doesn't. The bundle reaches the server through `fimo deploy` (it lives in git, not the DB), and that push to `main` is also what wires the declared triggers. `run` dispatches the _deployed_ version. Deploy first. There is no `activate` command. See `references/agents.md`.
@@ -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`. 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`.
10
+ - **Cloud ops** — `run`, `runs`, `report`, `logs`. Branch-aware, talk to the server. Default `--branch` is `main`; `--env` is rejected as a Branch selector. `--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
 
@@ -57,6 +57,31 @@ integrations:
57
57
  An explicit map is restrictive: only entries set to `true` are available. An omitted or disabled integration cannot be
58
58
  used. See `references/integrations.md` for project setup, auth, and provider-specific commands.
59
59
 
60
+ Declare a `runtime` block in `config.yaml` to gate where a bundle runs and bound what one run costs:
61
+
62
+ ```yaml
63
+ runtime:
64
+ cloud: true
65
+ dev: false
66
+ long_running: false
67
+ max_credits: 5000
68
+ max_steps: 40
69
+ ```
70
+
71
+ - `cloud` / `dev` — declared boolean environment flags for where the bundle may run.
72
+ - `long_running` — same capability as the `runtime:long_running` token: lets the run exceed the default time limit.
73
+ - `max_credits` — the run's own credit ceiling (integer, credits ≥ 1). The default scaffold template ships
74
+ `max_credits: 5000` as a visible starter limit. Unset: the run may spend up to the organization's available
75
+ credits at admission.
76
+ - `max_steps` — cap on model-loop steps for one run (integer ≥ 1). Unset: no step cap; only `max_credits` (or the
77
+ organization's balance) and the plan's agent-hours bound the run.
78
+
79
+ All five keys are optional; an absent `runtime` block behaves as if every key were unset. There is no platform step cap
80
+ and no legacy per-session cost ceiling — the only stops are these author-owned limits, the organization running out of
81
+ credits (`insufficient_credits`), and the agent-hours allowance. A limit that fires records a truthful terminal reason
82
+ (`max_steps`, `budget_exceeded`, `insufficient_credits`, or `finish_run_missing` when a run ends without calling
83
+ `finish_run`), readable via `fimo agents report` and the Studio run page.
84
+
60
85
  ## How a cloud run ends
61
86
 
62
87
  Fimo creates one task Branch and environment for a cloud run, tells the agent their names, and manages their lifecycle.
@@ -242,13 +267,13 @@ Example for a content editor that can read and update entries but cannot change
242
267
 
243
268
  ```bash
244
269
  fimo agents run <name> [--branch <branch>] [--project <id>] [--skip-drift-check] [-C <dir>]
245
- fimo agents runs <name> [--limit <n>] [--branch <branch>] [--project <id>] [-C <dir>]
270
+ fimo agents runs <name> [--limit <n>] [--cursor <cursor>] [--all-pages] [--branch <branch>] [--project <id>] [-C <dir>]
246
271
  fimo agents report <name> [--session <id>] [--branch <branch>] [--project <id>] [-C <dir>]
247
272
  fimo agents logs <name> [--session <id>] [--project <id>] [-C <dir>]
248
273
  ```
249
274
 
250
- - **`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.
251
- - **`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.
275
+ - **`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`.
276
+ - **`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 uses the canonical `branch` field.
252
277
  - **`report <name>`** — print a run's structured **report**: its durable outcome summary (for a read-only agent like `seo-audit` this _is_ the audit; for a write agent it's a "what I changed" summary). A run that returns plain text without calling `finish_run` receives a small structured fallback document. With no `--session`, the most recent run for `<name>` is used (combine with `--branch` to scope); `--session <id>` targets a specific run. Output is projected 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 report, 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.
253
278
  - **`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`.
254
279
 
@@ -3,7 +3,7 @@
3
3
  > Package contract: run `fimo skills get fimo-code --ref assets` for `FimoMedia`, `--ref ui` for rendering primitives, and load the detected framework reference for framework-specific integration.
4
4
  > For **generating** new images / videos with AI, see **`references/media.md`** for the task commands and recipes.
5
5
 
6
- This file covers the **CLI workflow** for media that already exists: uploading files, browsing the library, opening an asset to inspect it, moving / deleting items.
6
+ This file covers the **CLI workflow** for media that already exists: uploading files, browsing the library, inspecting reference impact, replacing references, and removing assets safely.
7
7
 
8
8
  ## Upload a file
9
9
 
@@ -96,9 +96,12 @@ fimo assets list --search "wolf"
96
96
  fimo assets list --search "hero" --image
97
97
  fimo assets list --search "logo" --type file --sort-by createdAt
98
98
 
99
- fimo assets list --limit 50 --offset 0 # paging
99
+ fimo assets list --limit 50 --cursor <next-cursor> # next page
100
+ fimo assets list --all-pages # every remaining page
100
101
  ```
101
102
 
103
+ The response includes `nextCursor` when another page exists. Keep the same filters when continuing. `--offset` remains a compatibility alias for existing scripts.
104
+
102
105
  The `--search` query matches:
103
106
 
104
107
  - `name` (file name)
@@ -142,11 +145,47 @@ When the agent needs to **see** the image — e.g., Claude inspecting it to pick
142
145
  fimo assets create-folder "Blog Images"
143
146
  fimo assets create-folder "Covers" --parent-id <uuid>
144
147
  fimo assets move <asset-id> --parent-id <folder-uuid>
145
- fimo assets delete <asset-id>
146
148
  ```
147
149
 
148
150
  `--parent-id` is **required** on `move` and must be a folder UUID. (Moving an asset back to the library root isn't supported by this command today — the server rejects a non-UUID parent.)
149
151
 
152
+ ## Inspect, replace, and remove safely
153
+
154
+ Check structured content references before removal:
155
+
156
+ ```bash
157
+ fimo assets usage <asset-id> --json
158
+ ```
159
+
160
+ The result reports coverage, status, and counts for the Current Branch, Main, and Live. Other Branches are not checked, so this is guidance, never a project-wide claim that an asset is unused. Code references are not scanned.
161
+
162
+ Replace structured references only in the Current Branch:
163
+
164
+ ```bash
165
+ fimo assets replace <source-id> --with <replacement-id>
166
+ ```
167
+
168
+ This changes references, not file bytes. It leaves the original asset, Main, Live, other Branches, and code references unchanged.
169
+
170
+ Remove from the selected environment and include reference guidance in the receipt:
171
+
172
+ ```bash
173
+ fimo assets remove <asset-id>
174
+ fimo assets remove <source-id> --replace-with <replacement-id>
175
+ fimo assets remove <asset-id> --without-checking
176
+ ```
177
+
178
+ Reference counts and incomplete scopes do not block environment removal. Main and Live keep their rows, and shared bytes remain available to them. Use `--replace-with` when Current Branch references should point to another asset before removal. `--without-checking` skips only the guidance scan and remains environment-scoped.
179
+
180
+ Project-wide destruction is separate and requires confirmation:
181
+
182
+ ```bash
183
+ fimo assets remove <asset-id> --permanent
184
+ fimo assets remove <asset-id> --permanent --yes
185
+ ```
186
+
187
+ Use `--permanent` only when the user explicitly wants the asset destroyed across the project. It cannot be combined with `--replace-with` or `--without-checking`. The legacy `fimo assets delete` spelling remains an alias for `remove`.
188
+
150
189
  ## End-to-end workflow
151
190
 
152
191
  1. Upload with `fimo assets upload`, use `fimo assets bulk-upload` for a batch, or generate with a task command such as `fimo image generate`.
@@ -4,7 +4,7 @@
4
4
 
5
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 Branch: `main`. You create more for feature work, deploy previews per Branch, then merge back and publish.
7
+ New standalone projects start with one Branch: `main`. Linking an unversioned folder, cloning, and scaffolding read the project's default Branch from Fimo when they set up Git. You create more for feature work, deploy previews per Branch, then merge back and publish.
8
8
 
9
9
  ## The Branch model — how every command picks its target
10
10
 
@@ -15,10 +15,11 @@ fimo --branch <name> <command> # peek at another Branch for one command (does n
15
15
  ```
16
16
 
17
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 deprecated alias for `--branch`. Passing both with **different** values fails with `BRANCH_OPTION_CONFLICT` rather than picking a winner; passing both with the same value is fine.
18
+ - **`--env <name>`** is not a Branch selector. It is rejected; use `--branch <name>`.
19
19
  - Git-changing commands use the current branch; cross-branch status only reports the mismatch.
20
+ - If Git cannot name a Branch, the CLI stops instead of guessing. Check out a Branch or pass `--branch <name>`. Sandboxes receive their Branch through `FIMO_ENV`.
20
21
  - 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
+ - The project's default Branch cannot be deleted. Existing standalone projects use **`main`**.
22
23
  - **`release/*`** Branches are **read-only** — they're tags produced by `fimo publish`, not branches you push to. `fimo deploy` refuses them.
23
24
  - **`prod`** is protected: it cannot be created, forked from, checked out, or deleted. It's updated by publishing, never by pushing.
24
25
 
@@ -35,9 +36,9 @@ fimo --branch <name> <command> # peek at another Branch for one command (does n
35
36
  | `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
37
  | `fimo status` | `git status` | Multi-surface status for the current Branch vs its parent. See below. |
37
38
  | `fimo merge <from>` | `git merge` | Merge another Branch into the current one (multi-surface, atomic, interactive conflict resolver). See below. |
38
- | `fimo publish` | — | Publish the already-synced `main` revision with a stable Fimo publication ID. See "Publishing" below. |
39
+ | `fimo publish` | — | Publish the synced Production source revision with a stable Fimo publication ID. See "Publishing" below. |
39
40
 
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.
41
+ All of these accept the global `--branch` override. `diff`, `status`, `merge`, and `publish` additionally accept `-C, --cwd <dir>` to point at a project directory.
41
42
 
42
43
  > **`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`.
43
44
 
@@ -97,10 +98,10 @@ Syncs the current Branch's data plane from its parent (or `--from <ancestor>`).
97
98
 
98
99
  Two different "go live" mechanisms — don't confuse them:
99
100
 
100
- - **`fimo publish [--label <text>] [--notes <md>]`** — publishes the already-synced `main` revision. Fimo assigns the immutable publication ID; the label and notes are optional annotations. `--skip-validate` is an operator override.
101
- - **`fimo deploy --publish`** — the project-publish path. Pushes the current `main` code and flips the project live in one shot. See `references/deploy.md`.
101
+ - **`fimo publish [--label <text>] [--notes <md>]`** — publishes the synced Production source revision. Fimo assigns the immutable publication ID; the label and notes are optional annotations. `--skip-validate` is an operator override.
102
+ - **`fimo deploy --publish`** — the project-publish path. Pushes the current Production source code and flips the project live in one shot. See `references/deploy.md`.
102
103
 
103
- Use `fimo publish` when `main` is already synced; use `fimo deploy --publish` when the local revision still needs to be pushed first. Both only run from `main`.
104
+ Use `fimo publish` when the Production source Branch is already synced; use `fimo deploy --publish` when the local revision still needs to be pushed first. Both only run from the configured Production source Branch. Existing projects use `main`.
104
105
 
105
106
  ## Anti-patterns
106
107
 
@@ -69,7 +69,7 @@ Use singular commands for one entry. Bulk create and per-entry bulk update also
69
69
  ```bash
70
70
  fimo entries create <TypeName> --body '<json>'
71
71
  fimo entries create <TypeName> --locale es --document-id <documentId> --body '<json>'
72
- fimo entries list <TypeName> [--limit N] [--offset N] [--search Q] [--where JSON] [--sort F] [--fields FIELDS] [--populate FIELDS]
72
+ fimo entries list <TypeName> [--limit N] [--cursor CURSOR] [--all-pages] [--search Q] [--where JSON] [--sort F] [--fields FIELDS] [--populate FIELDS]
73
73
  fimo entries list <TypeName> --locale es
74
74
  fimo entries get <TypeName> <id> [--locale es]
75
75
  fimo entries update <TypeName> <id> [--locale es] --body '<json>'
@@ -90,12 +90,12 @@ fimo entries list BlogPost --where '{"featured":true}' --sort -publishedAt
90
90
  fimo entries list BlogPost --where '{"rank":{"$gte":3}}' --sort rank
91
91
  fimo entries list BlogPost --where '{"__fimo":{"contentType":{"$eq":"BlogPost"}}}'
92
92
  fimo entries list BlogPost --search "launch"
93
- fimo entries list BlogPost --limit 10 --offset 20 --sort title
93
+ fimo entries list BlogPost --limit 10 --cursor <next-cursor> --sort title
94
94
  fimo entries list BlogPost --fields slug,title,excerpt,coverImage --sort -publishedAt --limit 12
95
95
  fimo entries list BlogPost --fields slug,title,author --populate author
96
96
  ```
97
97
 
98
- Use the canonical read query flags: `--search`, `--sort`, `--where`, `--limit`, `--offset`, `--fields`, and `--populate`.
98
+ Use the canonical read query flags: `--search`, `--sort`, `--where`, `--limit`, `--cursor`, `--all-pages`, `--fields`, and `--populate`. `--offset` remains a compatibility alias for existing scripts.
99
99
  `--where` is a JSON object keyed by schema field name. Simple values mean equality and stay typed inside the JSON (`{"featured":true}`, `{"category":"react"}`, `{"rank":{"$gte":3}}`); operator objects support `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$contains`, `$startsWith`, and `$null`, subject to the field type. Public Fimo-owned metadata lives under `__fimo`; currently `__fimo.contentType` is filterable.
100
100
 
101
101
  Reference filters take the target `id` string (`{"author":"750e..."}`). On a to-many field, `$eq` and `$contains` mean membership, `$in` means any listed target is present, `$ne` and `$nin` mean none are present, and `$null: true` means empty or missing. Reference fields cannot be sorted; use `--sort field` / `--sort -field` on scalar fields.
@@ -103,7 +103,7 @@ Reference filters take the target `id` string (`{"author":"750e..."}`). On a to-
103
103
 
104
104
  `--populate` is a comma-separated list of reference fields to embed. Without it, reference fields return reference objects like `{ "id": "..." }`; with `--populate author,contributors`, those fields return the target entry objects for the requested locale. Only reference fields can be populated (scalar fields 400), and populate never selects which target fields come back. A populated target missing in the requested locale resolves to null unless you pass `localeFallbacks=true`, which falls back to the best available locale variant, marked by its `locale` field. Limits: 200 references per to-many write, 500 distinct populated documents per field per request (400 past either).
105
105
 
106
- Polymorphic references declare `targets: ["Post", "Product"]` instead of `target` (never both) and their values carry both parts: `{ "contentType": "Post", "id": "..." }`. Populate returns mixed full entries, and generated hooks expose `$type` on each populated value to branch on. `--where` on polymorphic fields is not supported yet and fails with a clear error.
106
+ Polymorphic references declare `targets: ["Post", "Product"]` instead of `target` (never both) and their values carry both parts: `{ "contentType": "Post", "id": "..." }`. Populate returns mixed full entries, and generated hooks expose `$type` on each populated value to branch on. `--where` on polymorphic fields is not supported yet and fails with a clear error. Fixed and polymorphic references also work inside blocks with these same write shapes (`id`, `documentId`, or `slug` selectors), but nested fields cannot be populated or filtered.
107
107
 
108
108
  In generated application code, the equivalent is `populate: ['author', 'contributors'] as const` in query params. Let the generated client infer the result when possible; if a named TypeScript shape is needed, use `BlogPostResult<TFields, TPopulate>` as documented by `fimo skills get fimo-code --ref content/clients`. Writes use `BlogPostInput`.
109
109
 
@@ -13,31 +13,29 @@ This command is **project-scoped but not Branch-scoped**. It does not depend on
13
13
 
14
14
  ## Pretty Output
15
15
 
16
- The human output has three sections:
16
+ The human output has two sections:
17
17
 
18
18
  - **Available now** - total spendable credits across all usable buckets, plus a status of `OK`, `Low`, or `Unavailable`.
19
- - **Breakdown (included in available now)** - daily free, monthly, purchased, and awarded buckets. These are components of the total, not extra credits to add again.
20
- - **Daily allowance (not additional balance)** - period cap, period usage, remaining period allowance, and the maximum daily grant. This explains plan/accounting limits and can be absent.
19
+ - **Breakdown (included in available now)** - daily free, monthly, purchased, and awarded buckets. These are components of the total, not extra credits to add again. Daily free is 0 except for organizations on the legacy Premium plan, the only plan with daily credits.
21
20
 
22
21
  Example:
23
22
 
24
23
  ```txt
25
24
  Available now
26
- 12,430 credits
25
+ 11,830 credits
27
26
  Status: OK
28
27
 
29
28
  Breakdown (included in available now)
30
- Daily free 600 expires today
29
+ Daily free 0
31
30
  Monthly 8,000
32
31
  Purchased 3,000
33
32
  Awarded 830
34
-
35
- Daily allowance (not additional balance)
36
- Used this period: 4,400 / 5,000
37
- Remaining period: 600
38
- Daily grant: up to 1,000 / day
39
33
  ```
40
34
 
35
+ Organizations on the legacy Premium plan also show a "Daily allowance (not
36
+ additional balance)" section. It is accounting context already included in
37
+ "Available now", never extra credits to add.
38
+
41
39
  ## JSON Output
42
40
 
43
41
  Use `--json` when another tool or agent needs to parse the balance:
@@ -51,29 +49,24 @@ Use `--json` when another tool or agent needs to parse the balance:
51
49
  "projectId": "project_123",
52
50
  "organizationId": "org_123",
53
51
  "balance": {
54
- "totalAvailable": 12430,
52
+ "totalAvailable": 11830,
55
53
  "nearLimit": false,
56
54
  "canUseAi": true,
57
55
  "buckets": {
58
- "dailyFreeAvailable": 600,
56
+ "dailyFreeAvailable": 0,
59
57
  "monthlyAvailable": 8000,
60
58
  "purchasedAvailable": 3000,
61
59
  "awardedAvailable": 830
62
60
  }
63
61
  },
64
62
  "allowances": {
65
- "dailyCredits": {
66
- "periodCap": 5000,
67
- "dailyGrant": 1000,
68
- "usedThisPeriod": 4400,
69
- "remainingThisPeriod": 600
70
- }
63
+ "dailyCredits": null
71
64
  }
72
65
  }
73
66
  }
74
67
  ```
75
68
 
76
- `allowances.dailyCredits` can be `null` when the project owner's plan/account does not expose a daily allowance. Do not derive spendability from the allowance alone; use `balance.canUseAi`, `balance.nearLimit`, and `balance.totalAvailable`.
69
+ `allowances.dailyCredits` is `null` except for organizations on the legacy Premium plan, the only plan with a daily allowance. Do not derive spendability from the allowance alone; use `balance.canUseAi`, `balance.nearLimit`, and `balance.totalAvailable`.
77
70
 
78
71
  ## When To Run It
79
72
 
@@ -4,7 +4,7 @@
4
4
 
5
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-Branch workflow.
7
+ `fimo deploy` uses the current Branch. New projects start on `main`; `release/*` is read-only, and `--publish` only runs from the project's configured Production source Branch. 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
 
@@ -20,7 +20,7 @@ fimo deploy -m "<commit message>" --publish # also publish a new live version
20
20
  ```
21
21
 
22
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
- - **`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.)
23
+ - **`fimo deploy --publish`** — same as above, then triggers a live publish and prints the live URL. Runs from the configured Production source Branch 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.
26
26
 
@@ -50,11 +50,11 @@ Public project variables managed with `fimo vars add` and `fimo vars update` are
50
50
 
51
51
  ## Diagnose a failed publication
52
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.
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. Use `fimo publish list --cursor <cursor>` to continue through older attempts or `--all-pages` to fetch the complete retained history. `--before` remains a compatibility alias. Logs come from the hosting provider and may be unavailable after its deployment is reclaimed.
54
54
 
55
55
  ## Diagnose a failed preview deploy
56
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.
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 --cursor <cursor> --json` to fetch the preceding page, or use `--all-pages` to fetch every retained page. `--before` remains a compatibility alias. Do not recreate or replace the sandbox before collecting logs, because that can discard the failure evidence.
58
58
 
59
59
  When Preview reports blocked dependency build scripts, treat that as a project security-policy repair, not a transient sandbox failure. Review every named package before approving it, then use the package manager's narrow project-owned mechanism:
60
60
 
@@ -121,10 +121,10 @@ There's nothing special about this — it's the same `fimo deploy` you'd run lat
121
121
 
122
122
  Two different "go live" mechanisms — pick deliberately:
123
123
 
124
- - **`fimo deploy --publish`** — push what's on `main` now and flip the project live in one shot. The simple "ship it" path. Runs from `main` only.
125
- - **`fimo publish [--label <text>] [--notes <md>]`** — publish the already-synced `main` revision without pushing. Fimo assigns the immutable publication ID; a label and notes are optional human annotations. See `references/branches.md`.
124
+ - **`fimo deploy --publish`** — push what's on the Production source Branch now and flip the project live in one shot. The simple "ship it" path. Runs from that Branch only.
125
+ - **`fimo publish [--label <text>] [--notes <md>]`** — publish the synced Production source revision without pushing. Fimo assigns the immutable publication ID; a label and notes are optional human annotations. See `references/branches.md`.
126
126
 
127
- When unsure, use `fimo deploy --publish` so the local revision is pushed before it goes live. Use `fimo publish` when `main` is already synced.
127
+ When unsure, use `fimo deploy --publish` so the local revision is pushed before it goes live. Use `fimo publish` when the Production source Branch is already synced.
128
128
 
129
129
  ## Markdown for AI agents
130
130
 
@@ -157,7 +157,7 @@ fimo deploy
157
157
 
158
158
  - Source of truth is this git repo.
159
159
  - **Never** edit `.fimo/project.json`; it is generated by `fimo init`.
160
- - Each Branch deploys to its own preview sandbox; `--publish` and `fimo publish` run from `main` only. See `references/branches.md`.
160
+ - Each Branch deploys to its own preview sandbox; `--publish` and `fimo publish` run from the configured Production source Branch only. See `references/branches.md`.
161
161
 
162
162
  ## After the first successful deploy
163
163
 
@@ -29,11 +29,13 @@ Notification recipients for form submissions are configured in the Fimo web UI,
29
29
  After a form is live and users have filled it out, inspect submissions from the terminal:
30
30
 
31
31
  ```bash
32
- fimo forms submissions list <formIdOrName> [--limit 50] [--offset 0] [--search "<q>"] [--sort asc|desc]
32
+ fimo forms submissions list <formIdOrName> [--limit 50] [--cursor CURSOR] [--all-pages] [--search "<q>"] [--sort asc|desc]
33
33
  fimo forms submissions get <formIdOrName> <submissionId>
34
34
  fimo forms submissions stats <formIdOrName>
35
35
  ```
36
36
 
37
+ The list response includes `nextCursor` when another page exists. `--offset` remains a compatibility alias for existing scripts.
38
+
37
39
  - `<formIdOrName>` accepts either the form's UUID or its `name` (the same name in the JSON file). Names that don't resolve to exactly one form return an error.
38
40
  - `list` returns `{ data: [...], total }`. Newest-first by default; pass `--sort asc` to reverse.
39
41
  - `search` matches against submission contents server-side.
@@ -18,8 +18,8 @@ fimo history restore <version-id>
18
18
 
19
19
  Studio chat can run `history list` and `history show`. Create and restore remain available through the standalone CLI and Studio's History page.
20
20
 
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
21
+ Use the global `--branch <name>` option to target a different Branch. The removed
22
+ `--env <name>` spelling is rejected as a Branch selector. Use `--project <id>` when
23
23
  there is no local `.fimo/project.json`.
24
24
 
25
25
  ## Pagination and usage
@@ -28,6 +28,7 @@ there is no local `.fimo/project.json`.
28
28
 
29
29
  ```bash
30
30
  fimo history list --limit 20 --cursor <cursor>
31
+ fimo history list --all-pages
31
32
  ```
32
33
 
33
34
  The list also reports compressed snapshot usage and the current retention period. Restore points expire after 14 days on Free and pay-as-you-go plans, or 90 days on Premium. The expiry is fixed when each point is created.