diff --git a/.gitignore b/.gitignore index e38d30a0..e3dccb2f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ dist/ .spacefast/ node_modules/ content/(reference)/cli/reference.md +content/(reference)/cli/commands/ content/(reference)/errors/ content/(reference)/changelog/ content/setup/ diff --git a/AGENTS.md b/AGENTS.md index 1cc8c787..9f465eaa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,7 +49,9 @@ Assume every commit and every line of history will be public. producer-owned snapshot. The exporter owns every file there, including the manifest and ownership marker. Do not hand-edit them. - `.blume/**` and `dist/**` are generated by Blume. Never edit or commit them. -- `content/(reference)/cli/reference.md`, `content/(reference)/errors/**`, +- `content/(reference)/cli/reference.md`, `content/(reference)/cli/commands/**` + (one page per top-level command, split from the same snapshot and served at + `/cli/reference/`), `content/(reference)/errors/**`, `content/(reference)/changelog/**`, `content/setup/**`, and `public/_redirects` are ignored build overlays materialized from the verified snapshot. Do not hand-edit them. diff --git a/blume.config.ts b/blume.config.ts index 2e02f2b2..e7eb7e4c 100644 --- a/blume.config.ts +++ b/blume.config.ts @@ -49,9 +49,6 @@ const icons = { handshake: phosphor( "M254.3,107.91,228.78,56.85a16,16,0,0,0-21.47-7.15L182.44,62.13,130.05,48.27a8.14,8.14,0,0,0-4.1,0L73.56,62.13,48.69,49.7a16,16,0,0,0-21.47,7.15L1.7,107.9a16,16,0,0,0,7.15,21.47l27,13.51,55.49,39.63a8.06,8.06,0,0,0,2.71,1.25l64,16a8,8,0,0,0,7.6-2.1l55.07-55.08,26.42-13.21a16,16,0,0,0,7.15-21.46Zm-54.89,33.37L165,113.72a8,8,0,0,0-10.68.61C136.51,132.27,116.66,130,104,122L147.24,80h31.81l27.21,54.41ZM41.53,64,62,74.22,36.43,125.27,16,115.06Zm116,119.13L99.42,168.61l-49.2-35.14,28-56L128,64.28l9.8,2.59-45,43.68-.08.09a16,16,0,0,0,2.72,24.81c20.56,13.13,45.37,11,64.91-5L188,152.66Zm62-57.87-25.52-51L214.47,64,240,115.06Zm-87.75,92.67a8,8,0,0,1-7.75,6.06,8.13,8.13,0,0,1-1.95-.24L80.41,213.33a7.89,7.89,0,0,1-2.71-1.25L51.35,193.26a8,8,0,0,1,9.3-13l25.11,17.94L126,208.24A8,8,0,0,1,131.82,217.94Z", ), - house: phosphor( - "M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z", - ), rocket: phosphor( "M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z", ), @@ -67,7 +64,7 @@ export default defineConfig({ // Plan values from scripts/pricing-next.mjs, the source Pricing & Limits renders. ...planVariables(), }, - description: "Build better and ship with Spacefast — skills, tools, database, Workers, domains, and infrastructure in one Space.", + description: "Build better and ship with Spacefast: skills, tools, database, Workers, domains, and infrastructure in one Space.", // Two links (components/Logo.astro): the mark goes to the Website home at the // origin root, outside the /docs base; "Docs" goes to the Docs home. logo: { href: "/", image: { light: "/spacefast-wordmark.svg", alt: "Spacefast" }, text: "Docs" }, @@ -122,7 +119,6 @@ export default defineConfig({ navigation: { cta: { href: "https://my.spacefast.com", label: "Dashboard" }, featured: [ - { label: "Spacefast", href: "https://spacefast.com", icon: icons.house }, { label: "Agent setup", href: "/agents", icon: icons.robot }, ], repo: true, diff --git a/components/Header.astro b/components/Header.astro index 0ebdb504..246b1c01 100644 --- a/components/Header.astro +++ b/components/Header.astro @@ -18,3 +18,17 @@ const route = tab && tab.path !== "/" ? tab.path : props.route; ---
+ + diff --git a/components/sections.ts b/components/sections.ts index 4c81364f..6b31e9f1 100644 --- a/components/sections.ts +++ b/components/sections.ts @@ -15,6 +15,7 @@ import type { NavNode, NavTab } from "blume/core/types.ts"; // Navigation routes are base-less; Blume adds the deployment base when it renders links. export const referenceTabPath = "/reference"; export const agentsTabPath = "/agents"; +const platformsTabPath = "/platforms"; const referenceGroupLabel = "Reference"; const agentRoots = ["/setup", "/connect"]; @@ -94,6 +95,26 @@ const referenceSidebar = (sidebar: NavNode[]): NavNode[] => { }); }; +/** Platforms tab sidebar: fold the Partner API reference into the Partner API group, as the Reference tab does for REST. */ +const platformsSidebar = (nodes: NavNode[]): NavNode[] => { + const isApi = (node: NavNode) => node.kind === "group" && node.path === "/platforms/api"; + const reference = nodes.flatMap((node) => + node.kind === "group" && isApi(node) + ? node.children.map((child) => + child.kind === "group" && child.path === "/platforms/api/reference" ? { ...child, label: "API reference" } : child, + ) + : [], + ); + if (reference.length === 0) return nodes; + return nodes + .filter((node) => !isApi(node)) + .map((node) => + node.kind === "group" && node.path === "/platforms/partner-api" + ? { ...node, children: [...node.children, ...reference] } + : node, + ); +}; + /** The sidebar for a route's tab. */ export const sectionSidebar = ( sidebar: NavNode[], @@ -110,6 +131,7 @@ export const sectionSidebar = ( ); return [...agents, ...generated]; } + if (tab?.path === platformsTabPath) return platformsSidebar(sidebarForRoute(sidebar, tabs, route, root)); if (tab && tab.path !== "/") return sidebarForRoute(sidebar, tabs, route, root); return sidebar.filter((node) => !outsideDocs(node, sidebar, tabs)); }; diff --git a/content/(account)/(labs)/design-system.mdx b/content/(account)/(labs)/design-system.mdx index f2cf3d0a..56b60c03 100644 --- a/content/(account)/(labs)/design-system.mdx +++ b/content/(account)/(labs)/design-system.mdx @@ -1,6 +1,8 @@ --- title: Design System description: Save a team's design rules once, then reuse and check them across projects +sidebar: + badge: Labs --- Labs @@ -11,10 +13,13 @@ For agent imports and updates, use a Spacefast plugin with the [Design System ta ## Start a Design System -Design System is a [Labs](/labs) feature. Join **Design System** in **Team settings → Labs**, then open the team and choose **Design System**. If you see **Set up team context**, follow the [shared context setup](/labs#shared-team-context-setup) first. Then choose how to start: +Design System is a [Labs](/labs) feature. -- **Import what you already have.** Choose **Copy prompt** and give it to an agent connected to [Spacefast MCP](/agents). Give the agent your brand guide, Figma file, or repository too. With `import-design-system` installed, the agent saves supported values, registers source files, and keeps other guidance in supporting [Team Memories](/team-memories). Ask for a report of conflicts and anything it could not import. -- **Start from a kit.** Choose **shadcn/ui**, **Tailwind CSS**, or **Spacefast default**. The kit saves editable colors, type, and layout values. Review them before applying them to a project. +1. Join **Design System** in [**Team settings → Labs**](https://my.spacefast.com/?to=/:team/settings/labs). +2. Open the team's [**Design System**](https://my.spacefast.com/?to=/:team/design-system) page. If you see **Set up team context**, follow the [shared context setup](/labs#shared-team-context-setup) first. +3. Choose how to start: + - **Import what you already have.** Choose **Copy prompt** and give it to an agent connected to [Spacefast MCP](/agents). Give the agent your brand guide, Figma file, or repository too. With `import-design-system` installed, the agent saves supported values, registers source files, and keeps other guidance in supporting [Team Memories](/team-memories). Ask for a report of conflicts and anything it could not import. + - **Start from a kit.** Choose **shadcn/ui**, **Tailwind CSS**, or **Spacefast default**. The kit saves editable colors, type, and layout values. Review them before applying them to a project. You can also add the standards yourself in the dashboard. **Look & feel** holds named colors, typography for headings and body text, and layout dimensions. **Voice** holds a tone description and writing rules with optional examples. diff --git a/content/(account)/(labs)/labs.mdx b/content/(account)/(labs)/labs.mdx index e82b73dc..3bec648d 100644 --- a/content/(account)/(labs)/labs.mdx +++ b/content/(account)/(labs)/labs.mdx @@ -31,7 +31,7 @@ Three team-context features are available through Labs. They share one private s ## How joining works -Open your team and go to **Team settings → Labs** to see available features, how to join each one, and your team's current status. +Open [**Team settings → Labs**](https://my.spacefast.com/?to=/:team/settings/labs) to see available features, how to join each one, and your team's current status. | How to join | What happens | | --- | --- | @@ -72,4 +72,4 @@ Use these keys in the API: ## Shared team context setup -Team Memories, Team Skills, and Design System store their records in one private context home per team. The first time you open **Memories**, **Skills**, or **Design System** in the dashboard, select **Set up team context** if prompted. Over the API, call [`ensureTeamContext`](/api/reference/teams/ensureteamcontext) (`POST /v1/teams/{teamId}/context`) with an empty request body and a credential that holds `spaces:write`. Repeated calls reuse the same storage home. +Team Memories, Team Skills, and Design System store their records in one private context home per team. The first time you open [**Memories**](https://my.spacefast.com/?to=/:team/memory), [**Skills**](https://my.spacefast.com/?to=/:team/skills), or [**Design System**](https://my.spacefast.com/?to=/:team/design-system) in the dashboard, select **Set up team context** if prompted. Over the API, call [`ensureTeamContext`](/api/reference/teams/ensureteamcontext) (`POST /v1/teams/{teamId}/context`) with an empty request body and a credential that holds `spaces:write`. Repeated calls reuse the same storage home. diff --git a/content/(account)/(labs)/team-memories.mdx b/content/(account)/(labs)/team-memories.mdx index ee5992cd..a4df35a6 100644 --- a/content/(account)/(labs)/team-memories.mdx +++ b/content/(account)/(labs)/team-memories.mdx @@ -1,6 +1,8 @@ --- title: Team Memories description: Save lasting team and Space facts that connected agents read before they work +sidebar: + badge: Labs --- Labs @@ -13,10 +15,10 @@ Memories share private context storage with [Team Skills](/team-skills) and [Des - Join **Memories** in **Team settings → Labs**. See [Labs](/labs). + Join **Memories** in [**Team settings → Labs**](https://my.spacefast.com/?to=/:team/settings/labs). See [Labs](/labs). - Open **Memories** in your team and select **Set up team context** if prompted. Owners, admins, and members with publishing access can run setup. + Open [**Memories**](https://my.spacefast.com/?to=/:team/memory) in your team and select **Set up team context** if prompted. Owners, admins, and members with publishing access can run setup. Add facts your agents should remember across sessions, scoped either to the whole team or to one Space. diff --git a/content/(account)/(labs)/team-skills.mdx b/content/(account)/(labs)/team-skills.mdx index f4556054..16adc1be 100644 --- a/content/(account)/(labs)/team-skills.mdx +++ b/content/(account)/(labs)/team-skills.mdx @@ -1,6 +1,8 @@ --- title: Team Skills description: Turn on preset practices like SEO, accessibility, and spam protection for every agent on your team +sidebar: + badge: Labs --- Labs @@ -13,10 +15,10 @@ Team Skills share private context storage with [Team Memories](/team-memories) a - Apply for **Skills** in **Team settings → Labs** with a short note explaining how your team plans to use it. See [Labs](/labs). + Apply for **Skills** in [**Team settings → Labs**](https://my.spacefast.com/?to=/:team/settings/labs) with a short note explaining how your team plans to use it. See [Labs](/labs). - Open **Skills** in your team and select **Set up team context** if prompted, or call [`ensureTeamContext`](/api/reference/teams/ensureteamcontext) (`POST /v1/teams/{teamId}/context`) with no request body. + Open [**Skills**](https://my.spacefast.com/?to=/:team/skills) in your team and select **Set up team context** if prompted, or call [`ensureTeamContext`](/api/reference/teams/ensureteamcontext) (`POST /v1/teams/{teamId}/context`) with no request body. Turn on the presets you want every agent on the team to follow. diff --git a/content/(account)/api-keys.mdx b/content/(account)/api-keys.mdx index 87832f9f..3a47196e 100644 --- a/content/(account)/api-keys.mdx +++ b/content/(account)/api-keys.mdx @@ -11,7 +11,7 @@ Keys belong to a team, and only that team's owners and admins can mint them. - In the dashboard, go to your team and open **Agents**. Keys live in the **API keys** section. Older addresses like `//api-keys` redirect here. + Open your team's [**Agents**](https://my.spacefast.com/?to=/:team/api-keys) page. Keys live in the **API keys** section. Older addresses like `//api-keys` redirect here. **Name** is what you will recognize it by later, for example `CLI on my laptop`. **Policy preset** bounds what the key can do. **Expires** is optional and blank means no expiry. @@ -86,7 +86,7 @@ sf api-keys update key_0123456789abcdef --connection cxn_abc123 --connection cxn sf api-keys update key_0123456789abcdef --all-connections ``` -Over the API, pass `connectorAccess: { connectionIds: ["cxn_abc123"] }` on `POST /v1/api-keys` or `PATCH /v1/api-keys/{apiKeyId}`, or `connectorAccess: null` to remove the limit. For OAuth apps and CLI logins, choose specific connections under **Choose Connections** on the consent screen, or edit them later on **Connected apps**. See [Connectors](/connectors). +Over the API, pass `connectorAccess: { connectionIds: ["cxn_abc123"] }` on `POST /v1/api-keys` or `PATCH /v1/api-keys/{apiKeyId}`, or `connectorAccess: null` to remove the limit. For OAuth apps and CLI logins, choose specific connections under **Choose Connections** on the consent screen, or edit them later on [**Connected apps**](https://my.spacefast.com/account/connected-apps). See [Connectors](/connectors). ## What an agent grant cannot do @@ -101,13 +101,13 @@ A credential that tries gets a `403` with `authorization_level_not_allowed`. Do ## Rotate a key -A secret is immutable, so rotation means a new key. In the dashboard, **Replace key…** mints a fresh key with the same policy. It then offers to revoke the old one once your integrations have moved over. +A secret is immutable, so rotation means a new key. On the team's [**Agents**](https://my.spacefast.com/?to=/:team/api-keys) page, **Replace key…** mints a fresh key with the same policy. It then offers to revoke the old one once your integrations have moved over. Revoking is immediate. Anything using that key fails on its next request. The row stays in the list marked revoked, so the audit trail survives. ## Deploy tokens -For a CI pipeline or script that only needs one Space, mint a Space-scoped **deploy token** (`sfm_`) instead of a team-wide `sfa_` API key. Deploy tokens are Share entries (`audience: "token"`) managed through [`sf deploy-tokens`](/cli/reference#sf-deploy-tokens) and `/v1/spaces/{spaceId}/share/entries`: +For a CI pipeline or script that only needs one Space, mint a Space-scoped **deploy token** (`sfm_`) instead of a team-wide `sfa_` API key. Deploy tokens are Share entries (`audience: "token"`) managed through [`sf deploy-tokens`](/cli/reference/deploy-tokens#sf-deploy-tokens) and `/v1/spaces/{spaceId}/share/entries`: ```bash # Preview-only deploy token (default) @@ -120,7 +120,7 @@ sf deploy-tokens create --name ci-release --live --expires 90d --show-secret sf deploy-tokens create --name docs-feed --view-only --path '/docs/**' --show-secret ``` -Pass the returned `sfm_` token in `SPACEFAST_TOKEN` or `Authorization: Bearer sfm_...`. Manage tokens without recreating them using [`sf deploy-tokens list`](/cli/reference#sf-deploy-tokens-list), [`sf deploy-tokens update`](/cli/reference#sf-deploy-tokens-update-id), [`sf deploy-tokens rotate`](/cli/reference#sf-deploy-tokens-rotate-id), and [`sf deploy-tokens revoke`](/cli/reference#sf-deploy-tokens-revoke-id). See [Publish from CI](/ci) for GitHub Actions and GitLab CI examples. +Pass the returned `sfm_` token in `SPACEFAST_TOKEN` or `Authorization: Bearer sfm_...`. Manage tokens without recreating them using [`sf deploy-tokens list`](/cli/reference/deploy-tokens#sf-deploy-tokens-list), [`sf deploy-tokens update`](/cli/reference/deploy-tokens#sf-deploy-tokens-update-id), [`sf deploy-tokens rotate`](/cli/reference/deploy-tokens#sf-deploy-tokens-rotate-id), and [`sf deploy-tokens revoke`](/cli/reference/deploy-tokens#sf-deploy-tokens-revoke-id). See [Publish from CI](/ci) for GitHub Actions and GitLab CI examples. ## Every credential, by prefix @@ -128,8 +128,8 @@ Spacefast puts a prefix on each credential so you always know what you are holdi | Prefix | What it is | Where you get it | |---|---|---| -| `sfa_` | API key. The credential for the CLI, CI, and server-to-server calls | The team's **Agents** page, `sf api-keys create`, or `sf login` | -| `sfm_` | Space machine or deploy token. Publishes one Space (preview-only or live) or reads a private Space's pages | [`sf deploy-tokens create`](/cli/reference#sf-deploy-tokens-create) or [`sf share token create`](/cli/reference#sf-share-token-create), shown once, rotatable | +| `sfa_` | API key. The credential for the CLI, CI, and server-to-server calls | The team's [**Agents**](https://my.spacefast.com/?to=/:team/api-keys) page, `sf api-keys create`, or `sf login` | +| `sfm_` | Space machine or deploy token. Publishes one Space (preview-only or live) or reads a private Space's pages | [`sf deploy-tokens create`](/cli/reference/deploy-tokens#sf-deploy-tokens-create) or [`sf share token create`](/cli/reference/share#sf-share-token-create), shown once, rotatable | | `sfc_` | Space key. Proves you published an anonymous Space, keeps updating it, and claims it later | The publish receipt, and the fragment of the claim URL | | `sfl_` | Share link token. Rides in the `?__=` query of a share URL | `sf share link create`, or the dashboard access panel | | `sfp_` | Git push credential, embedded in the push remote URL | The dashboard, inside the `git remote add` line it gives you | diff --git a/content/(account)/authentication.mdx b/content/(account)/authentication.mdx index 493701ca..6048403c 100644 --- a/content/(account)/authentication.mdx +++ b/content/(account)/authentication.mdx @@ -9,7 +9,7 @@ To create a Spacefast account, you need an email address and the six-digit code Type your email address on the sign-in page and press **Continue**. If the address has no account yet, Spacefast mails you a six-digit code. Enter the code to finish signing up. -There is no password signup. Add a password later from **Account settings → Security**. +There is no password signup. Add a password later from [**Account settings → Security**](https://my.spacefast.com/account/security). Two other ways in create an account for you: @@ -34,13 +34,13 @@ A secondary address on your account signs you in to that same account, and the c ## Add a password -Go to **Account settings → Security → Sign-in methods** and press **Set password**. Passwords are eight characters or more, and Spacefast rejects any password that appears in public breach lists. +Go to [**Account settings → Security → Sign-in methods**](https://my.spacefast.com/account/security) and press **Set password**. Passwords are eight characters or more, and Spacefast rejects any password that appears in public breach lists. The same section lists **Email code**, **Password**, and one row per social provider with **Connect** or **Disconnect**. You cannot remove your last way in. Try it and you get "That's your only way in. Set a password or connect another method first." ## Turn on two-factor -Two-factor lives at **Account settings → Security → Two-factor authentication**. +Two-factor lives at [**Account settings → Security → Two-factor authentication**](https://my.spacefast.com/account/security). @@ -75,20 +75,20 @@ The screen is titled **Confirm it's you** and takes your password, an emailed co A session lasts 30 days and refreshes every day you use it. You can keep up to five accounts signed in at once in the same browser and switch between them. -**Account settings → Security → Sessions** lists every signed-in device with the browser, operating system, IP address, when it started, and when it expires. The one you are on is marked **This device**. +[**Account settings → Security → Sessions**](https://my.spacefast.com/account/security) lists every signed-in device with the browser, operating system, IP address, when it started, and when it expires. The one you are on is marked **This device**. - **Revoke** on a row signs that browser out immediately. - **Revoke other sessions** signs out everything except the device you are on. -Sessions are separate from agent access. To cut off an agent or a CLI, use **Account settings → Connected apps**. See [what agents are allowed to do](/agents/permissions). +Sessions are separate from agent access. To cut off an agent or a CLI, use [**Account settings → Connected apps**](https://my.spacefast.com/account/connected-apps). See [what agents are allowed to do](/agents/permissions). ## Log the CLI in -[`sf login`](/cli/reference#sf-login) does not store a browser session. It runs a browser approval flow and stores an API key scoped to what you approved. +[`sf login`](/cli/reference/login#sf-login) does not store a browser session. It runs a browser approval flow and stores an API key scoped to what you approved. - Run [`sf login`](/cli/reference#sf-login). Add `--access read` if you want a credential that changes nothing. + Run [`sf login`](/cli/reference/login#sf-login). Add `--access read` if you want a credential that changes nothing. The CLI prints an eight-character code and a link, and opens your browser when it can. @@ -109,7 +109,7 @@ Sessions are separate from agent access. To cut off an agent or a CLI, use **Acc Press **Allow**, or **Deny** to refuse it. - The CLI picks the approval up within a few seconds and prints who you are and which teams the credential reaches. Run [`sf whoami`](/cli/reference#sf-whoami) any time to see it again. + The CLI picks the approval up within a few seconds and prints who you are and which teams the credential reaches. Run [`sf whoami`](/cli/reference/whoami#sf-whoami) any time to see it again. @@ -126,7 +126,7 @@ About that credential: Inside each team, the credential can't do more than your current role allows there. If your role changes, the new role applies from the credential's next request. -[`sf logout`](/cli/reference#sf-logout) deletes the local login and revokes the key when the CLI minted it. To kill it from the browser instead, revoke the connection under **Account settings → Connected apps**. Requests made with an expired or revoked credential return `401` [`unauthorized`](/errors/unauthorized). +[`sf logout`](/cli/reference/logout#sf-logout) deletes the local login and revokes the key when the CLI minted it. To kill it from the browser instead, revoke the connection under [**Account settings → Connected apps**](https://my.spacefast.com/account/connected-apps). Requests made with an expired or revoked credential return `401` [`unauthorized`](/errors/unauthorized). ## Account settings diff --git a/content/(account)/auto-enroll.mdx b/content/(account)/auto-enroll.mdx index ab9376ed..e0e7bfb1 100644 --- a/content/(account)/auto-enroll.mdx +++ b/content/(account)/auto-enroll.mdx @@ -9,7 +9,7 @@ Only owners and admins can add or remove domains. An OAuth token needs the `team ## Add a domain -1. Open the team and go to **Members**. +1. Open the team's [**Members**](https://my.spacefast.com/?to=/:team/members) page. 2. Press **Join Link**. The **Let Teammates Join** dialog opens. 3. Type the domain, for example `example.com`, in **Company email domain**. 4. Press **Add Domain**. @@ -40,11 +40,11 @@ Spacefast stores the canonical form: lowercase ASCII, with international names c ## What a person sees -A signed-in person with a verified address at the domain sees your team under **Open invites** on the **Teams** page. The row reads **You have an @example.com email**. Their team's Spaces page also shows a **Teams you can join** notice with **View Teams**. +A signed-in person with a verified address at the domain sees your team under **Open invites** on the [**Teams**](https://my.spacefast.com/teams) page. The row reads **You have an @example.com email**. Their team's Spaces page also shows a **Teams you can join** notice with **View Teams**. Every verified address on the account counts, including secondary addresses. The account does not need to use that address to sign in. -Pressing **Join** makes them a member with the `member` role. Owners and admins can change the role later on **Members**. Joining needs a signed-in browser session. An API key or an agent cannot join for a person. The API operation is [`joinTeam`](/api/reference/teams/jointeam). +Pressing **Join** makes them a member with the `member` role. Owners and admins can change the role later on [**Members**](https://my.spacefast.com/?to=/:team/members). Joining needs a signed-in browser session. An API key or an agent cannot join for a person. The API operation is [`joinTeam`](/api/reference/teams/jointeam). ## Seats and billing @@ -54,7 +54,7 @@ Personal and Go allow one member, the owner. On those plans, **Join** fails with ## Remove a domain -In **Join Link**, press **Remove** next to the domain. Confirm with **Remove Domain**. +In **Join Link** on [**Members**](https://my.spacefast.com/?to=/:team/members), press **Remove** next to the domain. Confirm with **Remove Domain**. Over HTTP, send [`deleteTeamAutoEnrollEntry`](/api/reference/teams/deleteteamautoenrollentry) with the entry `id`. It answers `204`. diff --git a/content/(account)/billing.mdx b/content/(account)/billing.mdx index cc60b40c..d7c93a9b 100644 --- a/content/(account)/billing.mdx +++ b/content/(account)/billing.mdx @@ -7,7 +7,7 @@ Manage your plan here. Prices, allowances, and limits for every plan are on [Pri ## Upgrade, downgrade or cancel -Open your team's **Settings → Billing** to change or cancel a plan. Only owners and admins can change billing. Choose **Open billing portal** for invoices and payment methods. +Open your team's [**Settings → Billing**](https://my.spacefast.com/?to=/:team/settings/billing) to change or cancel a plan. Only owners and admins can change billing. Choose **Open billing portal** for invoices and payment methods. Upgrades apply immediately and are prorated. Downgrades apply at renewal. Cancellation stops renewal, with access continuing until the paid period ends. There are no refunds. Review the price and effective date before confirming. diff --git a/content/(account)/identity-connections.mdx b/content/(account)/identity-connections.mdx index e84f0131..3157f78e 100644 --- a/content/(account)/identity-connections.mdx +++ b/content/(account)/identity-connections.mdx @@ -28,7 +28,7 @@ Spacefast reads `/.well-known/openid-configuration` over HTTPS. The `iss ## Add a connection in the dashboard -1. Open the team and go to **Team settings → Access**. +1. Open [**Team settings → Access**](https://my.spacefast.com/?to=/:team/settings/access). 2. In **SSO Providers**, press **Add Identity Provider**. The **Add SSO Provider** dialog opens. 3. Pick a **Connection type**: **OpenID Connect** or **White-label signer**. 4. Enter a **Name** and the **Issuer**. @@ -61,7 +61,7 @@ A signer body uses `authorizeUrl` and `publicKeys` instead of the client fields: } ``` -The `201` response holds the connection. Its `id` starts with `acn_`, and grants use that ID. A team can have one active connection per issuer. A second one fails with `409 identity_connection_issuer_exists`. From a terminal, run `sf share identity create`. See [`sf share identity create`](/cli/reference#sf-share-identity-create). +The `201` response holds the connection. Its `id` starts with `acn_`, and grants use that ID. A team can have one active connection per issuer. A second one fails with `409 identity_connection_issuer_exists`. From a terminal, run `sf share identity create`. See [`sf share identity create`](/cli/reference/share#sf-share-identity-create). | Field | Applies to | Rules | | --- | --- | --- | @@ -78,7 +78,14 @@ The `201` response holds the connection. Its `id` starts with `acn_`, and grants The connection proves identity. A grant on the Space decides what that identity can open. -To add a grant in the dashboard, open the Space and go to **Share**. Open **Advanced**, then find **SSO and Identity**. Pick the **Connection**, then fill in **Subject**, **Name**, **Paths**, and an optional **Expires**. Choose **What this identity can do** and press **Add Identity Grant**. If the team has no connection, the card shows **No SSO Provider**. +To add a grant in the dashboard: + +1. Open the Space's [**Share**](https://my.spacefast.com/?to=/:team/:space/share) page. +2. Open **Advanced**, then find **SSO and Identity**. If the team has no connection, the card shows **No SSO Provider**. +3. Pick the **Connection**. +4. Fill in **Subject**, **Name**, **Paths**, and an optional **Expires**. +5. Choose **What this identity can do**. +6. Press **Add Identity Grant**. From a terminal, run `sf share identity grant`: @@ -117,7 +124,7 @@ The proof-exchange protocol is not part of the public API reference. Contact [su ## Update a connection -In **SSO Providers**, press **Update** on the connection's row. +In **SSO Providers** on [**Team settings → Access**](https://my.spacefast.com/?to=/:team/settings/access), press **Update** on the connection's row. | Type | Fields | Button | | --- | --- | --- | @@ -145,7 +152,7 @@ A team can have one active connection per issuer. Revoking a connection also rev ## Revoke a connection -Press **Revoke** on the row, then **Revoke Connection** in the dialog. Over HTTP, send [`revokeTeamIdentityConnection`](/api/reference/teams/revoketeamidentityconnection). It answers `204`. From a terminal, run `sf share identity revoke`. +In **SSO Providers** on [**Team settings → Access**](https://my.spacefast.com/?to=/:team/settings/access), press **Revoke** on the connection's row, then **Revoke Connection** in the dialog. Over HTTP, send [`revokeTeamIdentityConnection`](/api/reference/teams/revoketeamidentityconnection). It answers `204`. From a terminal, run `sf share identity revoke`. Revoking removes the grants too. Spacefast revokes every grant on the team's Spaces that trusts the connection's issuer, then the connection itself. If team members sign in to Spacefast through the connection, revoking it also turns member sign-in off. diff --git a/content/(account)/pricing.mdx b/content/(account)/pricing.mdx index 42c48c93..8315b516 100644 --- a/content/(account)/pricing.mdx +++ b/content/(account)/pricing.mdx @@ -76,7 +76,7 @@ We may change our fees going forward, in line with the [Terms of Service](https: ### Can I cap my spending? -Yes. Set a monthly usage budget for a team, a subteam, or a Space in your team's **Settings**, or with [`sf budget set`](/cli/reference#sf-budget-set-amount). Go starts with a $25 default monthly budget and Pro starts with $100 (counted before the plan's included credit) until you set your own. Enterprise has no default budget unless you set one. +Yes. Set a monthly usage budget for a team, a subteam, or a Space in your team's **Settings**, or with [`sf budget set`](/cli/reference/budget#sf-budget-set-amount). Go starts with a $25 default monthly budget and Pro starts with $100 (counted before the plan's included credit) until you set your own. Enterprise has no default budget unless you set one. Owners and admins get email and dashboard alerts at 50%, 80%, and 100% by default. At 100% of the budget, new builds and Workers pause; at 200% (adjustable between 100% and 200%), serving pauses too. You're never charged above the budget, even if usage briefly runs past it. diff --git a/content/(account)/subteams.mdx b/content/(account)/subteams.mdx index a3b963f0..ad0d5355 100644 --- a/content/(account)/subteams.mdx +++ b/content/(account)/subteams.mdx @@ -12,7 +12,7 @@ Subteams need an Enterprise parent team. On every other plan, subteam operations ## How subteams work - **The parent's owners and admins are in every subteam.** They hold the same role there. To change that role, change it on the parent team. -- **Parent members can join a subteam.** Parent members see it on the parent team's **Subteams** page, and under the parent team on **Teams**, with **Join**. Pressing **Join** makes them a subteam `member`, with no new seat. A person removed from a subteam does not see it there. An owner or admin of the parent team must add them again. +- **Parent members can join a subteam.** Parent members see it on the parent team's [**Subteams**](https://my.spacefast.com/?to=/:team/subteams) page, and under the parent team on [**Teams**](https://my.spacefast.com/teams), with **Join**. Pressing **Join** makes them a subteam `member`, with no new seat. A person removed from a subteam does not see it there. An owner or admin of the parent team must add them again. - **Seats are shared.** Seats count across the parent and all its subteams. A person in several teams of the family uses one seat. - **Subteams do not nest.** A subteam cannot have subteams of its own. - **Leaving the parent leaves every subteam.** When someone leaves or is removed from the parent team, they also lose every subteam membership. @@ -21,9 +21,9 @@ Each subteam owns its Spaces. Access to them follows subteam membership and the ## Create a subteam -Any member of the parent team can create a subteam and becomes its admin. To keep creation with owners and admins, turn on **Only owners and admins can create subteams** in the parent's **Team settings → Access**. +Any member of the parent team can create a subteam and becomes its admin. To keep creation with owners and admins, turn on **Only owners and admins can create subteams** in the parent's [**Team settings → Access**](https://my.spacefast.com/?to=/:team/settings/access). -1. Open the parent team and go to **Subteams**. +1. Open the parent team's [**Subteams**](https://my.spacefast.com/?to=/:team/subteams) page. 2. Press **New Subteam**. 3. Enter a **Name**, then press **Create Subteam**. @@ -44,7 +44,7 @@ The `201` response holds the subteam: `id`, `teamId` (the parent), `name`, `slug [`listSubTeams`](/api/reference/teams/listsubteams) returns the parent's subteams, sorted by name. Every member of the parent team can list them. From a terminal, run `sf teams subteams list`. -The **Subteams** page shows the subteams you are in, each with **Open**. Below them are the subteams you can join, each with **Join**. +The [**Subteams**](https://my.spacefast.com/?to=/:team/subteams) page shows the subteams you are in, each with **Open**. Below them are the subteams you can join, each with **Join**. ## Rename a subteam diff --git a/content/(account)/teams.mdx b/content/(account)/teams.mdx index c9a3295e..46faa4b2 100644 --- a/content/(account)/teams.mdx +++ b/content/(account)/teams.mdx @@ -21,7 +21,7 @@ An Enterprise team can split into [subteams](/subteams), each with its own membe A team can also opt into [Labs](/labs) features such as [Team Memories](/team-memories), [Team Skills](/team-skills), and [Design System](/design-system). Saving standards in a Design System does not change any Space until you apply them to its project. -A team has a name and a slug. The slug is the first segment of its dashboard URLs. You can change it in **Team settings → General**, where a live check tells you whether the new one is free. +A team has a name and a slug. The slug is the first segment of its dashboard URLs. You can change it in [**Team settings → General**](https://my.spacefast.com/?to=/:team/settings), where a live check tells you whether the new one is free. | Slug rule | Value | |---|---| @@ -68,7 +68,7 @@ Your team needs [Pro](/pricing) to add another member. Personal and Go include o - Go to the team and open **Members**. The page has **Members** and **Pending** tabs. + Open the team's [**Members**](https://my.spacefast.com/?to=/:team/members) page. The page has **Members** and **Pending** tabs. Press **Invite member**, type the address, pick **Owner**, **Admin**, or **Member**, and press **Send invite**. They get an email with a join link. @@ -78,9 +78,9 @@ Your team needs [Pro](/pricing) to add another member. Personal and Go include o -From a terminal, use [`sf teams`](/cli/reference#sf-teams) and [`sf teams members`](/cli/reference#sf-teams-members) to manage teams and seats. [`sf teams invitations list`](/cli/reference#sf-teams-invitations-list) lists invitations. Send one from the dashboard, with [`sf teams members invite`](/cli/reference#sf-teams-members-invite-emails), via [`POST /v1/team-invitations`](/api/reference/teams/createteaminvitation), or through an agent with Agent access. Resend, cancel, or accept one in the dashboard. +From a terminal, use [`sf teams`](/cli/reference/teams#sf-teams) and [`sf teams members`](/cli/reference/teams#sf-teams-members) to manage teams and seats. [`sf teams invitations list`](/cli/reference/teams#sf-teams-invitations-list) lists invitations. Send one from the dashboard, with [`sf teams members invite`](/cli/reference/teams#sf-teams-members-invite-emails), via [`POST /v1/team-invitations`](/api/reference/teams/createteaminvitation), or through an agent with Agent access. Resend, cancel, or accept one in the dashboard. -To skip invitations for coworkers, add your company's [allowed email domain](/auto-enroll) and share the team's join link. Print or rotate the join link with [`sf teams join-link`](/cli/reference#sf-teams-join-link) (`--reset` replaces the link and invalidates the old one immediately, without affecting current members). Over HTTP, read or reset it with [`getTeamJoinLink`](/api/reference/teams/getteamjoinlink) and [`resetTeamJoinLink`](/api/reference/teams/resetteamjoinlink); visitors resolve a join link with [`getJoinLink`](/api/reference/teams/getjoinlink). The link itself grants no access — joining still requires a verified allowed email domain or a pending invitation. +To skip invitations for coworkers, add your company's [allowed email domain](/auto-enroll) and share the team's join link. Print or rotate the join link with [`sf teams join-link`](/cli/reference/teams#sf-teams-join-link) (`--reset` replaces the link and invalidates the old one immediately, without affecting current members). Over HTTP, read or reset it with [`getTeamJoinLink`](/api/reference/teams/getteamjoinlink) and [`resetTeamJoinLink`](/api/reference/teams/resetteamjoinlink); visitors resolve a join link with [`getJoinLink`](/api/reference/teams/getjoinlink). The link itself grants no access — joining still requires a verified allowed email domain or a pending invitation. Things that catch people out: @@ -91,7 +91,7 @@ Things that catch people out: ## Change a role or remove someone -On **Members**, each row has role and removal actions for owners and admins. Removing someone takes away their access to the team and every Space in it. Anything they published stays where it is, and you can invite them back later. +On [**Members**](https://my.spacefast.com/?to=/:team/members), each row has role and removal actions for owners and admins. Removing someone takes away their access to the team and every Space in it. Anything they published stays where it is, and you can invite them back later. If the team uses [Connectors](/connectors), the removal review lists the departing member's connector dependencies. Their personal connections disconnect automatically along with any Space bindings pointing to them. Team connections they created stay active while their existing Space bindings stay in place; if an owner or admin rebinds a role on a public, link-shared, or password-protected Space, restore its public-serving allowance before expecting calls to succeed. @@ -100,11 +100,17 @@ Two rules always apply: - The last owner cannot be removed, and cannot be demoted. Add another owner first. - An admin cannot create an owner. -To hand the team over, use **Team settings → Danger zone → Transfer ownership**, pick the new owner, and type the team slug to confirm. You become an admin in the same move. +To hand the team over: + +1. Select **Transfer ownership** in **Team settings → Danger zone**. +2. Pick the new owner. +3. Type the team slug to confirm. + +You become an admin in the same move. ## Default access for new Spaces -**Team settings → Access** sets how new Spaces on this team start. It applies to Spaces created after the change, and never touches Spaces that already exist. +[**Team settings → Access**](https://my.spacefast.com/?to=/:team/settings/access) sets how new Spaces on this team start. It applies to Spaces created after the change, and never touches Spaces that already exist. | Preset | What a new Space gets | |---|---| @@ -112,7 +118,7 @@ To hand the team over, use **Team settings → Danger zone → Transfer ownershi | `public` | Access for the owning team, plus view access for anyone on the web | | `parent_team` | Access for the owning team, plus view and comment access for everyone in its parent team. Needs subteams, which are on Enterprise | -The default is `private`. From a terminal, [`sf teams defaults`](/cli/reference#sf-teams-defaults-access) prints the current value and `sf teams defaults public` sets it. Over the API, use [`GET /v1/teams/{teamId}/access/defaults`](/api/reference/access/getteamaccessdefaults) and [`PUT /v1/teams/{teamId}/access/defaults`](/api/reference/access/setteamaccessdefaults). Per-Space access, share links, and passwords are covered in [Spacefast Share](/share). +The default is `private`. From a terminal, [`sf teams defaults`](/cli/reference/teams#sf-teams-defaults-access) prints the current value and `sf teams defaults public` sets it. Over the API, use [`GET /v1/teams/{teamId}/access/defaults`](/api/reference/access/getteamaccessdefaults) and [`PUT /v1/teams/{teamId}/access/defaults`](/api/reference/access/setteamaccessdefaults). Per-Space access, share links, and passwords are covered in [Spacefast Share](/share). ## Organize Spaces with labels @@ -122,12 +128,13 @@ Manage team labels with [`listTeamLabels`](/api/reference/teams/listteamlabels), ## Move a Space to another team -Open the Space, then **Space settings → General → Transfer this space** and press **Transfer space…**. Pick the destination team. - -- If you are an owner or admin of the destination, the button reads **Move space** and it happens immediately. The Space keeps serving at its current address. -- Otherwise the button reads **Request transfer**. Owners and admins of the destination team have 7 days to accept. Nothing changes until they do, and you can cancel any time before then. +1. Open the Space's [**Space settings → General**](https://my.spacefast.com/?to=/:team/:space/settings) page. +2. Under **Transfer this space**, press **Transfer space…**. +3. Pick the destination team. + - If you are an owner or admin of the destination, the button reads **Move space** and it happens immediately. The Space keeps serving at its current address. + - Otherwise the button reads **Request transfer**. Owners and admins of the destination team have 7 days to accept. Nothing changes until they do, and you can cancel any time before then. -From a terminal (see [`sf spaces transfer`](/cli/reference#sf-spaces-transfer-team), [`sf transfers accept`](/cli/reference#sf-transfers-accept-transfer), and [`sf transfers cancel`](/cli/reference#sf-transfers-cancel-transfer)): +From a terminal (see [`sf spaces transfer`](/cli/reference/spaces#sf-spaces-transfer-team), [`sf transfers accept`](/cli/reference/transfers#sf-transfers-accept-transfer), and [`sf transfers cancel`](/cli/reference/transfers#sf-transfers-cancel-transfer)): ```bash sf spaces transfer diff --git a/content/(account)/usage.mdx b/content/(account)/usage.mdx index c38c1c00..f8b71a19 100644 --- a/content/(account)/usage.mdx +++ b/content/(account)/usage.mdx @@ -7,11 +7,11 @@ Check your current usage here. Allowances, unit prices, and what each meter coun ## Read current usage -Open your team's **Settings → Usage** to see usage against each plan limit. Features outside your plan show **Not included in this plan**. +Open your team's [**Settings → Usage**](https://my.spacefast.com/?to=/:team/settings/usage) to see usage against each plan limit. Features outside your plan show **Not included in this plan**. -**Settings → Billing** carries a shorter set of meters next to the plan card: Storage, Team members, Custom domains, and Publishes today. Each one highlights when you reach 80% of the limit. +[**Settings → Billing**](https://my.spacefast.com/?to=/:team/settings/billing) carries a shorter set of meters next to the plan card: Storage, Team members, Custom domains, and Publishes today. Each one highlights when you reach 80% of the limit. -Two endpoints return the numbers those pages draw. [`GET /v1/teams/{teamId}/usage`](/api/reference/teams/getusage) gives team counters plus a per-Space storage breakdown. [`GET /v1/spaces/{spaceId}/usage`](/api/reference/spaces/getspaceusage) gives one Space's measured period. From a terminal, run [`sf usage`](/cli/reference#sf-usage). +Two endpoints return the numbers those pages draw. [`GET /v1/teams/{teamId}/usage`](/api/reference/teams/getusage) gives team counters plus a per-Space storage breakdown. [`GET /v1/spaces/{spaceId}/usage`](/api/reference/spaces/getspaceusage) gives one Space's measured period. From a terminal, run [`sf usage`](/cli/reference/usage#sf-usage). ## What gets metered @@ -44,7 +44,7 @@ These measurements are usage counters, not invoice line items. ## Usage budgets -Cap monthly spending for a team, subteam, or Space in team **Settings**, from the CLI with [`sf budget`](/cli/reference#sf-budget) ([`sf budget set`](/cli/reference#sf-budget-set-amount), [`sf budget list`](/cli/reference#sf-budget-list), [`sf budget clear`](/cli/reference#sf-budget-clear-budget)), or through the API: +Cap monthly spending for a team, subteam, or Space in team **Settings**, from the CLI with [`sf budget`](/cli/reference/budget#sf-budget) ([`sf budget set`](/cli/reference/budget#sf-budget-set-amount), [`sf budget list`](/cli/reference/budget#sf-budget-list), [`sf budget clear`](/cli/reference/budget#sf-budget-clear-budget)), or through the API: - [`GET /v1/teams/{teamId}/usage/budgets`](/api/reference/teams/listusagebudgets) lists active budgets. - [`PUT /v1/teams/{teamId}/usage/budgets`](/api/reference/teams/setusagebudget) creates or updates a budget. diff --git a/content/(build)/actions.mdx b/content/(build)/actions.mdx index edfb1737..b1d92369 100644 --- a/content/(build)/actions.mdx +++ b/content/(build)/actions.mdx @@ -1,8 +1,12 @@ --- title: Actions, queries, and jobs description: Write typed SpacePress queries, server mutations, zero-JS forms, background jobs, transactional hooks, and custom HTTP routes on your Space +sidebar: + badge: Labs --- +Labs + SpacePress runs typed server queries, validated mutations, progressive zero-JS forms, transactional hooks, Action Scheduler background jobs, and custom HTTP routes directly on your Space. Export them in TypeScript under `sp/` or declare actions under `app.actions` in `spacefast.config.ts`. ## Write typed queries and mutations diff --git a/content/(build)/build.mdx b/content/(build)/build.mdx index d159b23e..7582aea6 100644 --- a/content/(build)/build.mdx +++ b/content/(build)/build.mdx @@ -5,9 +5,11 @@ description: Build full-stack SpacePress apps, collections, SQL tables, server a Every Space starts with your files and grows into a full-stack app in one project. Start with HTML, a frontend framework, or `sf init` (which scaffolds a SpacePress app by default), then turn on database, Workers, email, storage, crons, and connectors as you need them. -## SpacePress is built into every Space +## Build with SpacePress -SpacePress is Spacefast's full-stack TypeScript layer. Write your schema, queries, actions, jobs, and TSX pages in TypeScript under `sp/`. On publish, Spacefast compiles them to native WordPress and PHP with no Node.js server to manage. +Labs + +SpacePress is Spacefast's full-stack TypeScript layer. Your team needs SpacePress enabled to publish a SpacePress app. Write your schema, queries, actions, jobs, and TSX pages in TypeScript under `sp/`. On publish, Spacefast compiles them to native WordPress and PHP with no Node.js server to manage. Configure your Space in `spacefast.config.ts` with `defineConfig` from `spacefast/config`. You can declare app settings inline under `app` in `spacefast.config.ts` or in a standalone `spacepress.config.ts` beside it, but not both in the same project. `sf.jsonc` remains permanently supported as the JSON fallback; see [Configuration](/config-file). @@ -51,18 +53,19 @@ Every capability publishes and rolls back with your Space's versions. Preview ch ## Local workflow and scaffolding -Scaffold a SpacePress app, add owned starter recipes, validate offline, and publish: +Create a SpacePress app with a contact form and check it locally: ```bash sf init my-space +cd my-space sf add form sf check -sf dev -sf publish ``` -- [`sf init`](/cli/reference#sf-init-name) scaffolds a SpacePress `app` project by default (`spacefast.config.ts`, a `notes` collection, `sp/actions.ts`, and `sp/app/page.tsx`), or pass `--template static`, `next`, or `astro`. See [Starters and templates](/guides/starters). -- [`sf add`](/cli/reference#sf-add-recipe-directory) writes plain source files you own and edit directly: `form` (contact table, mutation, and form), `shop` (native WooCommerce store, checkout block, and synced products), `auth` (Sign in with Spacefast and `/account`), or `ai-route` (streaming `functions/api/chat.ts` route). -- [`sf check`](/cli/reference#sf-check-dir) validates `spacefast.config.ts` (or `sf.jsonc`), SpacePress schemas and handlers, routing rules, Worker routes, and scans publishable files for secrets in one offline pass. -- [`sf dev`](/cli/reference#sf-dev) starts your framework dev server and runs `functions/` Workers locally. For a full local WordPress + SQLite server with live rebuilds on `sp/` edits, run `npx spacepress dev` or publish to a Spacefast preview channel. +Follow [Build your first full-stack Space](/guides#build-your-first-full-stack-space) to set the recipient, publish the form, and check a submission. + +- [`sf init`](/cli/reference/init#sf-init-name) scaffolds a SpacePress `app` project by default (`spacefast.config.ts`, a `notes` collection, `sp/actions.ts`, and `sp/app/page.tsx`), or pass `--template static`, `next`, or `astro`. See [Starters and templates](/guides/starters). +- [`sf add`](/cli/reference/add#sf-add-recipe-directory) writes plain source files you own and edit directly: `form` (contact table, mutation, and form), `shop` (native WooCommerce store, checkout block, and synced products), `auth` (Sign in with Spacefast and `/account`), or `ai-route` (streaming `functions/api/chat.ts` route). +- [`sf check`](/cli/reference/check#sf-check-dir) validates `spacefast.config.ts` (or `sf.jsonc`), SpacePress schemas and handlers, routing rules, Worker routes, and scans publishable files for secrets in one offline pass. +- [`sf dev`](/cli/reference/dev#sf-dev) starts your framework dev server and runs `functions/` Workers locally. For a full local WordPress + SQLite server with live rebuilds on `sp/` edits, run `npx spacepress dev` or publish to a Spacefast preview channel. - Moving an older Zero 0.8 or `zero.config.ts` Space? See [Migrating from Zero 0.8](/zero-migration). diff --git a/content/(build)/collections.mdx b/content/(build)/collections.mdx index b3a14aaf..e2f6638d 100644 --- a/content/(build)/collections.mdx +++ b/content/(build)/collections.mdx @@ -1,8 +1,12 @@ --- title: Collections and CMS description: Define SpacePress collections, SQL tables, globals, typed fields, TSX pages, interactive islands, Markdown sync, and WooCommerce stores in TypeScript +sidebar: + badge: Labs --- +Labs + SpacePress gives every Space a typed CMS, custom SQL tables, server-rendered TSX pages, and native WooCommerce stores. Declare your models in TypeScript under `sp/` (with `spacepress.config.ts`) or inline under `app` in `spacefast.config.ts`. Spacefast backs them with your Space's database on publish. ## Choose a storage kind @@ -221,5 +225,5 @@ export async function GET(request: Request, { env }: { env: any }) { ## Admin editor, REST API, and CLI - **Admin editor, WordPress REST API, Content sync, Abilities, and WP-CLI:** See [WordPress and Content API](/wordpress) for `POST /v1/spaces/{spaceId}/content/*`, direct WordPress REST tokens, and `sf app wp`. -- **Validate offline:** Run [`sf check`](/cli/reference#sf-check-dir) to validate `spacefast.config.ts`, SpacePress schemas, routing rules, Worker routes, and secret scanning in one pass (exits `2` on failure). -- **System and error pages:** [`sf pages`](/cli/reference#sf-pages) manages Spacefast system and error page templates (`_pages/*.html`), not CMS collections. See [Customization and error pages](/customization). +- **Validate offline:** Run [`sf check`](/cli/reference/check#sf-check-dir) to validate `spacefast.config.ts`, SpacePress schemas, routing rules, Worker routes, and secret scanning in one pass (exits `2` on failure). +- **System and error pages:** [`sf pages`](/cli/reference/pages#sf-pages) manages Spacefast system and error page templates (`_pages/*.html`), not CMS collections. See [Customization and error pages](/customization). diff --git a/content/(build)/connectors.mdx b/content/(build)/connectors.mdx index 9dd1dc37..411a0b5d 100644 --- a/content/(build)/connectors.mdx +++ b/content/(build)/connectors.mdx @@ -1,8 +1,12 @@ --- title: Connectors description: Connect an external service once and call its tools from Space pages, Workers, local AI agents, and scripts while credentials stay sealed in Spacefast +sidebar: + badge: Public Beta --- +Public Beta + Connectors let your team connect an external service once (an OpenAPI spec, a GraphQL endpoint, or a remote MCP server) and call its tools from Space pages, [Workers](/functions), local AI agents, and scripts. Credentials stay sealed in Spacefast and never enter prompts, source code, or browsers. Connectors are available on Go, Pro, and Enterprise plans. A team on Personal receives [`feature_unavailable`](/errors/feature_unavailable). Enterprise adds team-wide connector allowlists and blocklists. @@ -34,13 +38,21 @@ Four building blocks cover everything Connectors do: ## Connect a service -In the dashboard, open **Connectors** in the team sidebar. A header switch moves between **Connectors**, **Runs**, and **Policies**. +In the dashboard, open [**Connectors**](https://my.spacefast.com/?to=/:team/connectors) in the team sidebar. A header switch moves between **Connectors**, **Runs**, and **Policies**. ### Add a connector Click **Browse Connectors** to search curated presets, the public registry, and your team's own connectors, or filter by **All**, **API**, **GraphQL**, or **MCP**. The catalog has one row per source type, so a service with an API and an MCP server appears as two rows. Click **Add** on a row (or **Set Up** if the provider needs a custom endpoint). -To add a service from any URL, paste it into the search box on **Browse**, click **Detect**, choose a candidate, check **Name**, **Namespace**, and **Description**, and click **Register**. Detection inspects the URL, so the registered endpoint can differ from what you pasted. +To add a service from any URL: + +1. Paste the URL into the search box on **Browse**. +2. Click **Detect**. +3. Choose a candidate. +4. Check **Name**, **Namespace**, and **Description**. +5. Click **Register**. + +Detection inspects the URL, so the registered endpoint can differ from what you pasted. - **Namespace** is the connector slug: lowercase letters, digits, and dashes, starting with a letter or digit. - **Description** helps agents choose between connectors. @@ -59,7 +71,12 @@ sf connectors create https://api.example.com/openapi.json ### Connect an account -Open the connector and click **Connect Account**. Pick **Team** or **Personal**, choose a **Method** if more than one exists, add an optional **Label** so agents can tell accounts apart, and click **Connect**. +1. Open the connector. +2. Click **Connect Account**. +3. Pick **Team** or **Personal**. +4. Choose a **Method** if more than one exists. +5. Add an optional **Label** so agents can tell accounts apart. +6. Click **Connect**. - **Team** shares the account with the team and agents acting for it. - **Personal** keeps it yours, only within this team. @@ -107,7 +124,7 @@ How rules combine: - **Unmatched tools use the source's default.** A tool can also ask for approval itself. - **Pattern and owner are fixed.** Delete the rule and add a new one to change either. Deleting a block hands its tools back to the next matching rule. -Manage rules under **Policies** in the connectors header (an API key can add **Team** rules only), or check what an address resolves to without calling it: +Manage rules under [**Policies**](https://my.spacefast.com/?to=/:team/connectors/policies) in the connectors header (an API key can add **Team** rules only), or check what an address resolves to without calling it: ```bash sf connectors policies add cxn_abc123/charges.create --action require_approval @@ -120,8 +137,8 @@ Use a wildcard like `'*'` when you intend a team-wide default rather than testin A parked run returns an `approvalUrl` and appears in two dashboard views: -- **Approvals**, under **Connector calls awaiting approval**. -- **Runs**, filtered to **Waiting on you**. Click **Review** to inspect the matched rule, arguments, and deadline before approving, or click **Deny** on the row. +- [**Approvals**](https://my.spacefast.com/approvals), under **Connector calls awaiting approval**. +- [**Runs**](https://my.spacefast.com/?to=/:team/connectors/runs), filtered to **Waiting on you**. Click **Review** to inspect the matched rule, arguments, and deadline before approving, or click **Deny** on the row. **Approve** runs the call once. **Deny** fails it with `connector_approval_declined`. A parked run expires after 15 minutes. @@ -361,7 +378,7 @@ Overrides apply immediately to the live version and persist across future publis The `/__spacefast/connectors/...` route answers only the Space's own pages. From an AI agent, script, CI job, or terminal, calls run directly against your credential and team policy, with no Space role, no pinned arguments, and no shared reads. - **AI agents (On-Device MCP):** `sf mcp` and the desktop extension expose one gateway tool, `search_connector_tools`, under your team's policy and approval rules. Hosted MCP and `sf mcp proxy` intentionally omit connector tools and grant no connector scopes. See [MCP server](/agents/mcp-server). -- **Dashboard Tools view:** Click **See tools** on a connector row (or open **Connector tools** from the command palette) to browse reachable tools, resolved policy effects, input schemas, and declared safety (**Read-only**, **Writes**, or **Destructive**). Run any tool directly from a form or JSON payload. +- **Dashboard Tools view:** Click **See tools** on a connector row (or open [**Connector tools**](https://my.spacefast.com/?to=/:team/connectors/tools) from the command palette) to browse reachable tools, resolved policy effects, input schemas, and declared safety (**Read-only**, **Writes**, or **Destructive**). Run any tool directly from a form or JSON payload. - **CLI and API:** Inspect tools and run one tool or a multi-tool sandbox program with `sf connectors run` or [`createConnectorRun`](/api/reference/connectors/createconnectorrun): ```bash @@ -385,13 +402,13 @@ sf connectors run --tool cxn_abc123/issues.list --args '{"limit":5}' By default, a credential with connector scopes reaches every team connection it is allowed to use. Narrow it to specific connections when a script, CI job, or AI client should touch only one account: - **API keys:** Pass `--connection ` (repeatable) on `sf api-keys create` or `sf api-keys update`, or pass `connectorAccess: { connectionIds: ["cxn_abc123"] }` over the API. Remove the limit with `--all-connections` or `connectorAccess: null`. See [API keys](/api-keys#limit-connector-access). -- **OAuth apps and CLI logins:** Open **Choose Connections** on the consent screen, or edit the allowlist later on **Connected apps** without re-authorizing. +- **OAuth apps and CLI logins:** Open **Choose Connections** on the consent screen, or edit the allowlist later on [**Connected apps**](https://my.spacefast.com/account/connected-apps) without re-authorizing. Direct lookups of a connection outside a credential's allowlist answer `404` as if it doesn't exist. Tool runs still return a run record (HTTP `200` or `201`): addressing a disallowed connection by ID (`/`) fails in `error` with `connection_forbidden`, while the short `/` form fails with `connection_not_found`; see [Errors](/api/connectors#errors). ## Manage connections and clean up -Open a connector's **Accounts** tab for connection actions: +On [**Connectors**](https://my.spacefast.com/?to=/:team/connectors), open a connector's **Accounts** tab for connection actions: | Action | What it does | CLI | | --- | --- | --- | @@ -420,6 +437,6 @@ Deleting a connector disconnects every account on it, then deletes the connector ## Reference -- [`sf connectors`](/cli/reference#sf-connectors) — every CLI command, flag, and exit code +- [`sf connectors`](/cli/reference/connectors#sf-connectors) — every CLI command, flag, and exit code - [Connectors API](/api/connectors) — `/v1/connectors` endpoints, scopes, and errors - [MCP server](/agents/mcp-server) — On-Device MCP setup for local AI agents diff --git a/content/(build)/crons.mdx b/content/(build)/crons.mdx index d15d70f4..dd189a8d 100644 --- a/content/(build)/crons.mdx +++ b/content/(build)/crons.mdx @@ -85,7 +85,7 @@ Each cron takes a slot of its own kind, in the order you declare them. A later c - A crontab takes an advanced slot while one is left. - A crontab with no advanced slot left still publishes, with a warning. It runs at its closest simple schedule and counts against the simple allowance. That can run more or less often than the crontab asked, and not at the times it names: `*/5 * * * *` runs `12h` (12 times an hour), and `0 9 * * 1-5` runs `5w` (5 times a week, not necessarily on weekdays at 9:00). -- Crons past the allowance still publish, and the publish carries a warning. Within each kind of slot, the first ones declared run. The rest show as not scheduled, "over this plan's cron limit", on the dashboard's **Crons** page and in `sf crons list`. +- Crons past the allowance still publish, and the publish carries a warning. Within each kind of slot, the first ones declared run. The rest show as not scheduled, "over this plan's cron limit", on the dashboard's [**Crons**](https://my.spacefast.com/?to=/:team/:space/crons) page and in `sf crons list`. For now, advanced crons also run at their closest simple schedule rather than exact crontab times. @@ -119,7 +119,7 @@ Before the first publish, `sf crons list` reports no scheduled jobs. Add a `cron ## Failures -The dashboard's **Crons** page and `sf crons list` both report recent failures per cron, plus failures that could not be attributed to one. A failure carries the time it occurred, an exit code when there is one, and a reason when the provider gave one. Some rows read only "no detail", which means the provider said only that it failed. +The dashboard's [**Crons**](https://my.spacefast.com/?to=/:team/:space/crons) page and `sf crons list` both report recent failures per cron, plus failures that could not be attributed to one. A failure carries the time it occurred, an exit code when there is one, and a reason when the provider gave one. Some rows read only "no detail", which means the provider said only that it failed. Run output is never echoed. A response body can carry secrets and response data, so it is not stored. @@ -141,4 +141,4 @@ Only the newest failures are kept, with no history behind them. A real failure a | `runsAs` | The active schedule; `null` when not scheduled | | `reason` | `over_plan_limit` past the allowance, `unsupported_schedule` for a schedule that cannot run; `null` when scheduled | -The response's `allowance` carries the Space's `simple` and `advanced` counts and `upgrade`, the step that unlocks more: `upgrade_plan`, `upgrade_or_boost`, `boost`, or `null` when there is none. See [`sf crons`](/cli/reference#sf-crons) in the CLI reference for full flags. +The response's `allowance` carries the Space's `simple` and `advanced` counts and `upgrade`, the step that unlocks more: `upgrade_plan`, `upgrade_or_boost`, `boost`, or `null` when there is none. See [`sf crons`](/cli/reference/crons#sf-crons) in the CLI reference for full flags. diff --git a/content/(build)/database.mdx b/content/(build)/database.mdx index 6c096785..8f897f6f 100644 --- a/content/(build)/database.mdx +++ b/content/(build)/database.mdx @@ -125,7 +125,7 @@ All table and row endpoints require write access (`spaces:write`) and an authent When you need raw SQL, Spacefast mints a single-use phpMyAdmin sign-in URL and records the access in your Space's [activity log](/activity). -Open **Database** for the Space in the dashboard and select **Open db console**. From the CLI: +Open [**Database**](https://my.spacefast.com/?to=/:team/:space/database) for the Space in the dashboard and select **Open db console**. From the CLI: ```bash sf db console @@ -187,4 +187,4 @@ sf db migrate | [`getSpaceDatabaseExportPage`](/api/reference/database/getspacedatabaseexportpage) | `GET /v1/spaces/{spaceId}/db/export/{table}` | | [`migrateSpaceDatabase`](/api/reference/database/migratespacedatabase) | `POST /v1/spaces/{spaceId}/db/migrate` | -See [`sf db`](/cli/reference#sf-db-target) in the CLI reference for every subcommand and flag. +See [`sf db`](/cli/reference/db#sf-db-target) in the CLI reference for every subcommand and flag. diff --git a/content/(build)/email.mdx b/content/(build)/email.mdx index 7bf803ff..a3594fdc 100644 --- a/content/(build)/email.mdx +++ b/content/(build)/email.mdx @@ -14,7 +14,7 @@ Email always sends from your Space's exact primary custom domain. The default se Attach a custom domain to the Space and set it as primary. See [Custom domains](/domains). - Open the Space's **Domains** page and look at the **Email** card. + Open the Space's [**Domains**](https://my.spacefast.com/?to=/:team/:space/domains) page and look at the **Email** card. - **Spacefast DNS:** Once your Spacefast DNS zone is active and ownership is verified, Spacefast adds the two DKIM records automatically. See [DNS](/domains/dns). - **External DNS:** Add the two `CNAME` records shown in the **Email** card (or returned by `GET /v1/spaces/{spaceId}/email`) at your DNS provider. Leave your existing `SPF`, `MX`, and `DMARC` records unchanged. diff --git a/content/(build)/environment-variables.mdx b/content/(build)/environment-variables.mdx index 96536178..a0c8ae4c 100644 --- a/content/(build)/environment-variables.mdx +++ b/content/(build)/environment-variables.mdx @@ -9,8 +9,8 @@ You can scope a variable to a single Space or to the whole team, and a Space-lev | Scope | Where you set it | Who sees it | | --- | --- | --- | -| Space | `sf env`, or the Space's **Variables** page | That Space | -| Team | The team's **Variables** page | Every Space in the team | +| Space | `sf env`, or the Space's [**Variables**](https://my.spacefast.com/?to=/:team/:space/variables) page | That Space | +| Team | The team's [**Variables**](https://my.spacefast.com/?to=/:team/variables) page | Every Space in the team | A Space value wins over a team value with the same name. In the dashboard, the Space page adds a **Source** column and an **Override** action for a value inherited from the team. @@ -105,7 +105,7 @@ export async function POST( } ``` -For Spaces running an app, run `sf app env` ([`sf app env`](/cli/reference#sf-app-env)) to inspect scoped app environment variables (secrets masked by default; pass `--reveal` for plaintext). Existing [Zero 0.8](/zero-migration) apps read the same values from `ctx.env`, and also accept `.env.lakebed.server` (which acts as the full Space-scope list and deletes omitted Space variables on publish). +For Spaces running an app, run `sf app env` ([`sf app env`](/cli/reference/app#sf-app-env)) to inspect scoped app environment variables (secrets masked by default; pass `--reveal` for plaintext). Existing [Zero 0.8](/zero-migration) apps read the same values from `ctx.env`, and also accept `.env.lakebed.server` (which acts as the full Space-scope list and deletes omitted Space variables on publish). An anonymous first publish, before you have an account, syncs nothing and reports `skipped: "anonymous"`. @@ -152,7 +152,7 @@ sf env template ## Dashboard -Team variables live at **Variables** in the team navigation. Space variables live at **Variables** for the Space. The table columns are **Name**, **Value**, **Secret**, and, on a Space, **Source**. +Team variables live at [**Variables**](https://my.spacefast.com/?to=/:team/variables) in the team navigation. Space variables live at [**Variables**](https://my.spacefast.com/?to=/:team/:space/variables) for the Space. The table columns are **Name**, **Value**, **Secret**, and, on a Space, **Source**. ## API @@ -166,4 +166,4 @@ Team variables live at **Variables** in the team navigation. Space variables liv | [`setTeamVariable`](/api/reference/variables/setteamvariable) | `PUT /v1/teams/{teamId}/variables/{name}` | | [`deleteTeamVariable`](/api/reference/variables/deleteteamvariable) | `DELETE /v1/teams/{teamId}/variables/{name}` | -Each mutation returns a nullable `operation` handle for the debounced re-finalize it coalesced into. See [`sf env`](/cli/reference#sf-env) in the CLI reference for full command options. +Each mutation returns a nullable `operation` handle for the debounced re-finalize it coalesced into. See [`sf env`](/cli/reference/env#sf-env) in the CLI reference for full command options. diff --git a/content/(build)/functions.mdx b/content/(build)/functions.mdx index d998e952..e691e03e 100644 --- a/content/(build)/functions.mdx +++ b/content/(build)/functions.mdx @@ -85,7 +85,7 @@ export default { }; ``` -The fallback above returns plain text `"Not found"` for every unknown path, including mistyped page URLs. Return an HTML page for browser requests or use `functions/` if the Space needs a custom 404 page; see [Static files first, then the Worker](#static-files-first-then-the-worker). You can also add a streaming AI route to any project with `sf add ai-route` ([`sf add`](/cli/reference#sf-add-recipe-directory)). +The fallback above returns plain text `"Not found"` for every unknown path, including mistyped page URLs. Return an HTML page for browser requests or use `functions/` if the Space needs a custom 404 page; see [Static files first, then the Worker](#static-files-first-then-the-worker). You can also add a streaming AI route to any project with `sf add ai-route` ([`sf add`](/cli/reference/add#sf-add-recipe-directory)). Requests and responses are standard Web `Request` and `Response` objects with no Spacefast wrapper. @@ -176,4 +176,4 @@ sf logs runtime --follow sf logs runtime --handler checkout ``` -Everything your Worker logs appears in the runtime log stream with the handler name and request ID on each line. See [Logs](/logs) for filters, retention, and paging, and [`sf functions`](/cli/reference#sf-functions) in the CLI reference. +Everything your Worker logs appears in the runtime log stream with the handler name and request ID on each line. See [Logs](/logs) for filters, retention, and paging, and [`sf functions`](/cli/reference/functions#sf-functions) in the CLI reference. diff --git a/content/(build)/object-storage.mdx b/content/(build)/object-storage.mdx index 15fa746f..950e1727 100644 --- a/content/(build)/object-storage.mdx +++ b/content/(build)/object-storage.mdx @@ -84,7 +84,13 @@ sf storage delete 0f3a2c19b74e4d0f8c6e5a2b1d9f4c73 ## Dashboard -Open **Storage** for the Space. Use **Choose Files** and **Upload Files** to upload directly; the per-file limit appears inline. Deleting prompts first because it removes the object for every visitor. +To upload directly: + +1. Open the Space's [**Storage**](https://my.spacefast.com/?to=/:team/:space/storage) page. +2. Select **Choose Files**. +3. Select **Upload Files**. + +The per-file limit appears inline. Deleting prompts first because it removes the object for every visitor. ## Limits @@ -112,4 +118,4 @@ A Space whose runtime is not reachable answers `503` with [`runtime_management_u | [`readSpaceStorageObject`](/api/reference/spaces/readspacestorageobject) | `GET /v1/spaces/{spaceId}/storage/{objectId}` | | [`deleteSpaceStorageObject`](/api/reference/spaces/deletespacestorageobject) | `DELETE /v1/spaces/{spaceId}/storage/{objectId}` | -Listing requires the `versions:read` scope. As the Space owner, you can download or delete any object, including private ones a visitor uploaded. See [`sf storage`](/cli/reference#sf-storage-target) in the CLI reference for every flag. +Listing requires the `versions:read` scope. As the Space owner, you can download or delete any object, including private ones a visitor uploaded. See [`sf storage`](/cli/reference/storage#sf-storage-target) in the CLI reference for every flag. diff --git a/content/(build)/wordpress.mdx b/content/(build)/wordpress.mdx index 54351353..6c43377a 100644 --- a/content/(build)/wordpress.mdx +++ b/content/(build)/wordpress.mdx @@ -1,8 +1,12 @@ --- title: WordPress and Content API description: Open SpacePress Admin, call your Space's WordPress REST API and Abilities, run three-way content sync, use generated typed clients, and run allowlisted WP-CLI commands +sidebar: + badge: Labs --- +Labs + Every SpacePress Space runs native WordPress alongside your TypeScript code, with no servers or plugins to maintain by hand. Open SpacePress Admin at `/wp-admin/new/`, call your Space's WordPress REST API and Abilities, reconcile Markdown files with live posts, or run allowlisted WP-CLI commands with `sf app wp`. ## Open SpacePress Admin and one-use sign-in links @@ -104,13 +108,13 @@ sf app wp --mode limited core version sf apply ``` -- **[`sf app env`](/cli/reference#sf-app-env):** Prints scoped Space, SpacePress, and WordPress environment variables with secrets masked by default. Pass `--reveal` to print plaintext values or `--format dotenv` for dotenv output. -- **[`sf app wp`](/cli/reference#sf-app-wp) and [`runSpaceWpCliCommand`](/api/reference/spaces/runspacewpclicommand) (`POST /v1/spaces/{spaceId}/wp-cli`):** Runs allowlisted WP-CLI commands against your Space's WordPress (or a local WordPress install with `--local` / `--path`), writing every remote run to the Space's [activity log](/activity). +- **[`sf app env`](/cli/reference/app#sf-app-env):** Prints scoped Space, SpacePress, and WordPress environment variables with secrets masked by default. Pass `--reveal` to print plaintext values or `--format dotenv` for dotenv output. +- **[`sf app wp`](/cli/reference/app#sf-app-wp) and [`runSpaceWpCliCommand`](/api/reference/spaces/runspacewpclicommand) (`POST /v1/spaces/{spaceId}/wp-cli`):** Runs allowlisted WP-CLI commands against your Space's WordPress (or a local WordPress install with `--local` / `--path`), writing every remote run to the Space's [activity log](/activity). - **Allowed:** Safe read/inspect commands, bounded maintenance (`cache`, `rewrite`, `transient`, `cron event`), and `spacepress *`. - **Refused (`wp_cli_command_not_allowed`):** Arbitrary execution (`eval`, `shell`), direct database or config edits (`db`, `config`), and plugin, theme, or user writes (`plugin install`). - **Recovery mode:** Pass `--mode limited` remotely to skip the site's themes and plugins when a broken theme or plugin blocks a normal run. - **Remote output:** Remote runs return `output: null` because the runtime exposes no stdout channel. -- **[`sf apply`](/cli/reference#sf-apply):** Pushes saved Space and runtime changes onto the live runtime (`POST /v1/spaces/{spaceId}/apply`) and checks live apply state (`GET /v1/spaces/{spaceId}/apply-state` — `pending`, `applying`, `live`, or `failed`). Pass `--no-wait` to return immediately with the operation handle. +- **[`sf apply`](/cli/reference/apply#sf-apply):** Pushes saved Space and runtime changes onto the live runtime (`POST /v1/spaces/{spaceId}/apply`) and checks live apply state (`GET /v1/spaces/{spaceId}/apply-state` — `pending`, `applying`, `live`, or `failed`). Pass `--no-wait` to return immediately with the operation handle. ## Themes and `theme.json` diff --git a/content/(build)/zero-migration.mdx b/content/(build)/zero-migration.mdx index 445a4b7e..eeeef81b 100644 --- a/content/(build)/zero-migration.mdx +++ b/content/(build)/zero-migration.mdx @@ -88,4 +88,4 @@ Keep these limits in mind: - `sf migrate app` does not move database rows, users, or content; export and import data separately. - `sf migrate app` keeps existing files unless you pass `--force`. - If the directory still uses a legacy `tp/` folder, move those files into `sp/` and remove `tp/` before running `sf migrate app`. -- `sf migrate ` (without `app`) captures a public website into a static Space; it does not migrate a local app. See [`sf migrate app`](/cli/reference#sf-migrate-app-input). +- `sf migrate ` (without `app`) captures a public website into a static Space; it does not migrate a local app. See [`sf migrate app`](/cli/reference/migrate#sf-migrate-app-input). diff --git a/content/(deploy)/channels.mdx b/content/(deploy)/channels.mdx index d1220ae9..35570a89 100644 --- a/content/(deploy)/channels.mdx +++ b/content/(deploy)/channels.mdx @@ -17,7 +17,7 @@ Passing a channel name other than `live` (or its `production` alias on publish) ## List channels -Inspect a Space's channels, their current and previous versions, promotion policy, and last pointer move with [`sf channels list`](/cli/reference#sf-channels-list) (alias `sf channels ls`): +Inspect a Space's channels, their current and previous versions, promotion policy, and last pointer move with [`sf channels list`](/cli/reference/channels#sf-channels-list) (alias `sf channels ls`): ```bash sf channels list --space docs @@ -44,20 +44,20 @@ Every channel has a promotion policy that governs implicit promotions from publi | `auto` (default) | Finalizing a production publish or build moves `live` to the new version | | `manual` | Finalizing leaves `live` unchanged until someone promotes explicitly | -Change the policy with [`sf channels set`](/cli/reference#sf-channels-set-name): +Change the policy with [`sf channels set`](/cli/reference/channels#sf-channels-set-name): ```bash sf channels set live --promotion manual --space docs sf channels set live --promotion auto --space docs ``` -In the dashboard, switch **Publishing** on the Space's **Versions** page between **Automatic** and **Manual**. Over HTTP, call [`updateSpaceChannel`](/api/reference/spaces/updatespacechannel) (`PATCH /v1/spaces/{spaceId}/channels/live`) with `{"promotion":"manual"}` or `{"promotion":"auto"}`. Updating the policy requires the same `versions:promote` capability as promoting a version. +In the dashboard, switch **Publishing** on the Space's [**Versions**](https://my.spacefast.com/?to=/:team/:space/versions) page between **Automatic** and **Manual**. Over HTTP, call [`updateSpaceChannel`](/api/reference/spaces/updatespacechannel) (`PATCH /v1/spaces/{spaceId}/channels/live`) with `{"promotion":"manual"}` or `{"promotion":"auto"}`. Updating the policy requires the same `versions:promote` capability as promoting a version. A `manual` policy never blocks an explicit promote. ## Promote a version -Move `live` to any retained, `ready` version with [`sf promote`](/cli/reference#sf-promote-version): +Move `live` to any retained, `ready` version with [`sf promote`](/cli/reference/promote#sf-promote-version): ```bash sf promote v14 --space docs @@ -66,13 +66,13 @@ sf promote ver_4b81f0c2d9a7431e8c6d05fa27b3e914 --channel live --no-wait --json `sf promote` accepts a version ID, a ref like `v14`, or a bare version number, and waits up to 900 s for the pointer to settle by default. Pass `--no-wait` to receive the operation handle immediately. -Promoting a version numbered lower than the current live version is a rollback: by default, Spacefast refreshes rewrites and creates a new version from those files. Pass `--no-refresh-rewrites` (API: `refreshRewrites: false`) to serve the older version as saved, or use [`sf rollback`](/cli/reference#sf-rollback-version). See [Versions and the live channel](/versions) for version states and rollback details. +Promoting a version numbered lower than the current live version is a rollback: by default, Spacefast refreshes rewrites and creates a new version from those files. Pass `--no-refresh-rewrites` (API: `refreshRewrites: false`) to serve the older version as saved, or use [`sf rollback`](/cli/reference/rollback#sf-rollback-version). See [Versions and the live channel](/versions) for version states and rollback details. Over HTTP, call [`promoteSpaceVersion`](/api/reference/versions/promotespaceversion) (`POST /v1/spaces/{spaceId}/versions/{versionId}/promote`). Add `?async=1` to skip waiting. ## Channel history -Read the deploy log for a channel, newest first, with [`sf channels history`](/cli/reference#sf-channels-history-name): +Read the deploy log for a channel, newest first, with [`sf channels history`](/cli/reference/channels#sf-channels-history-name): ```bash sf channels history --space docs diff --git a/content/(deploy)/ci.mdx b/content/(deploy)/ci.mdx index 1dd6910a..0c600dd6 100644 --- a/content/(deploy)/ci.mdx +++ b/content/(deploy)/ci.mdx @@ -10,7 +10,7 @@ A CI pipeline can publish pushes to your production branch. Use `--target previe - For one Space, create a **deploy token** with [`sf deploy-tokens create`](/cli/reference#sf-deploy-tokens-create). Deploy tokens are Space-scoped `sfm_` machine tokens that default to preview-only publishing: + For one Space, create a **deploy token** with [`sf deploy-tokens create`](/cli/reference/deploy-tokens#sf-deploy-tokens-create). Deploy tokens are Space-scoped `sfm_` machine tokens that default to preview-only publishing: ```bash # Preview-only token for pull request checks @@ -20,7 +20,7 @@ A CI pipeline can publish pushes to your production branch. Use `--target previe sf deploy-tokens create --name ci-release --live --expires 90d --show-secret ``` - The `sfm_` secret prints once. Copy it and store it as a secret named `SPACEFAST_TOKEN` in your CI provider. Rotate or revoke tokens in place with [`sf deploy-tokens rotate`](/cli/reference#sf-deploy-tokens-rotate-id) and [`sf deploy-tokens revoke`](/cli/reference#sf-deploy-tokens-revoke-id). + The `sfm_` secret prints once. Copy it and store it as a secret named `SPACEFAST_TOKEN` in your CI provider. Rotate or revoke tokens in place with [`sf deploy-tokens rotate`](/cli/reference/deploy-tokens#sf-deploy-tokens-rotate-id) and [`sf deploy-tokens revoke`](/cli/reference/deploy-tokens#sf-deploy-tokens-revoke-id). If one workflow publishes to multiple Spaces across a team, create a team-scoped `sfa_` API key instead: @@ -49,10 +49,10 @@ A CI pipeline can publish pushes to your production branch. Use `--target previe | Credential | Prefix | Scope | Best for | | --- | --- | --- | --- | -| Deploy token ([`sf deploy-tokens`](/cli/reference#sf-deploy-tokens)) | `sfm_` | One Space; preview-only by default, `--live` for live, optional `--view-only` and `--path` filters | Single-repository CI jobs and least-privilege PR previews | -| API key ([`sf api-keys`](/cli/reference#sf-api-keys)) | `sfa_` | Team-wide (or single Space via API), bounded by a preset such as `ci_deploy` | Shared workflows that publish to several Spaces or manage domains | +| Deploy token ([`sf deploy-tokens`](/cli/reference/deploy-tokens#sf-deploy-tokens)) | `sfm_` | One Space; preview-only by default, `--live` for live, optional `--view-only` and `--path` filters | Single-repository CI jobs and least-privilege PR previews | +| API key ([`sf api-keys`](/cli/reference/api-keys#sf-api-keys)) | `sfa_` | Team-wide (or single Space via API), bounded by a preset such as `ci_deploy` | Shared workflows that publish to several Spaces or manage domains | -Manage existing deploy tokens with [`sf deploy-tokens list`](/cli/reference#sf-deploy-tokens-list), [`sf deploy-tokens update`](/cli/reference#sf-deploy-tokens-update-id) (change target, paths, or expiry without changing the secret), [`sf deploy-tokens rotate`](/cli/reference#sf-deploy-tokens-rotate-id), and [`sf deploy-tokens revoke`](/cli/reference#sf-deploy-tokens-revoke-id). Pass `--show-secret` when scripting creation or rotation with `--json`. +Manage existing deploy tokens with [`sf deploy-tokens list`](/cli/reference/deploy-tokens#sf-deploy-tokens-list), [`sf deploy-tokens update`](/cli/reference/deploy-tokens#sf-deploy-tokens-update-id) (change target, paths, or expiry without changing the secret), [`sf deploy-tokens rotate`](/cli/reference/deploy-tokens#sf-deploy-tokens-rotate-id), and [`sf deploy-tokens revoke`](/cli/reference/deploy-tokens#sf-deploy-tokens-revoke-id). Pass `--show-secret` when scripting creation or rotation with `--json`. ## The workflow @@ -126,7 +126,7 @@ Credentials also behave differently under `CI`. The plaintext credential store i The CLI collects build provenance automatically. On GitHub Actions it reads the branch, commit SHA, ref, repository, run ID, run attempt, run URL, workflow, job, actor, and event name from the environment, plus the pull request number when the ref starts `refs/pull/`. On GitLab CI it reads the equivalents, and takes the commit title as the version message. Bitbucket Pipelines is detected too. -Every value shows up on the version, so version history says which commit and which run produced each build. Override any of them with `--git-branch`, `--git-commit`, `--git-ref`, `--git-repository`, or `--message`. Full flag table on [`sf publish`](/cli/reference#sf-publish-dir). +Every value shows up on the version, so version history says which commit and which run produced each build. Override any of them with `--git-branch`, `--git-commit`, `--git-ref`, `--git-repository`, or `--message`. Full flag table on [`sf publish`](/cli/reference/publish#sf-publish-dir). ## Previews on pull requests diff --git a/content/(deploy)/git.mdx b/content/(deploy)/git.mdx index d3ddc9f0..f7549e0b 100644 --- a/content/(deploy)/git.mdx +++ b/content/(deploy)/git.mdx @@ -7,7 +7,7 @@ Keep your source in Git and publish from a Spacefast remote (`push.fast`) or a c There are two ways to connect. The Spacefast remote needs no external Git provider and no app install. A GitHub connection keeps your repository where it is and reacts to its webhooks. -The [`sf git`](/cli/reference#sf-git) and `sf source` command families use different names for the same two connection types. +The [`sf git`](/cli/reference/git#sf-git) and `sf source` command families use different names for the same two connection types. ## Source and deployment files @@ -17,7 +17,7 @@ Keep the editable project in Git. Connect its repository or push it to the Space ## Push to a Spacefast remote (`push.fast`) -Spacefast provides a Git endpoint (`push.fast`, which routes to `git.spacefast.com`). [`sf git origin`](/cli/reference#sf-git-origin) mints a signed remote and installs it. +Spacefast provides a Git endpoint (`push.fast`, which routes to `git.spacefast.com`). [`sf git origin`](/cli/reference/git#sf-git-origin) mints a signed remote and installs it. @@ -34,7 +34,7 @@ Spacefast provides a Git endpoint (`push.fast`, which routes to `git.spacefast.c ```bash sf builds list ``` - Or open **Builds** for the Space. + Or open [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) for the Space. @@ -50,7 +50,7 @@ Treat that URL as a secret. It expires, and the `sf git origin` receipt reports ## Connect a GitHub repository -Run [`sf git connect`](/cli/reference#sf-git-connect) to attach an external repository: +Run [`sf git connect`](/cli/reference/git#sf-git-connect) to attach an external repository: ```bash sf git connect --space docs --provider github --repository owner/repo --production-branch main --sync @@ -74,7 +74,14 @@ GitHub connections resolve their installation and repository IDs from your GitHu `--apply-best`, `--sync`, and `--build-now` need `--connection-type=connected` and exit `2` otherwise. So does connecting with neither `--repository` nor a Git `origin` to read it from. -In the dashboard the same flow lives on the Space's **Builds** page. Click **Connect GitHub**, then **Connect repository**, and pick an **Installation** and a **Repository**. **Add repositories** takes you back to GitHub to widen the installation. +To connect from the dashboard: + +1. Open the Space's [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) page. +2. Click **Connect GitHub**. +3. Click **Connect repository**. +4. Pick an **Installation** and a **Repository**. + +**Add repositories** takes you back to GitHub to widen the installation. Once connected, the sidebar's **Code** row shows **Source**, the repository tree at the production branch, instead of the version's files. @@ -83,7 +90,7 @@ Once connected, the sidebar's **Code** row shows **Source**, the repository tree Spacefast can post one comment on a GitHub pull request and update it with the latest preview status and links. - In **Team settings**, **GitHub preview comments** sets **Comment on preview pull requests**. The default is on. -- On a Space's **Builds** page, open repository settings. **Pull request preview comments** can inherit the team default, turn on, or turn off. +- On a Space's [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) page, open repository settings. **Pull request preview comments** can inherit the team default, turn on, or turn off. The section heading is not a second toggle. The comment does not replace GitHub's deployment timeline entries or change a preview's access rules. @@ -91,7 +98,7 @@ Comments require the GitHub App to have **Pull requests: Read and write** permis ## Source sharing -Check or toggle whether a Space's repository allows independent forks of `main` with [`sf source availability`](/cli/reference#sf-source-availability) or the API: +Check or toggle whether a Space's repository allows independent forks of `main` with [`sf source availability`](/cli/reference/source#sf-source-availability) or the API: - `GET /v1/spaces/{spaceId}/source/availability` returns whether the current repository permits independent forks of `main`, its remix URL, and whether the Remix button is shown. - `PUT /v1/spaces/{spaceId}/source/availability` accepts `{"enabled":true}` to allow forks or `{"enabled":false}` to stop allowing them, plus an optional `remixButton` boolean. @@ -109,13 +116,13 @@ The connection carries one production branch. Everything else is a preview. Both are on by default. Turn one off and pushes to that side still record a delivery but queue no build. The dashboard's **Publish on every push** toggle flips to **Publishing on push paused**, and its hint says webhooks stay visible while no builds are queued. -Update branch settings with [`sf git update`](/cli/reference#sf-git-update): +Update branch settings with [`sf git update`](/cli/reference/git#sf-git-update): ```bash sf git update --space docs --production-branch main --no-auto-deploy-previews ``` -Force a target by hand when you need to with [`sf git build`](/cli/reference#sf-git-build): +Force a target by hand when you need to with [`sf git build`](/cli/reference/git#sf-git-build): ```bash sf git build --space docs --ref main --target production --wait @@ -162,7 +169,7 @@ See [Logs](/logs). Every push the platform hears about is recorded as a delivery, whether or not it produced a build. That is where to look when a push seems to have done nothing. -Open **Builds** and expand **Repository events**. A delivery carries a status of `received`, `processing`, `processed`, `ignored`, or `failed`, plus the builds it queued and the versions it retired. `ignored` is the normal answer when auto-deploy is off for that branch. +Open [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) and expand **Repository events**. A delivery carries a status of `received`, `processing`, `processed`, `ignored`, or `failed`, plus the builds it queued and the versions it retired. `ignored` is the normal answer when auto-deploy is off for that branch. The API exposes the same list. @@ -174,7 +181,7 @@ The API exposes the same list. ## Managing the connection -Inspect, sync, update credentials, or disconnect with [`sf git inspect`](/cli/reference#sf-git-inspect), [`sf git sync`](/cli/reference#sf-git-sync), [`sf git update`](/cli/reference#sf-git-update), [`sf git disconnect`](/cli/reference#sf-git-disconnect), [`sf git github installations`](/cli/reference#sf-git-github-installations), and [`sf git github repos`](/cli/reference#sf-git-github-repos-installation): +Inspect, sync, update credentials, or disconnect with [`sf git inspect`](/cli/reference/git#sf-git-inspect), [`sf git sync`](/cli/reference/git#sf-git-sync), [`sf git update`](/cli/reference/git#sf-git-update), [`sf git disconnect`](/cli/reference/git#sf-git-disconnect), [`sf git github installations`](/cli/reference/git#sf-git-github-installations), and [`sf git github repos`](/cli/reference/git#sf-git-github-repos-installation): ```bash sf git inspect --space docs @@ -193,7 +200,7 @@ The exact values each command family uses: | Command family | Values | Meaning | | --- | --- | --- | -| [`sf git connect`](/cli/reference#sf-git-connect), [`sf git inspect`](/cli/reference#sf-git-inspect), [`sf git sync`](/cli/reference#sf-git-sync), [`sf git build`](/cli/reference#sf-git-build) | `connected`, `hosted` | `connected` is an external Git provider with a webhook. `hosted` is the Spacefast remote | -| [`sf source list`](/cli/reference#sf-source-list), [`sf source cat`](/cli/reference#sf-source-cat-path), [`sf source diff`](/cli/reference#sf-source-diff), [`sf source branch`](/cli/reference#sf-source-branch), [`sf source merge`](/cli/reference#sf-source-merge-source-target), [`sf source tags list`](/cli/reference#sf-source-tags-list), [`sf source commits list`](/cli/reference#sf-source-commits-list) | `remote`, `push`, `import` | `remote` is the same thing as `connected`, `push` the same as `hosted`, and `import` is a one-off import remote | +| [`sf git connect`](/cli/reference/git#sf-git-connect), [`sf git inspect`](/cli/reference/git#sf-git-inspect), [`sf git sync`](/cli/reference/git#sf-git-sync), [`sf git build`](/cli/reference/git#sf-git-build) | `connected`, `hosted` | `connected` is an external Git provider with a webhook. `hosted` is the Spacefast remote | +| [`sf source list`](/cli/reference/source#sf-source-list), [`sf source cat`](/cli/reference/source#sf-source-cat-path), [`sf source diff`](/cli/reference/source#sf-source-diff), [`sf source branch`](/cli/reference/source#sf-source-branch), [`sf source merge`](/cli/reference/source#sf-source-merge-source-target), [`sf source tags list`](/cli/reference/source#sf-source-tags-list), [`sf source commits list`](/cli/reference/source#sf-source-commits-list) | `remote`, `push`, `import` | `remote` is the same thing as `connected`, `push` the same as `hosted`, and `import` is a one-off import remote | -`--connection-type` defaults to `connected` on the `git` commands and to `remote` on most `source` commands. See the full flag lists under [`sf git`](/cli/reference#sf-git) and [`sf source list`](/cli/reference#sf-source-list). +`--connection-type` defaults to `connected` on the `git` commands and to `remote` on most `source` commands. See the full flag lists under [`sf git`](/cli/reference/git#sf-git) and [`sf source list`](/cli/reference/source#sf-source-list). diff --git a/content/(deploy)/publish.mdx b/content/(deploy)/publish.mdx index 83d70e58..1cb932cc 100644 --- a/content/(deploy)/publish.mdx +++ b/content/(deploy)/publish.mdx @@ -37,9 +37,7 @@ sf publish --target preview --json -**Drop** takes a folder, a `.zip`, or a single `index.html`. Open it at [drop.fast](https://drop.fast); no account needed. Drag it onto the window, or use **Choose a folder** or **Choose files**. Pick a **Team**, a **Destination** of **New space** or **Existing space**, and for an existing Space either **Add & update** or **Replace all**. Progress runs **Prepare → Upload → Build → Go live**. - -For a Space you already have open, the topbar **Publish** button asks **How do you want to publish?** and offers **Publish from Git**, **Drop files**, **Use the Spacefast CLI**, or an agent. +[Drop](/publish#drop) accepts a folder or archive in your browser. For a Space you already have open, the topbar **Publish** button asks **How do you want to publish?** and offers **Publish from Git**, **Drop files**, **Use the Spacefast CLI**, or an agent. @@ -56,6 +54,15 @@ curl -X POST https://api.spacefast.com/v1/publish \ +## Drop + +**Drop** takes a folder, a `.zip`, or a single `index.html`. Drag it onto [drop.fast](https://drop.fast), or select **Choose a folder** or **Choose files**. + +- **Signed out:** Use **Anonymous drop**. Save the [claim link](/agents/anonymous-and-claim#claim-it) to keep the Space. +- **Signed in:** Pick a **Team** and a **Destination**. For an **Existing space**, choose **Add & update** or **Replace all**. + +Progress runs **Prepare → Upload → Build → Go live**. + ## What gets uploaded Publishing walks the directory and builds a manifest. Three things can happen to a path. @@ -212,4 +219,4 @@ Every code, and whether to retry it, is on [Error codes](/api/errors). ## Next steps -For a standalone file, start with the [plain HTML recipe](/guides/recipes/html), or inspect every flag on [`sf publish`](/cli/reference#sf-publish-dir). +For a standalone file, start with the [plain HTML recipe](/guides/recipes/html), or inspect every flag on [`sf publish`](/cli/reference/publish#sf-publish-dir). diff --git a/content/(deploy)/versions.mdx b/content/(deploy)/versions.mdx index 224de262..3a1a87c9 100644 --- a/content/(deploy)/versions.mdx +++ b/content/(deploy)/versions.mdx @@ -72,7 +72,12 @@ Both take a version ID, a ref such as `v12`, or a bare number. Both wait for the -Open **Versions**, find the row, and hit **Make live**. Confirm on **Make v12 live?**. The Overview page carries the same action as **Roll back to** next to the previous version. +1. Open the Space's [**Versions**](https://my.spacefast.com/?to=/:team/:space/versions) page. +2. Find the row. +3. Select **Make live**. +4. Confirm on **Make v12 live?** + +The [**Overview**](https://my.spacefast.com/?to=/:team/:space) page carries the same action as **Roll back to** next to the previous version. Afterward, the list shows the rollback state, for example *Rolled back from v13. Make it live below to roll forward.* @@ -151,9 +156,9 @@ To compare two completed versions directly, call [`compareSpaceDeploymentVersion | Task | CLI | Dashboard | | --- | --- | --- | -| List versions | [`sf versions list`](/cli/reference#sf-versions-list) | **Versions** | -| Inspect one | [`sf versions inspect v12`](/cli/reference#sf-versions-inspect-version) | A version row, then the detail page | -| Make one live | [`sf promote v12`](/cli/reference#sf-promote-version) | **Make live** | -| Go back | [`sf rollback v12`](/cli/reference#sf-rollback-version) | **Roll back to** on Overview | -| Delete one | [`sf versions delete v12`](/cli/reference#sf-versions-delete-version) | Version detail page | -| Change promotion policy | [`sf channels set live --promotion manual`](/cli/reference#sf-channels-set-name) | **Publishing** on **Versions**: **Automatic** or **Manual** | +| List versions | [`sf versions list`](/cli/reference/versions#sf-versions-list) | [**Versions**](https://my.spacefast.com/?to=/:team/:space/versions) | +| Inspect one | [`sf versions inspect v12`](/cli/reference/versions#sf-versions-inspect-version) | A version row, then the detail page | +| Make one live | [`sf promote v12`](/cli/reference/promote#sf-promote-version) | **Make live** | +| Go back | [`sf rollback v12`](/cli/reference/rollback#sf-rollback-version) | **Roll back to** on [**Overview**](https://my.spacefast.com/?to=/:team/:space) | +| Delete one | [`sf versions delete v12`](/cli/reference/versions#sf-versions-delete-version) | Version detail page | +| Change promotion policy | [`sf channels set live --promotion manual`](/cli/reference/channels#sf-channels-set-name) | **Publishing** on **Versions**: **Automatic** or **Manual** | diff --git a/content/(get-started)/quickstart.mdx b/content/(get-started)/quickstart.mdx index 676a859f..d745708e 100644 --- a/content/(get-started)/quickstart.mdx +++ b/content/(get-started)/quickstart.mdx @@ -7,9 +7,11 @@ You can publish a folder of static files and get a live `space.fast` URL in one ## Before you start -You need a folder of built static files. Any framework's output directory works (`dist`, `out`, `build`, `public`). If you only have source, [`sf publish`](/cli/reference#sf-publish-dir) can build it for you; see [Frameworks and builds](/guides/frameworks). +You need a folder of built static files. Any framework's output directory works (`dist`, `out`, `build`, `public`). If you only have source, [`sf publish`](/cli/reference/publish#sf-publish-dir) can build it for you; see [Frameworks and builds](/guides/frameworks). -Don't want to install anything? Open [drop.fast](https://drop.fast) and drag a folder, a `.zip`, or a single `index.html` onto the window, or run `npx -y spacefast setup` from any terminal. No account needed to start. See [Drop](/publish#publish) or [Publish from Git](/git) (`push.fast`) for the browser and Git workflows. +Don't want to install anything? Open [drop.fast](https://drop.fast) and drag a folder, a `.zip`, or a single `index.html` onto the window. No account needed to start. See [Drop](/publish#drop) or [Publish from Git](/git) (`push.fast`) for the browser and Git workflows. + +For interactive terminal setup, run [`npx -y spacefast setup`](/cli/reference/setup#sf-setup). The wizard signs you in and offers to install the CLI and agent tools before asking whether to publish. @@ -31,7 +33,7 @@ Don't want to install anything? Open [drop.fast](https://drop.fast) and drag a f sf login ``` - [`sf login`](/cli/reference#sf-login) prints a code and opens your browser. Approve the request there. The CLI receives an API key that lasts 30 days and expires after 7 days without use. Confirm with [`sf whoami`](/cli/reference#sf-whoami). + [`sf login`](/cli/reference/login#sf-login) prints a code and opens your browser. Approve the request there. The CLI receives an API key that lasts 30 days and expires after 7 days without use. Confirm with [`sf whoami`](/cli/reference/whoami#sf-whoami). You can skip this step and publish anonymously. The claim link printed after the publish lets you attach the Space to your account later. An unclaimed Space serves for {{anonymous-ttlSeconds}} after creation or the latest publish that changes files, capped at {{anonymous-publishAbsoluteCapSeconds}} from creation. @@ -62,16 +64,16 @@ Don't want to install anything? Open [drop.fast](https://drop.fast) and drag a f - If you skipped sign-in, run [`sf spaces claim`](/cli/reference#sf-spaces-claim) in this directory first. It asks you to sign in and attach the Space to a team. [`sf versions list`](/cli/reference#sf-versions-list) and rollback by version number need a claimed Space. + If you skipped sign-in, run [`sf spaces claim`](/cli/reference/spaces#sf-spaces-claim) in this directory first. It asks you to sign in and attach the Space to a team. [`sf versions list`](/cli/reference/versions#sf-versions-list) and rollback by version number need a claimed Space. - Change a file and run [`sf publish`](/cli/reference#sf-publish-dir) (`sf publish ./dist`) again. Only changed files upload. You get `v2`, and `live` now points at it. The version URL for a retained `v1` still serves the old build. + Change a file and run [`sf publish`](/cli/reference/publish#sf-publish-dir) (`sf publish ./dist`) again. Only changed files upload. You get `v2`, and `live` now points at it. The version URL for a retained `v1` still serves the old build. ```bash sf versions list sf rollback v1 ``` - [`sf rollback`](/cli/reference#sf-rollback-version) puts `v1`'s files live without running a build. By default it applies your current rewrites, so the result is a new version. To put `v2` back, run [`sf promote`](/cli/reference#sf-promote-version) (`sf promote v2`). + [`sf rollback`](/cli/reference/rollback#sf-rollback-version) puts `v1`'s files live without running a build. By default it applies your current rewrites, so the result is a new version. To put `v2` back, run [`sf promote`](/cli/reference/promote#sf-promote-version) (`sf promote v2`). @@ -80,7 +82,7 @@ Don't want to install anything? Open [drop.fast](https://drop.fast) and drag a f sf domains add example.com --role primary ``` - [`sf domains add`](/cli/reference#sf-domains-add-hostname) prints the DNS records to create at your DNS provider: a TXT record that proves you control the name, and A records that route traffic. Adding an apex also adds `www` and redirects it to the apex. Check progress with [`sf domains check`](/cli/reference#sf-domains-check-domain): + [`sf domains add`](/cli/reference/domains#sf-domains-add-hostname) prints the DNS records to create at your DNS provider: a TXT record that proves you control the name, and A records that route traffic. Adding an apex also adds `www` and redirects it to the apex. Check progress with [`sf domains check`](/cli/reference/domains#sf-domains-check-domain): ```bash sf domains check example.com @@ -88,7 +90,7 @@ Don't want to install anything? Open [drop.fast](https://drop.fast) and drag a f Once the domain is `active`, the Live URL switches to `https://example.com`. The `space.fast` hostname keeps working. Details, states, and troubleshooting are in [Custom domains](/domains). - No domain yet? [`sf domains search`](/cli/reference#sf-domains-search-query) (`sf domains search "your idea"`) finds one, and [Register a domain](/domains/registration) walks you through buying it. + No domain yet? [`sf domains search`](/cli/reference/domains#sf-domains-search-query) (`sf domains search "your idea"`) finds one, and [Register a domain](/domains/registration) walks you through buying it. diff --git a/content/(get-started)/request-lifecycle.mdx b/content/(get-started)/request-lifecycle.mdx index f3dd4afa..022e8183 100644 --- a/content/(get-started)/request-lifecycle.mdx +++ b/content/(get-started)/request-lifecycle.mdx @@ -38,7 +38,7 @@ For public `GET` and `HEAD` requests that no cache-bypass or no-store rule exclu ## Redirects, rewrites, and proxies -On a cache miss, Spacefast evaluates compiled rules in order (`_redirects` first, then `redirects`, then `rewrites` from [`spacefast.config.ts`](/config-file) or `sf.jsonc`), and the first match wins. Redirects and proxies answer without checking the static file table. Rewrites and `404` rules yield to an existing static file unless you set `force`. Test rule evaluation locally before publishing with [`sf routing inspect`](/cli/reference#sf-routing-inspect), and see [Redirects and rewrites](/redirects). +On a cache miss, Spacefast evaluates compiled rules in order (`_redirects` first, then `redirects`, then `rewrites` from [`spacefast.config.ts`](/config-file) or `sf.jsonc`), and the first match wins. Redirects and proxies answer without checking the static file table. Rewrites and `404` rules yield to an existing static file unless you set `force`. Test rule evaluation locally before publishing with [`sf routing inspect`](/cli/reference/routing#sf-routing-inspect), and see [Redirects and rewrites](/redirects). ## Access control diff --git a/content/(get-started)/spaces.mdx b/content/(get-started)/spaces.mdx index d1b9a037..98543111 100644 --- a/content/(get-started)/spaces.mdx +++ b/content/(get-started)/spaces.mdx @@ -53,7 +53,7 @@ The owner depends on how the Space was created: - **A space key.** A Space published without an account is owned by its `sfc_` key until someone claims it. See [Publish without an account](/agents/anonymous-and-claim). - **An external principal.** A customer in a [Partner API integration](/platforms/partner-api/customers) can own Spaces without a self-serve team. -To move a Space to another team, run `sf spaces transfer --space docs`, or open **Space settings → General → Transfer this space → Transfer space…**. If you are an owner or admin of both teams, the move is instant. The Space keeps serving at its current address. Otherwise the target team has 7 days to accept, and nothing changes until they do. Roles and membership are on [Teams](/teams). +To move a Space to another team, run `sf spaces transfer --space docs`, or open [**Space settings → General → Transfer this space → Transfer space…**](https://my.spacefast.com/?to=/:team/:space/settings). If you are an owner or admin of both teams, the move is instant. The Space keeps serving at its current address. Otherwise the target team has 7 days to accept, and nothing changes until they do. Roles and membership are on [Teams](/teams). @@ -89,7 +89,7 @@ sf spaces inspect --space docs -The team page lists every Space you can reach, and **Add space** starts a new one. Open a Space to land on **Overview**, which carries the live address, the last publish, and a **Roll back to** shortcut. +The [team page](https://my.spacefast.com/?to=/:team) lists every Space you can reach, and **Add space** starts a new one. Open a Space to land on [**Overview**](https://my.spacefast.com/?to=/:team/:space), which carries the live address, the last publish, and a **Roll back to** shortcut. @@ -112,7 +112,12 @@ A rename moves the slug and the managed hostname together. sf spaces update --space docs --slug developers ``` -In the dashboard, open **Space settings → General → Managed address** and edit **Slug**. Save it with the action in that section, not the General settings Save bar. Save or discard other General settings changes first. +In the dashboard: + +1. Open [**Space settings → General**](https://my.spacefast.com/?to=/:team/:space/settings). +2. Save or discard any other General settings changes. +3. Under **Managed address**, edit **Slug**. +4. Save the slug with the action in that section, not the General settings Save bar. Over HTTP, `PATCH /v1/spaces/{spaceId}` takes `slug` and refuses it alongside any other field, so send it by itself. @@ -128,7 +133,7 @@ One thing blocks a rename. While `name` is set in your project configuration (`s ## Labels, runtime apply, and work mode - **Labels**: Group Spaces under your team's shared labels with [`addSpaceLabel`](/api/reference/spaces/addspacelabel) (`PUT /v1/spaces/{spaceId}/labels/{labelId}`) and [`removeSpaceLabel`](/api/reference/spaces/removespacelabel). Create and edit labels at the team level; see [Teams and members](/teams#organize-spaces-with-labels). -- **Apply saved changes**: Push saved Space settings onto the live runtime without running a full publish using [`sf apply`](/cli/reference#sf-apply) (or [`applySpaceRuntimeChanges`](/api/reference/spaces/applyspaceruntimechanges)). Check whether changes are `pending`, `applying`, `live`, or `failed` with [`getSpaceApplyState`](/api/reference/spaces/getspaceapplystate). +- **Apply saved changes**: Push saved Space settings onto the live runtime without running a full publish using [`sf apply`](/cli/reference/apply#sf-apply) (or [`applySpaceRuntimeChanges`](/api/reference/spaces/applyspaceruntimechanges)). Check whether changes are `pending`, `applying`, `live`, or `failed` with [`getSpaceApplyState`](/api/reference/spaces/getspaceapplystate). - **Work mode**: Each user has a saved editing mode per Space (`vibe` or `code`, defaulting to `vibe` when unset). Read or update it with [`getSpaceWorkMode`](/api/reference/spaces/getspaceworkmode) and [`setSpaceWorkMode`](/api/reference/spaces/setspaceworkmode) (passing `expectedRevision`). ## Show & Tell @@ -147,7 +152,7 @@ Deleting is a takedown, and it takes effect at once. sf spaces rm --space docs ``` -In the dashboard it is **Space settings → General → Delete this space → Delete space**. Over HTTP it is [`deleteSpace`](/api/reference/spaces/deletespace). +In the dashboard it is [**Space settings → General → Delete this space → Delete space**](https://my.spacefast.com/?to=/:team/:space/settings). Over HTTP it is [`deleteSpace`](/api/reference/spaces/deletespace). | What | What happens | | --- | --- | @@ -169,4 +174,4 @@ A Space created by an anonymous publish expires {{anonymous-ttlSeconds}} after t ## Next steps -Use [`sf spaces`](/cli/reference#sf-spaces) in the CLI reference to find and manage Spaces from your terminal. +Use [`sf spaces`](/cli/reference/spaces#sf-spaces) in the CLI reference to find and manage Spaces from your terminal. diff --git a/content/(operate)/activity.mdx b/content/(operate)/activity.mdx index cae9d127..d0c8fbe6 100644 --- a/content/(operate)/activity.mdx +++ b/content/(operate)/activity.mdx @@ -3,19 +3,19 @@ title: Activity and audit logs description: Inspect Space and team activity, filter setting changes, and export team audit logs as CSV --- -Every Space and team mutation writes an append-only activity event naming who acted, what changed, when it happened, and the outcome. Read the feed in the dashboard, through [`sf activity`](/cli/reference#sf-activity), or over the API, and export team logs as CSV for audits. +Every Space and team mutation writes an append-only activity event naming who acted, what changed, when it happened, and the outcome. Read the feed in the dashboard, through [`sf activity`](/cli/reference/activity#sf-activity), or over the API, and export team logs as CSV for audits. ## Where to read activity -- **Space activity**: open a Space in the dashboard and go to **Activity**, or run `sf activity` in a linked directory. -- **Team activity**: open **Team settings → Activity**. On Enterprise plans, the team audit log also appears as its own **Audit log** page. +- **Space activity**: open a Space in the dashboard and go to [**Activity**](https://my.spacefast.com/?to=/:team/:space/settings/activity), or run `sf activity` in a linked directory. +- **Team activity**: open [**Team settings → Activity**](https://my.spacefast.com/?to=/:team/settings/activity). On Enterprise plans, the team audit log also appears as its own [**Audit log**](https://my.spacefast.com/?to=/:team/audit-log) page. - **Account-wide feed**: run `sf activity --all` to read every event visible to your account. On teams that are or have been on Enterprise plans, reading team and Space activity requires `activity:read`, which team owners and admins hold. Partner keys and `client_credentials` OAuth tokens do not hold it. ## Read activity from the CLI -Inspect recent Space activity, filter by event code or changed team setting, or bound the time range with [`sf activity`](/cli/reference#sf-activity): +Inspect recent Space activity, filter by event code or changed team setting, or bound the time range with [`sf activity`](/cli/reference/activity#sf-activity): ```bash sf activity @@ -71,7 +71,7 @@ Spacefast hides events older than your plan's window and excludes them from expo Export team logs as an RFC 4180 CSV file covering the team and its subteams, newest first, with no page limit. -Request an export from the team Activity page or by calling [`createTeamActivityExport`](/api/reference/activity/createteamactivityexport) (`POST /v1/teams/{teamId}/activity/exports`). The endpoint accepts the feed's filters (`spaceId`, `actorType`, `actorId`, `code`, `setting`, `since`, `until`) plus `result`. +Request an export from the team [**Activity**](https://my.spacefast.com/?to=/:team/settings/activity) page or by calling [`createTeamActivityExport`](/api/reference/activity/createteamactivityexport) (`POST /v1/teams/{teamId}/activity/exports`). The endpoint accepts the feed's filters (`spaceId`, `actorType`, `actorId`, `code`, `setting`, `since`, `until`) plus `result`. Export rules and delivery: diff --git a/content/(operate)/comments.mdx b/content/(operate)/comments.mdx index 29146d79..9713b87f 100644 --- a/content/(operate)/comments.mdx +++ b/content/(operate)/comments.mdx @@ -9,7 +9,7 @@ Comments put feedback threads on the page they are about. A reviewer pins a thre - Collecting new comments is included on **Go** and higher plans (see [Pricing and limits](/pricing)); other plans return `403` `collab_plan_required`. Personal teams that already used Comments before the move to Go keep them. On **Personal** without Comments (or when Comments are turned off), existing threads stay readable and exportable in the dashboard, and team owners and admins can still moderate them. - Comments run only on claimed Spaces that belong to a team. Other Spaces get `team_required`. -- **Page Enhancements** must be on. Turn it on in the Space's settings under **General**. With it off, the API answers `comments_disabled`. The switch is `superpowers.enabled` in [the configuration file](/config-file#access-public-identity-theme-and-snippets). +- **Page Enhancements** must be on. Turn it on in the Space's settings under [**General**](https://my.spacefast.com/?to=/:team/:space/settings). With it off, the API answers `comments_disabled`. The switch is `superpowers.enabled` in [the configuration file](/config-file#access-public-identity-theme-and-snippets). - Who can comment comes from the Space's grants. A grant needs the `commenter` role or higher. See [Share and access](/share#roles). ## Choose where Comments run @@ -24,11 +24,11 @@ On Go and higher plans, a Space gets **Previews only** at its first publish. A c To change the setting in the dashboard: -1. Open the Space and go to **Comments**. +1. Open the Space and go to [**Comments**](https://my.spacefast.com/?to=/:team/:space/comments). 2. Open the settings control in the page header. It shows the current setting. 3. Under **Where people can comment**, choose an option. -To change it from the terminal, run `sf comments settings set --surface everywhere`. See [`sf comments settings set`](/cli/reference#sf-comments-settings-set). You can also switch Comments on previews or live with [`sf share set`](/cli/reference#sf-share-set). +To change it from the terminal, run `sf comments settings set --surface everywhere`. See [`sf comments settings set`](/cli/reference/comments#sf-comments-settings-set). You can also switch Comments on previews or live with [`sf share set`](/cli/reference/share#sf-share-set). Over HTTP, read Share and comment settings with [`getSpaceShare`](/api/reference/spaces/getspaceshare) (`GET /v1/spaces/{spaceId}/share`). Then send the `comments` fields to change (`previews`, `live`, `spamFilter`, or `notifications`) to [`updateSpaceShare`](/api/reference/spaces/updatespaceshare) (`PATCH /v1/spaces/{spaceId}/share`), passing the `revision` you read as `expectedRevision`. If someone changed the settings after your read, the update returns `409` `space_share_changed` with the current Share state. The dashboard shows **Comment Settings Changed Elsewhere** with **Apply Your Change** and **Use Latest**. @@ -76,13 +76,13 @@ A thread points at one of three anchors. Writing a comment needs a credential that acts as a person and carries `spaces:write`. Any other credential gets 403 "Comments require a credential that acts as a user." -To edit your own comment or reply, run [`sf comments edit`](/cli/reference#sf-comments-edit-comment). Only the author can edit, and editing sends no new notifications. +To edit your own comment or reply, run [`sf comments edit`](/cli/reference/comments#sf-comments-edit-comment). Only the author can edit, and editing sends no new notifications. If a request can be retried, send the same `idempotencyKey` each time. A repeated reply returns `status: "existing"` instead of a second reply. ## Reply and mention teammates -To reply, write in the thread's reply box on the page or the **Comments** page. From the terminal, run [`sf comments reply`](/cli/reference#sf-comments-reply-comment). Over HTTP, call [`createSpaceCommentReply`](/api/reference/spaces/createspacecommentreply). +To reply, write in the thread's reply box on the page or the [**Comments**](https://my.spacefast.com/?to=/:team/:space/comments) page. From the terminal, run [`sf comments reply`](/cli/reference/comments#sf-comments-reply-comment). Over HTTP, call [`createSpaceCommentReply`](/api/reference/spaces/createspacecommentreply). A mention notifies one teammate. You can mention the members of the Space's team who can open the Space. The `listSpaceCommentMentionable` operation returns them. @@ -93,17 +93,17 @@ A mention notifies one teammate. You can mention the members of the Space's team ## React to a thread -A thread takes six reactions: 👍, ❤️, 🎉, 👀, 🚀, and 🙏. Select one on the page or the **Comments** page. Select it again to take yours back. +A thread takes six reactions: 👍, ❤️, 🎉, 👀, 🚀, and 🙏. Select one on the page or the [**Comments**](https://my.spacefast.com/?to=/:team/:space/comments) page. Select it again to take yours back. -From the terminal, run [`sf comments react`](/cli/reference#sf-comments-react-comment-emoji) and [`sf comments unreact`](/cli/reference#sf-comments-unreact-comment-emoji). Over HTTP, send `emoji` and `op` (`add` or `remove`) to [`updateSpaceCommentReaction`](/api/reference/spaces/updatespacecommentreaction). +From the terminal, run [`sf comments react`](/cli/reference/comments#sf-comments-react-comment-emoji) and [`sf comments unreact`](/cli/reference/comments#sf-comments-unreact-comment-emoji). Over HTTP, send `emoji` and `op` (`add` or `remove`) to [`updateSpaceCommentReaction`](/api/reference/spaces/updatespacecommentreaction). ## Resolve and reopen a thread A resolved thread leaves the open list and keeps every reply. Reopen it to put it back. - On the page, you can resolve your own threads. People with the `editor` or `manager` role can resolve any thread. The **Sidebar** menu has **Resolve all**. -- On the **Comments** page, open the thread and select **Resolve** or **Reopen**. -- From the terminal, run [`sf comments resolve`](/cli/reference#sf-comments-resolve-comment) or [`sf comments reopen`](/cli/reference#sf-comments-reopen-comment). +- On the [**Comments**](https://my.spacefast.com/?to=/:team/:space/comments) page, open the thread and select **Resolve** or **Reopen**. +- From the terminal, run [`sf comments resolve`](/cli/reference/comments#sf-comments-resolve-comment) or [`sf comments reopen`](/cli/reference/comments#sf-comments-reopen-comment). - Over HTTP, send `status: "archived"` to resolve or `status: "open"` to reopen with [`updateSpaceComment`](/api/reference/spaces/updatespacecomment). The API, its exports, and the CLI's JSON name the resolved state `archived`. The dashboard, the page, and the CLI's human output say resolved. @@ -116,14 +116,14 @@ A thread is unread for you when it is open and someone else posted in it after y | --- | --- | | **Comments** page | Opening the thread | | Page | **Mark all as read** in the **Sidebar** menu | -| CLI | [`sf comments read`](/cli/reference#sf-comments-read-comment). `sf comments inspect` and `sf comments list` never mark a thread read | +| CLI | [`sf comments read`](/cli/reference/comments#sf-comments-read-comment). `sf comments inspect` and `sf comments list` never mark a thread read | | API | [`markSpaceCommentRead`](/api/reference/spaces/markspacecommentread). Reading a thread with [`getSpaceComment`](/api/reference/spaces/getspacecomment) does not mark it | The **Comments** item in the Space's sidebar shows a badge with the unread count. ## Use the Comments page -Open the Space and go to **Comments**. The list is on the left and the open thread is on the right. +Open the Space and go to [**Comments**](https://my.spacefast.com/?to=/:team/:space/comments). The list is on the left and the open thread is on the right. | Control | What it does | | --- | --- | @@ -175,7 +175,7 @@ Spacefast sends comment notifications to the dashboard **Notifications** panel a - Only a mention from a member of the Space's team notifies. - A visitor without an account gets reply emails only after they confirm an address. Each email has a **Stop reply emails** link. -All three settings are on by default. In the settings control on the **Comments** page, under **Advanced**, **Notify on new comments** sets `newThreads` and `newReplies` together. **Notify on status changes** sets `statusChanges`. Over HTTP, send `comments.notifications` to [`updateSpaceShare`](/api/reference/spaces/updatespaceshare). Each key you leave out keeps its value. +All three settings are on by default. In the settings control on the [**Comments**](https://my.spacefast.com/?to=/:team/:space/comments) page, under **Advanced**, **Notify on new comments** sets `newThreads` and `newReplies` together. **Notify on status changes** sets `statusChanges`. Over HTTP, send `comments.notifications` to [`updateSpaceShare`](/api/reference/spaces/updatespaceshare). Each key you leave out keeps its value. ## Export comments @@ -185,7 +185,7 @@ Export every thread in a Space (`GET /v1/spaces/{spaceId}/comments/export`) or o | --- | --- | --- | | **Download Comments** on the **Comments** page | Markdown, `spacefast-comments-.md` | Every thread in the Space | | **Download Comments** on a version page | JSON, `spacefast-comments-.json` | The version's threads | -| [`sf comments export`](/cli/reference#sf-comments-export) | Markdown by default, or JSON | All threads, or one version's with `--version` | +| [`sf comments export`](/cli/reference/comments#sf-comments-export) | Markdown by default, or JSON | All threads, or one version's with `--version` | | [`exportSpaceComments`](/api/reference/spaces/exportspacecomments) | `format=markdown` (default) or `format=json` | All threads (`GET /v1/spaces/{spaceId}/comments/export`) | | [`exportSpaceVersionComments`](/api/reference/versions/exportspaceversioncomments) | `format=markdown` (default) or `format=json` | One version's threads | @@ -195,7 +195,7 @@ The Markdown export starts with `# Spacefast comments`. Each thread is a `## ` | @@ -94,14 +94,14 @@ A request that reaches past your plan's window is not silently truncated. It ans ## Build logs -Read or follow a build's logs with [`sf builds logs`](/cli/reference#sf-builds-logs-build): +Read or follow a build's logs with [`sf builds logs`](/cli/reference/builds#sf-builds-logs-build): ```bash sf builds logs bld_123 sf builds logs bld_123 --follow ``` -`--limit` is 1 to 100, `--cursor` pages, and `--follow` streams until the build reaches a terminal state. In the dashboard, open **Builds**, pick a run, and the log pane streams while it runs. +`--limit` is 1 to 100, `--cursor` pages, and `--follow` streams until the build reaches a terminal state. In the dashboard, open [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds), pick a run, and the log pane streams while it runs. ## API diff --git a/content/(operate)/performance.mdx b/content/(operate)/performance.mdx index 3eb3dc6e..ad585ee0 100644 --- a/content/(operate)/performance.mdx +++ b/content/(operate)/performance.mdx @@ -22,7 +22,7 @@ To get the highest cache hit rate: - **Let the platform handle compression**: Spacefast serves Brotli and gzip automatically; do not set `Content-Encoding` in header rules. - **Test caching on public live URLs, not previews**: private previews and authenticated requests always return `private, no-store`. -See [Caching](/caching), [Headers](/headers), and [`spacefast.config.ts`](/config-file) for override rules and cache invalidation. Inspect compiled routing and header rules locally with [`sf routing inspect`](/cli/reference#sf-routing-inspect) before running [`sf publish`](/cli/reference#sf-publish-dir). +See [Caching](/caching), [Headers](/headers), and [`spacefast.config.ts`](/config-file) for override rules and cache invalidation. Inspect compiled routing and header rules locally with [`sf routing inspect`](/cli/reference/routing#sf-routing-inspect) before running [`sf publish`](/cli/reference/publish#sf-publish-dir). ## Image optimization with `@spacefast/image` @@ -73,7 +73,7 @@ export { default } from "@spacefast/image/next-loader"; Keep static assets out of your Worker so edge requests do not wake compute unnecessarily: - **Use the `functions/` file router**: when only specific API routes need dynamic code, Spacefast dispatches only the exact routes your files declare; unmatched paths return 404 without invoking the Worker. -- **Keep bundles lean**: every plan enforces a `24 MiB` uncompressed compiled Workers bundle limit covering compiled JavaScript, embedded modules, and the manifest. Run [`sf check`](/cli/reference#sf-check-dir) locally to catch size or config problems before publishing. Smaller bundles reduce cold-start overhead and publish faster. +- **Keep bundles lean**: every plan enforces a `24 MiB` uncompressed compiled Workers bundle limit covering compiled JavaScript, embedded modules, and the manifest. Run [`sf check`](/cli/reference/check#sf-check-dir) locally to catch size or config problems before publishing. Smaller bundles reduce cold-start overhead and publish faster. - **Tune request timeouts per route**: Worker requests default to `30 s`; configure longer per-route timeouts in [`spacefast.config.ts`](/config-file) up to `60 s` (Personal and Go), `120 s` (Pro), or `300 s` (Boost). See [Functions](/functions) for routing layouts and [Limits](/limits) for per-plan ceilings. @@ -100,4 +100,4 @@ Check which version served a request and verify cache behavior with `curl`: curl -sI https://my-space.space.fast/ | grep -iE 'x-spacefast|cache-control|etag' ``` -Compare cache hits, status codes, and response latency with [`sf logs`](/cli/reference#sf-logs-target-kind), [Edge request logs](/infrastructure/edge-request-logs), [Logs](/logs), and [Stats](/stats). +Compare cache hits, status codes, and response latency with [`sf logs`](/cli/reference/logs#sf-logs-target-kind), [Edge request logs](/infrastructure/edge-request-logs), [Logs](/logs), and [Stats](/stats). diff --git a/content/(operate)/production-checklist.mdx b/content/(operate)/production-checklist.mdx index 77faeffa..4fad3eee 100644 --- a/content/(operate)/production-checklist.mdx +++ b/content/(operate)/production-checklist.mdx @@ -7,47 +7,47 @@ Check these nine areas before sending production traffic to a Space. ## Custom domain and HTTPS -- Attach your custom domain and confirm its DNS records and TLS certificate are healthy with [`sf domains check`](/cli/reference#sf-domains-check-domain) and [`sf domains diagnostics`](/cli/reference#sf-domains-diagnostics-domain) (`sf domains diagnostics example.com --space my-space`). See [Custom domains](/domains), [DNS management](/domains/dns), and [TLS certificates](/infrastructure/tls-certificates). +- Attach your custom domain and confirm its DNS records and TLS certificate are healthy with [`sf domains check`](/cli/reference/domains#sf-domains-check-domain) and [`sf domains diagnostics`](/cli/reference/domains#sf-domains-diagnostics-domain) (`sf domains diagnostics example.com --space my-space`). See [Custom domains](/domains), [DNS management](/domains/dns), and [TLS certificates](/infrastructure/tls-certificates). - Confirm your primary hostname (`example.com` vs `www.example.com`) so the secondary hostname redirects cleanly with `308`. ## Channels and promotion -- Run [`sf check`](/cli/reference#sf-check-dir), publish to a preview channel or branch preview with [`sf publish`](/cli/reference#sf-publish-dir), verify the build and routes, and promote only a `ready` version to live with [`sf promote`](/cli/reference#sf-promote-version). See [Channels and previews](/channels) and [Publish](/publish). +- Run [`sf check`](/cli/reference/check#sf-check-dir), publish to a preview channel or branch preview with [`sf publish`](/cli/reference/publish#sf-publish-dir), verify the build and routes, and promote only a `ready` version to live with [`sf promote`](/cli/reference/promote#sf-promote-version). See [Channels and previews](/channels) and [Publish](/publish). - If you deploy from Git, verify the connected production branch and pull request preview settings in [Publish from Git](/git). ## Rollback plan -- Record the current live version ID before promoting a release so you can run [`sf rollback`](/cli/reference#sf-rollback-version) (`sf rollback `) in seconds without rebuilding. See [Versions](/versions). +- Record the current live version ID before promoting a release so you can run [`sf rollback`](/cli/reference/rollback#sf-rollback-version) (`sf rollback `) in seconds without rebuilding. See [Versions](/versions). - Keep database schema changes backward-compatible across the previous and new versions when rolling back a dynamic Space. ## Budgets and plan limits -- Set team or Space usage budgets with [`sf budget set`](/cli/reference#sf-budget-set-amount) so you receive alerts before hitting spend ceilings. See [Usage](/usage) and [Billing](/billing). +- Set team or Space usage budgets with [`sf budget set`](/cli/reference/budget#sf-budget-set-amount) so you receive alerts before hitting spend ceilings. See [Usage](/usage) and [Billing](/billing). - Verify your Space stays within plan ceilings for compute workers, disk, file sizes, crons, redirects, and header rules on [Limits](/limits). ## Access and indexing -- Run [`sf share show`](/cli/reference#sf-share-show) (`sf share show --space my-space`) to verify general access (`private` vs `public`), search-engine indexing, and whether Comments are limited to previews or live. See [Share and access](/share). +- Run [`sf share show`](/cli/reference/share#sf-share-show) (`sf share show --space my-space`) to verify general access (`private` vs `public`), search-engine indexing, and whether Comments are limited to previews or live. See [Share and access](/share). - Revoke any temporary review links or test passwords before launch. If your Space uses SSO, verify the identity connection and external grants on [SSO and external identity](/sso). -- On Enterprise teams, audit public reach in **Security Review** on [Security and trust](/security). +- On Enterprise teams, audit public reach in [**Security Review**](https://my.spacefast.com/?to=/:team/external-access) on [Security and trust](/security). ## Headers, redirects, and caching -- Configure redirects, rewrites, and response headers in [`spacefast.config.ts`](/config-file) and inspect local rules with [`sf routing inspect`](/cli/reference#sf-routing-inspect) before promoting. See [Redirects and rewrites](/redirects) and [Headers](/headers). +- Configure redirects, rewrites, and response headers in [`spacefast.config.ts`](/config-file) and inspect local rules with [`sf routing inspect`](/cli/reference/routing#sf-routing-inspect) before promoting. See [Redirects and rewrites](/redirects) and [Headers](/headers). - Add security headers (`X-Content-Type-Options`, `Referrer-Policy`, `Content-Security-Policy`) without overriding platform-managed transport headers. See [HTTP and security headers](/infrastructure/http-security-headers). - Verify live caching headers on a public URL after promotion (private previews always return `private, no-store`). See [Caching](/caching) and [Performance and optimization](/performance). ## Stats and tags -- Confirm **Settings → Stats** (and **Stats**, if your team has browser stats) reports traffic after launch. See [Stats](/stats). -- When shipping analytics or marketing scripts through [Tag Manager](/tag-manager), validate the revision and test it with [`sf tags debug`](/cli/reference#sf-tags-debug) before releasing to `production`. +- Confirm **Settings → Stats** (and [**Stats**](https://my.spacefast.com/?to=/:team/:space/stats), if your team has browser stats) reports traffic after launch. See [Stats](/stats). +- When shipping analytics or marketing scripts through [Tag Manager](/tag-manager), validate the revision and test it with [`sf tags debug`](/cli/reference/tags#sf-tags-debug) before releasing to `production`. ## Logs and audit trail -- Verify access to origin logs ([`sf logs`](/cli/reference#sf-logs-target-kind)), edge logs (`sf logs edge`), and runtime logs (`sf logs runtime --follow`). See [Logs](/logs) and [Edge request logs](/infrastructure/edge-request-logs). +- Verify access to origin logs ([`sf logs`](/cli/reference/logs#sf-logs-target-kind)), edge logs (`sf logs edge`), and runtime logs (`sf logs runtime --follow`). See [Logs](/logs) and [Edge request logs](/infrastructure/edge-request-logs). - Confirm your team's log and activity retention windows match your incident-response requirements on [Activity and audit logs](/activity). ## Backups and exports -- Confirm your plan's automatic MySQL backup schedule and test a manual [`sf db export`](/cli/reference#sf-db-export-target) before major data changes. See [Backups, archives, and exports](/exports) and [Database](/database). -- Keep a clean recovery path for source code via Git or [`sf source archive`](/cli/reference#sf-source-archive). +- Confirm your plan's automatic MySQL backup schedule and test a manual [`sf db export`](/cli/reference/db#sf-db-export-target) before major data changes. See [Backups, archives, and exports](/exports) and [Database](/database). +- Keep a clean recovery path for source code via Git or [`sf source archive`](/cli/reference/source#sf-source-archive). diff --git a/content/(operate)/security.mdx b/content/(operate)/security.mdx index 4845a08e..e1dfd12f 100644 --- a/content/(operate)/security.mdx +++ b/content/(operate)/security.mdx @@ -7,7 +7,7 @@ Review which Spaces are reachable outside your team, lock down public links and ## Security Review (Enterprise) -Enterprise teams include **Security Review** in the dashboard (`//external-access`), a read-only inventory of external reach across a root team and its live [subteams](/subteams) (or one subteam). +Enterprise teams include [**Security Review**](https://my.spacefast.com/?to=/:team/external-access) in the dashboard (`//external-access`), a read-only inventory of external reach across a root team and its live [subteams](/subteams) (or one subteam). Any member of an Enterprise team can open **Security Review** for the teams and Spaces their credential can read. It shows public reach, share link counts, password counts, configured team connectors, team access defaults, and people with access. It never exposes sharing URLs, password proofs, connector credentials, or private account identities. @@ -26,7 +26,7 @@ Over HTTP, the matching read operations are: ## Lock down Spaces -From **Security Review**, select one or more Spaces and choose **Lock Down** (or call [`lockDownTeamExternalAccess`](/api/reference/teams/lockdownteamexternalaccess), `POST /v1/teams/{teamId}/external-access/lock-down`). +From [**Security Review**](https://my.spacefast.com/?to=/:team/external-access), select one or more Spaces and choose **Lock Down** (or call [`lockDownTeamExternalAccess`](/api/reference/teams/lockdownteamexternalaccess), `POST /v1/teams/{teamId}/external-access/lock-down`). Locking down closes every path into a Space that does not require an account: diff --git a/content/(operate)/share.mdx b/content/(operate)/share.mdx index 4a42501b..7270d7a5 100644 --- a/content/(operate)/share.mdx +++ b/content/(operate)/share.mdx @@ -42,7 +42,7 @@ Granting `commenter` on the live Space requires [Comments](/comments) set to **E ## In the dashboard -Open the Space and go to **Share**. +Open the Space and go to [**Share**](https://my.spacefast.com/?to=/:team/:space/share). The **General access** control switches between **Private** and **Public**: @@ -57,7 +57,7 @@ The page also holds the **Password**, **Share link**, and **People** cards, plus ## Make a Space public -Open the live Space to anyone on the web with [`sf share grant`](/cli/reference#sf-share-grant): +Open the live Space to anyone on the web with [`sf share grant`](/cli/reference/share#sf-share-grant): ```bash sf share grant --to public --role viewer --path '/**' --target live --space my-space @@ -79,7 +79,7 @@ sf share grant --to public --role viewer --path '/**' --target all-versions --sp Use `version:` to open one version. Branch previews need a `branch:` grant; `all-versions` does not cover them or the live Space. A public grant cannot target a branch, so share a branch preview with a link, a password, or a person instead. A team grant admits the owning team and cannot name another team you belong to. -You can also inspect or switch general access, indexing, and Comments in one command with [`sf share show`](/cli/reference#sf-share-show) and [`sf share set`](/cli/reference#sf-share-set): +You can also inspect or switch general access, indexing, and Comments in one command with [`sf share show`](/cli/reference/share#sf-share-show) and [`sf share set`](/cli/reference/share#sf-share-set): ```bash sf share show --space my-space @@ -103,7 +103,7 @@ https://my-space.space.fast/docs?__=sfl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ### Create a share link -Create a scoped, expiring link with [`sf share link create`](/cli/reference#sf-share-link-create): +Create a scoped, expiring link with [`sf share link create`](/cli/reference/share#sf-share-link-create): ```bash sf share link create \ @@ -133,7 +133,7 @@ sf share link create \ | `--country` / `--exclude-country` | none | Allowed or blocked ISO country codes; repeatable | | `--exclude-user-agent` | none | Block user agents containing this text; repeatable | -In the dashboard, the **Share link** card's **Create share link** button opens a sheet with the same fields. +On the Space's [**Share**](https://my.spacefast.com/?to=/:team/:space/share) page, the **Share link** card's **Create share link** button opens a sheet with the same fields. ### List, copy, update, and revoke @@ -149,7 +149,7 @@ Listing links never returns the secret. Only callers who can manage the Space's Revoking a link removes its grant in the same write, so every copy of the URL stops working on the next request. -[`sf share link update`](/cli/reference#sf-share-link-update-link) changes a link's scope, role, target, and constraints without rotating its URL, so you can narrow a link you already sent instead of replacing it. +[`sf share link update`](/cli/reference/share#sf-share-link-update-link) changes a link's scope, role, target, and constraints without rotating its URL, so you can narrow a link you already sent instead of replacing it. An unclaimed Space may keep up to 50 active links; further creates fail with [`anonymous_share_link_limit`](/errors/anonymous_share_link_limit). @@ -157,7 +157,7 @@ An unclaimed Space may keep up to 50 active links; further creates fail with [`a A password is its own grant with its own scope, not a lock on the whole Space. You can create several named passwords covering different paths. -Create a password grant with [`sf share password create`](/cli/reference#sf-share-password-create): +Create a password grant with [`sf share password create`](/cli/reference/share#sf-share-password-create): ```bash sf share password create \ @@ -170,7 +170,7 @@ sf share password create \ Pass the password on `stdin` or through `SPACEFAST_SHARE_PASSWORD`. It never goes into `spacefast.config.ts` or `sf.jsonc`. A password needs at least 15 characters; the dashboard's **Generate password** button creates one. The verifier is Argon2id, and `--role` defaults to `viewer`. -List, rotate, or revoke passwords with [`sf share password`](/cli/reference#sf-share-password): +List, rotate, or revoke passwords with [`sf share password`](/cli/reference/share#sf-share-password): ```bash sf share password list --space my-space @@ -180,11 +180,11 @@ sf share password revoke pwd_xxxxxxxx --space my-space Rotating keeps the grant and its scope and immediately signs out sessions admitted by the old password. Revoking removes the grant so those sessions lose access too. -The dashboard's **Password** card carries **Set password**, **Change password**, and **Remove password**, with **Expires**, **Paths**, and **What password holders can do** under **Password options**. The card manages one password; use the CLI or API for more. +On the Space's [**Share**](https://my.spacefast.com/?to=/:team/:space/share) page, the **Password** card carries **Set password**, **Change password**, and **Remove password**, with **Expires**, **Paths**, and **What password holders can do** under **Password options**. The card manages one password; use the CLI or API for more. ## Invite people -Invite collaborators by email with [`sf share people`](/cli/reference#sf-share-people): +Invite collaborators by email with [`sf share people`](/cli/reference/share#sf-share-people): ```bash sf share people invite person@example.com --space my-space --role commenter --scope /docs @@ -194,7 +194,7 @@ sf share people remove person@example.com --space my-space `--scope` defaults to `/` and is repeatable, so one invitation can grant the same role on several subtrees. `--target` defaults to `live`. -In the dashboard, the **People** card takes an email, a **What they can do** role, and a **What they get access to** scope. Pending rows show **Invitation pending** with **Resend** (`sf share people resend`) and **Remove** actions. +On the Space's [**Share**](https://my.spacefast.com/?to=/:team/:space/share) page, the **People** card takes an email, a **What they can do** role, and a **What they get access to** scope. Pending rows show **Invitation pending** with **Resend** (`sf share people resend`) and **Remove** actions. A person can hold up to 32 scoped grants on one Space, so one collaborator can hold different roles on different subtrees. An invitation expires after 7 days; **Resend** issues a fresh one. @@ -226,7 +226,7 @@ On the Space, the ordinary `Authorization` header belongs to your own applicatio A visitor who lands on a Space they cannot open can ask for access. The form takes an email and an optional message of up to 280 characters. The visitor confirms the request through an emailed link within 30 minutes, and team owners and admins receive an email with a review link. -Manage pending requests in the **Access requests** card or with [`sf share request`](/cli/reference#sf-share-request): +Manage pending requests in the **Access requests** card on the Space's [**Share**](https://my.spacefast.com/?to=/:team/:space/share) page or with [`sf share request`](/cli/reference/share#sf-share-request): ```bash sf share request list --space my-space @@ -254,7 +254,7 @@ Visitors can manage their own Space sessions through the API: ### Offer Sign in with Spacefast in your app -Register an OAuth app on your team with [`sf oauth-apps create`](/cli/reference#sf-oauth-apps-create) (or [`createOAuthApp`](/api/reference/teams/createoauthapp)) so visitors can sign in to your Space or external app with their Spacefast account: +Register an OAuth app on your team with [`sf oauth-apps create`](/cli/reference/oauth-apps#sf-oauth-apps-create) (or [`createOAuthApp`](/api/reference/teams/createoauthapp)) so visitors can sign in to your Space or external app with their Spacefast account: ```bash sf oauth-apps create \ @@ -262,7 +262,7 @@ sf oauth-apps create \ --redirect-uri https://my-space.space.fast/auth/callback ``` -Apps are public by default and use PKCE from the browser. Pass `--confidential` only for a server-side app; its client secret prints once, and you can rotate it with [`sf oauth-apps secret rotate`](/cli/reference#sf-oauth-apps-secret-rotate-app). Run [`sf oauth-apps inspect`](/cli/reference#sf-oauth-apps-inspect-app) to read the app's OpenID Connect endpoints and redirect URIs. +Apps are public by default and use PKCE from the browser. Pass `--confidential` only for a server-side app; its client secret prints once, and you can rotate it with [`sf oauth-apps secret rotate`](/cli/reference/oauth-apps#sf-oauth-apps-secret-rotate-app). Run [`sf oauth-apps inspect`](/cli/reference/oauth-apps#sf-oauth-apps-inspect-app) to read the app's OpenID Connect endpoints and redirect URIs. ## What a visitor sees @@ -278,7 +278,7 @@ Two behaviors can look like bugs and are not. A rewrite cannot widen access, bec ## Revoke every session at once -End every active visitor session on a Space immediately without a republish using [`sf access sessions revoke`](/cli/reference#sf-access-sessions-revoke): +End every active visitor session on a Space immediately without a republish using [`sf access sessions revoke`](/cli/reference/access#sf-access-sessions-revoke): ```bash sf access sessions revoke --space my-space @@ -288,7 +288,10 @@ This signs out every visitor regardless of how they entered (share link, passwor ## Defaults for new Spaces -A team chooses how its new Spaces start. In the dashboard, open team settings, go to **Access**, and use the **Space access** card's **New spaces are** row. +A team chooses how its new Spaces start. In the dashboard: + +1. Open team settings and go to [**Access**](https://my.spacefast.com/?to=/:team/settings/access). +2. Use the **Space access** card's **New spaces are** row. | Preset | New Spaces start with | | --- | --- | diff --git a/content/(operate)/space-transfers.mdx b/content/(operate)/space-transfers.mdx index 18f9fe3b..bd279cb1 100644 --- a/content/(operate)/space-transfers.mdx +++ b/content/(operate)/space-transfers.mdx @@ -7,7 +7,7 @@ Transfer a Space to move its ownership from one team to another without downtime ## Start a transfer -Move a Space to another team with [`sf spaces transfer`](/cli/reference#sf-spaces-transfer-team) or [`createSpaceTransfer`](/api/reference/spaces/createspacetransfer) (`POST /v1/space-transfers`): +Move a Space to another team with [`sf spaces transfer`](/cli/reference/spaces#sf-spaces-transfer-team) or [`createSpaceTransfer`](/api/reference/spaces/createspacetransfer) (`POST /v1/space-transfers`): ```bash sf spaces transfer target-team --space my-space @@ -22,7 +22,7 @@ A pending transfer expires after **7 days**. Only one transfer can be pending fo ## List, inspect, accept, and cancel transfers -Team owners and admins manage pending and past transfers with [`sf transfers`](/cli/reference#sf-transfers-list): +Team owners and admins manage pending and past transfers with [`sf transfers`](/cli/reference/transfers#sf-transfers-list): ```bash sf transfers list --team target-team diff --git a/content/(operate)/sso.mdx b/content/(operate)/sso.mdx index b8341df0..8924c89d 100644 --- a/content/(operate)/sso.mdx +++ b/content/(operate)/sso.mdx @@ -14,7 +14,9 @@ A connection admits nobody by itself. Until a Space has an external grant for it ## Connect an identity provider -Open team settings, go to **Access**, and in the **SSO providers** card choose **Add identity provider**. Pick the **Connection type** first; the rest of the form follows from it. +1. Open team settings and go to [**Access**](https://my.spacefast.com/?to=/:team/settings/access). +2. In the **SSO providers** card, choose **Add identity provider**. +3. Pick the **Connection type** first. The rest of the form follows from it. | Field | OpenID Connect | White-label signer | | --- | --- | --- | @@ -26,7 +28,7 @@ Open team settings, go to **Access**, and in the **SSO providers** card choose * Only team owners and admins can add, update, or revoke a connection. A team can hold one active connection per issuer. -Create and list connections from the CLI with [`sf share identity create`](/cli/reference#sf-share-identity-create) and [`sf share identity list`](/cli/reference#sf-share-identity-list): +Create and list connections from the CLI with [`sf share identity create`](/cli/reference/share#sf-share-identity-create) and [`sf share identity list`](/cli/reference/share#sf-share-identity-list): ```bash sf share identity create --type oidc --name "Company sign-in" \ @@ -50,11 +52,17 @@ Spacefast does not check the provider when you save the connection. A wrong issu ## Grant an identity access -Open the Space, go to **Share**, expand **Advanced**, and find **SSO and identity**. Pick the **Connection**, enter the **Subject**, give the grant a **Name**, then choose paths, a role, and an optional expiry. **Add identity grant** saves it. +1. Open the Space and go to [**Share**](https://my.spacefast.com/?to=/:team/:space/share). +2. Expand **Advanced** and find **SSO and identity**. +3. Pick the **Connection**. +4. Enter the **Subject**. +5. Give the grant a **Name**. +6. Choose paths, a role, and an optional expiry. +7. Select **Add identity grant** to save it. The subject is the `sub` claim your provider puts in its ID token, matched exactly. It is not an email address unless your provider uses email as `sub`, and there is no wildcard or domain matching. One grant admits one subject. Name the grant after the person or role it stands for, because the stored subject is opaque in every listing. -From the CLI, `--connection` takes the connection ID shown by `sf share identity list` (see [`sf share identity grant`](/cli/reference#sf-share-identity-grant)): +From the CLI, `--connection` takes the connection ID shown by `sf share identity list` (see [`sf share identity grant`](/cli/reference/share#sf-share-identity-grant)): ```bash sf share identity grant --space my-space \ @@ -66,7 +74,7 @@ sf share identity grant --space my-space \ An external grant can hold any role, from `viewer` to `manager`, and any target: `live`, `all-versions`, `version:`, or `branch:`. Use `--except` on the CLI to exclude paths from the grant. The dashboard form always writes `live` and takes no exclusions; use the CLI or the API for those. A `commenter` role on `live` needs the Space's [Comments](/comments) set to **Everywhere**; otherwise target a version. -The grant appears in [`sf share list`](/cli/reference#sf-share-list). To change its paths or role, revoke it and create a new one. Revoking takes effect on the next request. +The grant appears in [`sf share list`](/cli/reference/share#sf-share-list). To change its paths or role, revoke it and create a new one. Revoking takes effect on the next request. ## What a visitor sees @@ -74,7 +82,7 @@ On the Space's access page, each connection the Space has a grant for shows as a After sign-in, Spacefast checks the grant against the path the visitor asked for. An identity with no matching grant is refused with "This identity does not have access to that page." Fix that by adding a grant for its subject, or by widening the paths of the one it has. -An admitted visitor holds the same session as any other: it expires after 7 days idle or 30 days absolute, and [`sf access sessions revoke`](/cli/reference#sf-access-sessions-revoke) ends it. Each sign-in counts as one use against a grant's `--max-uses`. +An admitted visitor holds the same session as any other: it expires after 7 days idle or 30 days absolute, and [`sf access sessions revoke`](/cli/reference/access#sf-access-sessions-revoke) ends it. Each sign-in counts as one use against a grant's `--max-uses`. ## Rotate secrets and keys @@ -82,7 +90,7 @@ An admitted visitor holds the same session as any other: it expires after 7 days For a signer, the replacement key set is complete: list every key that should stay valid. To rotate without downtime, add the new key alongside the old one, switch your portal to the new key, then update again with only the new key. -Rotate secrets or keys with [`sf share identity update`](/cli/reference#sf-share-identity-update-connection): +Rotate secrets or keys with [`sf share identity update`](/cli/reference/share#sf-share-identity-update-connection): ```bash sf share identity update acn_xxxxxxxx --client-secret "$NEW_SECRET" @@ -93,7 +101,7 @@ sf share identity update acn_xxxxxxxx --key k2:AAAA...43chars --key k3:BBBB...43 **Revoke** on a connection ends it, every external grant on the team's Spaces that names its issuer, and every session those grants admitted. The SSO button disappears from each Space's access page. -Revoke a connection from the CLI with [`sf share identity revoke`](/cli/reference#sf-share-identity-revoke-connection): +Revoke a connection from the CLI with [`sf share identity revoke`](/cli/reference/share#sf-share-identity-revoke-connection): ```bash sf share identity revoke acn_xxxxxxxx diff --git a/content/(operate)/stats.mdx b/content/(operate)/stats.mdx index 821ed00b..5d45e8b1 100644 --- a/content/(operate)/stats.mdx +++ b/content/(operate)/stats.mdx @@ -9,8 +9,8 @@ Spacefast measures traffic from two independent sources: | Source | Where to open it | How it measures | Windows | | --- | --- | --- | --- | -| **Edge traffic stats** | **Settings → Stats**, [`sf analytics`](/cli/reference#sf-analytics), [`getSpaceAnalytics`](/api/reference/activity/getspaceanalytics) | Script-free request accounting at the edge | 48 hours (hourly), 7 days (daily), 30 days (daily) | -| **Browser stats (Spacefast Stats)** | **Stats** in the Space sidebar, or the on-Space Stats drawer | Browser tracker on published pages | Live (**Now**) and 7, 30, or 90 days (**Trends**) | +| **Edge traffic stats** | **Settings → Stats**, [`sf analytics`](/cli/reference/analytics#sf-analytics), [`getSpaceAnalytics`](/api/reference/activity/getspaceanalytics) | Script-free request accounting at the edge | 48 hours (hourly), 7 days (daily), 30 days (daily) | +| **Browser stats (Spacefast Stats)** | [**Stats**](https://my.spacefast.com/?to=/:team/:space/stats) in the Space sidebar, or the on-Space Stats drawer | Browser tracker on published pages | Live (**Now**) and 7, 30, or 90 days (**Trends**) | Use edge traffic stats to inspect HTTP requests, bandwidth, and busy paths. Use browser stats to watch live visitors and explore engagement, referrers, and scroll depth over time. The two sources count visits differently, so do not expect their totals to match. @@ -55,7 +55,7 @@ Each time you open edge stats, Spacefast reads them from the edge instead of sto ### Read edge stats from the CLI -Run [`sf analytics`](/cli/reference#sf-analytics) to print edge traffic stats in the terminal: +Run [`sf analytics`](/cli/reference/analytics#sf-analytics) to print edge traffic stats in the terminal: ```bash sf analytics --space my-space --window 30d @@ -87,12 +87,14 @@ There is no window-level request total in the payload. Sum `series[].requests` f ## Browser stats (Now and Trends) -Open the Space and choose **Stats** in the sidebar to see who is on your Space right now (**Now**) and how visits change over 7, 30, or 90 days (**Trends**). You must be signed in as an editor of the Space. +Labs + +Open the Space and choose [**Stats**](https://my.spacefast.com/?to=/:team/:space/stats) in the sidebar to see who is on your Space right now (**Now**) and how visits change over 7, 30, or 90 days (**Trends**). You must be signed in as an editor of the Space. ### Requirements and controls - **Team access**: Browser stats aren't available to every team yet. Once your team has access, Spacefast tracks every Space by default unless an editor switches it off. -- **Per-Space switch**: on the **Stats** page, choose **Turn Off** to stop tracking a Space or **Turn On Stats** to resume it from the next visit. Turning it off keeps existing history. +- **Per-Space switch**: on the [**Stats**](https://my.spacefast.com/?to=/:team/:space/stats) page, choose **Turn Off** to stop tracking a Space or **Turn On Stats** to resume it from the next visit. Turning it off keeps existing history. - **Page Enhancements**: collecting visits on published pages requires **Page Enhancements** enabled in the Space's settings (`superpowers.enabled` in [the configuration file](/config-file#access-public-identity-theme-and-snippets)). Opening the dashboard does not start collection while Page Enhancements is off. - **Comments not required for the dashboard**: the dashboard **Now** and **Trends** cards do not require [Comments](/comments). If only one of the live or history services is configured on a deployment, only its card appears. @@ -121,4 +123,4 @@ For a published Space, the **Stats** page links straight to the live Space: ## Third-party analytics tags -To run external analytics such as Google Analytics, Plausible, or PostHog with consent controls and reviewed releases, use [Tag Manager](/tag-manager). You can also add a Google Analytics measurement ID or Google Tag Manager container ID under **Customization**; see [Customization](/customization). +To run external analytics such as Google Analytics, Plausible, or PostHog with consent controls and reviewed releases, use [Tag Manager](/tag-manager). You can also add a Google Analytics measurement ID or Google Tag Manager container ID under [**Customization**](https://my.spacefast.com/?to=/:team/:space/customization); see [Customization](/customization). diff --git a/content/(operate)/tag-manager.mdx b/content/(operate)/tag-manager.mdx index e417f74f..de7c51b6 100644 --- a/content/(operate)/tag-manager.mdx +++ b/content/(operate)/tag-manager.mdx @@ -1,8 +1,12 @@ --- title: Tag Manager description: Govern analytics, marketing, monitoring, and custom tags across Spaces and teams with reviewed revisions, consent rules, preview sessions, and rollback +sidebar: + badge: Public Beta --- +Public Beta + Tag Manager manages analytics, marketing, support, monitoring, and custom tags across a Space or a whole team. Changes move through versioned revisions, per-environment releases, and consent rules. You can roll back any environment to an earlier approved revision without republishing your Space. ## Revisions and review workflow @@ -18,7 +22,7 @@ Every tag change starts as a mutable **revision** before it reaches visitors. A | `published` | Released to an environment; immutable | | `abandoned` | Discarded draft or submission | -Create a draft revision from a built-in template, validate it, inspect the diff, submit it, and approve it with [`sf tags revisions`](/cli/reference#sf-tags-revisions): +Create a draft revision from a built-in template, validate it, inspect the diff, submit it, and approve it with [`sf tags revisions`](/cli/reference/tags#sf-tags-revisions): ```bash sf tags revisions create --space my-space --template google-analytics --field measurementId=G-XXXXXXXXXX @@ -28,13 +32,13 @@ sf tags revisions submit tver_123 --space my-space sf tags revisions approve tver_123 --graph-revision 1 --space my-space ``` -Passing `--graph-revision` on approval ensures the revision did not change after you reviewed it (otherwise the API returns `tag_graph_revision_conflict`). Discard an unwanted draft with [`sf tags revisions abandon`](/cli/reference#sf-tags-revisions-abandon-revision). +Passing `--graph-revision` on approval ensures the revision did not change after you reviewed it (otherwise the API returns `tag_graph_revision_conflict`). Discard an unwanted draft with [`sf tags revisions abandon`](/cli/reference/tags#sf-tags-revisions-abandon-revision). When a Space requires tag review (`superpowers.tags.requireReview`), only a team owner or admin who did not submit the revision can approve it. Submitting or approving without meeting that policy fails with [`tag_review_admin_required`](/errors/tag_review_admin_required), [`tag_review_self_approval`](/errors/tag_review_self_approval), or [`tag_review_person_required`](/errors/tag_review_person_required). ## Declarative config with `sf tags apply` -To manage tags from version control, store a `spacefast.tags.json` file containing either a full `spacefast.tag_graph.v1` graph or a `{ "templates": [...] }` list, then apply it with [`sf tags apply`](/cli/reference#sf-tags-apply-file): +To manage tags from version control, store a `spacefast.tags.json` file containing either a full `spacefast.tag_graph.v1` graph or a `{ "templates": [...] }` list, then apply it with [`sf tags apply`](/cli/reference/tags#sf-tags-apply-file): ```json spacefast.tags.json { @@ -75,7 +79,7 @@ Static tags require `necessary` consent and the `page_view` trigger. Releasing a Each Space and team maintains independent release pointers for three environments: `production`, `preview`, and `development`. -Inspect effective tags, release an approved revision, or roll back an environment with [`sf tags releases`](/cli/reference#sf-tags-releases): +Inspect effective tags, release an approved revision, or roll back an environment with [`sf tags releases`](/cli/reference/tags#sf-tags-releases): ```bash sf tags --space my-space --environment production @@ -88,7 +92,7 @@ Pass `--expected-current-revision ` to `set` or `rollback` for compare-and-s ## Built-in templates and triggers -List every available template and trigger preset with [`sf tags templates`](/cli/reference#sf-tags-templates): +List every available template and trigger preset with [`sf tags templates`](/cli/reference/tags#sf-tags-templates): - **Analytics and product**: `google-analytics`, `google-tag-manager`, `posthog`, `plausible`, `amplitude`, `segment` - **Advertising**: `meta-pixel`, `tiktok-pixel`, `linkedin-insight` @@ -121,7 +125,7 @@ The GDPR region check fails closed when visitor geography is unknown. Both Globa ## Preview and debug sessions -Test an unreleased revision on a live page without affecting other visitors by creating a signed preview session with [`sf tags debug`](/cli/reference#sf-tags-debug): +Test an unreleased revision on a live page without affecting other visitors by creating a signed preview session with [`sf tags debug`](/cli/reference/tags#sf-tags-debug): ```bash sf tags debug --space my-space --revision tver_123 --url https://my-space.space.fast diff --git a/content/(operate)/troubleshooting.mdx b/content/(operate)/troubleshooting.mdx index f1935126..51e06226 100644 --- a/content/(operate)/troubleshooting.mdx +++ b/content/(operate)/troubleshooting.mdx @@ -6,7 +6,7 @@ description: Common failures by symptom, with the error code or state each one r Find your symptom below. Each entry names the error code or state Spacefast returns and links to the page with the full fix. :::note[Not sure where to start?] -Open your Space in the dashboard first. Its **Overview** page shows the last publish and its status. From a terminal, run [`sf doctor`](/cli/reference#sf-doctor) (or `sf doctor --space `) to check local CLI state, auth, API reachability, and Space health, or [`sf inspect`](/cli/reference#sf-inspect-target) to check a Space's live version and runtime. Come back here once you have an error code or a symptom from the list below. +Open your Space in the dashboard first. Its [**Overview**](https://my.spacefast.com/?to=/:team/:space) page shows the last publish and its status. From a terminal, run [`sf doctor`](/cli/reference/doctor#sf-doctor) (or `sf doctor --space `) to check local CLI state, auth, API reachability, and Space health, or [`sf inspect`](/cli/reference/inspect#sf-inspect-target) to check a Space's live version and runtime. Come back here once you have an error code or a symptom from the list below. ::: ## Publishing @@ -15,11 +15,11 @@ Open your Space in the dashboard first. Its **Overview** page shows the last pub The files you published match the live version exactly, so no new version was created. The receipt has a null version ID and one info diagnostic, [`noop_publish`](/errors/noop_publish). The publish still succeeded. -If you expected a change, check that you published the built output with [`sf publish`](/cli/reference#sf-publish-dir) and not a stale directory. A file declared without a `sha256` cannot be compared, so a manifest with any missing hash always creates a new version. See [Publishing](/publish). +If you expected a change, check that you published the built output with [`sf publish`](/cli/reference/publish#sf-publish-dir) and not a stale directory. A file declared without a `sha256` cannot be compared, so a manifest with any missing hash always creates a new version. See [Publishing](/publish). ### The publish was rejected -These errors fail the whole publish instead of skipping the file, because skipping it would change what your Space serves. Run [`sf check`](/cli/reference#sf-check-dir) locally before publishing to catch invalid paths or config issues early. +These errors fail the whole publish instead of skipping the file, because skipping it would change what your Space serves. Run [`sf check`](/cli/reference/check#sf-check-dir) locally before publishing to catch invalid paths or config issues early. | Code | What happened | Fix | | --- | --- | --- | @@ -38,7 +38,7 @@ Every limit and its number is on [Limits](/limits). Every code, with whether ret ### The build failed -Read the log before changing anything using [`sf builds list`](/cli/reference#sf-builds-list) and [`sf builds logs`](/cli/reference#sf-builds-logs-build): +Read the log before changing anything using [`sf builds list`](/cli/reference/builds#sf-builds-list) and [`sf builds logs`](/cli/reference/builds#sf-builds-logs-build): ```bash sf builds list --space my-space @@ -67,9 +67,9 @@ Activating a new version requests a purge of the Space's serving hostnames; immu curl -sI https://my-space.space.fast/ | grep -i x-spacefast-version ``` -For a private Space, use [`sf fetch`](/cli/reference#sf-fetch-path) instead of copying browser cookies — `sf fetch / --headers --verify ` runs the signed exchange flow and checks that the response serves the exact version ID you expect. +For a private Space, use [`sf fetch`](/cli/reference/fetch#sf-fetch-path) instead of copying browser cookies — `sf fetch / --headers --verify ` runs the signed exchange flow and checks that the response serves the exact version ID you expect. -If a live release needs to revert immediately, run [`sf rollback`](/cli/reference#sf-rollback-version) with a retained ready version ID, or inspect live traffic with [`sf logs`](/cli/reference#sf-logs-target-kind). Full policy on [Caching](/caching). +If a live release needs to revert immediately, run [`sf rollback`](/cli/reference/rollback#sf-rollback-version) with a retained ready version ID, or inspect live traffic with [`sf logs`](/cli/reference/logs#sf-logs-target-kind). Full policy on [Caching](/caching). ### A route 404s that works locally @@ -77,13 +77,13 @@ Spacefast resolves URLs with three rules that your local dev server may not foll Clean URLs are on by default, so `about.html` answers `/about` and `/about/` redirects to `/about` with a 308. A directory serves its `index.html`. A single-page app gets a fallback shell inferred from a root `200.html`, `_shell.html`, or an `index.html` next to build output, or set `fallback` yourself. The fallback is skipped for around 90 asset extensions, so a missing `.js` returns 404 instead of your HTML shell. -If two files would answer the same URL under these rules, the publish fails with [`publish_path_collision`](/errors/publish_path_collision). Inspect compiled rules locally with [`sf routing inspect`](/cli/reference#sf-routing-inspect) and see [Redirects and rewrites](/redirects). +If two files would answer the same URL under these rules, the publish fails with [`publish_path_collision`](/errors/publish_path_collision). Inspect compiled rules locally with [`sf routing inspect`](/cli/reference/routing#sf-routing-inspect) and see [Redirects and rewrites](/redirects). ## Domains ### The domain is stuck on `pending` -`pending` means assigned and waiting for the records to appear in public DNS. Run [`sf domains diagnostics`](/cli/reference#sf-domains-diagnostics-domain) (or [`sf domains check`](/cli/reference#sf-domains-check-domain)) first: +`pending` means assigned and waiting for the records to appear in public DNS. Run [`sf domains diagnostics`](/cli/reference/domains#sf-domains-diagnostics-domain) (or [`sf domains check`](/cli/reference/domains#sf-domains-check-domain)) first: ```bash sf domains diagnostics example.com --space my-space @@ -95,7 +95,7 @@ sf domains diagnostics example.com --space my-space `failed` means there is no current proof that you control the DNS. Either the records were never observed, or the domain verified once and later stopped verifying. Check whether someone edited the zone. -A failed verification does not take a live Space down right away. Routes and certificates stay in place while the domain verifies again. Run [`sf domains diagnostics`](/cli/reference#sf-domains-diagnostics-domain) to see which records are observed now, and restore the TXT record if it went missing. +A failed verification does not take a live Space down right away. Routes and certificates stay in place while the domain verifies again. Run [`sf domains diagnostics`](/cli/reference/domains#sf-domains-diagnostics-domain) to see which records are observed now, and restore the TXT record if it went missing. ### The certificate is `broken` @@ -113,7 +113,7 @@ Set the one you want as **primary**, which releases the previous holder. A domai ### `sf login` has no browser to open -In a container or over SSH, [`sf login`](/cli/reference#sf-login) does not try to open a browser. It prints the code and the link, then waits. Open the link on any device and approve the request. The CLI continues once you approve. +In a container or over SSH, [`sf login`](/cli/reference/login#sf-login) does not try to open a browser. It prints the code and the link, then waits. Open the link on any device and approve the request. The CLI continues once you approve. For an unattended job, skip device login. Mint an API key and pass it as `SPACEFAST_TOKEN` or `--token`. See [Publish from CI](/ci) and [API keys and tokens](/api-keys). @@ -125,16 +125,16 @@ Add `--yes` to the command that needs it. `SPACEFAST_YES=1` also works, but it c ### The credential stopped working after a week -A credential from [`sf login`](/cli/reference#sf-login) lasts 30 days and expires after 7 days without use, whichever comes first. The API answers `401` with [`credential_expired`](/errors/credential_expired). Run `sf login` again. +A credential from [`sf login`](/cli/reference/login#sf-login) lasts 30 days and expires after 7 days without use, whichever comes first. The API answers `401` with [`credential_expired`](/errors/credential_expired). Run `sf login` again. -[`credential_revoked`](/errors/credential_revoked) means someone revoked it, in the dashboard or with [`sf api-keys revoke`](/cli/reference#sf-api-keys-revoke-key). `credential_retired` means the token uses an old format. Retrying will not fix either one; get a new credential. See [Authentication](/authentication). +[`credential_revoked`](/errors/credential_revoked) means someone revoked it, in the dashboard or with [`sf api-keys revoke`](/cli/reference/api-keys#sf-api-keys-revoke-key). `credential_retired` means the token uses an old format. Retrying will not fix either one; get a new credential. See [Authentication](/authentication). ### An agent in a cloud sandbox cannot reach Spacefast Claude Code on the web and mobile, Codex cloud, and similar sandboxes block unknown hosts by default, including Spacefast. The CLI fails with `network_error` or `upload_transport_error`, and the agent cannot read these docs either. There are three fixes, best first: 1. **Add the Spacefast connector to Claude.** [Open the connector form](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Spacefast&connectorUrl=https%3A%2F%2Fmcp.spacefast.com) and choose **Connect**. Approve it, then enable it for the session. Connector traffic goes through Anthropic rather than the sandbox, so publishing works with no network changes, including from the mobile app. -2. **Push to a connected GitHub repository.** Sandboxes can push to GitHub, and Spacefast builds the push itself. Connect the repository once from the Space's **Builds** page; see [Connect a GitHub repository](/git#connect-a-github-repository). Claude Code on the web pushes a working branch, which builds a preview; merge the pull request to go live. +2. **Push to a connected GitHub repository.** Sandboxes can push to GitHub, and Spacefast builds the push itself. Connect the repository once from the Space's [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) page; see [Connect a GitHub repository](/git#connect-a-github-repository). Claude Code on the web pushes a working branch, which builds a preview; merge the pull request to go live. 3. **Allow the hosts.** Add `spacefast.com`, `*.spacefast.com`, `*.space.fast`, and `*.view.fast` to the environment's allowlist. In Claude Code that is **Network access → Custom → Allowed domains**. Keep **Also include default list of common package managers** checked, or npm and the CLI are blocked too. In Codex cloud, turn on **Agent internet access** and add the domains. Leave HTTP methods unrestricted, since uploads use `PUT` and `POST`. Allowing only `api.spacefast.com` is not enough, because uploads go to managed Space hostnames. New Spaces use `*.space.fast`, and existing Spaces can still use `*.view.fast`. ### An agent gets 403 on one tool diff --git a/content/(reference)/api/authentication.mdx b/content/(reference)/api/authentication.mdx index e09db859..3345f30b 100644 --- a/content/(reference)/api/authentication.mdx +++ b/content/(reference)/api/authentication.mdx @@ -17,11 +17,11 @@ The server decides what a token is from its prefix before any verifier runs. | Prefix | Credential | Created by | | --- | --- | --- | -| `sfa_` | Platform API key | [`POST /v1/api-keys`](/api/reference/account/createapikey), [`sf api-keys`](/cli/reference#sf-api-keys), or the dashboard | +| `sfa_` | Platform API key | [`POST /v1/api-keys`](/api/reference/account/createapikey), [`sf api-keys`](/cli/reference/api-keys#sf-api-keys), or the dashboard | | `sfc_` | Space key for an unclaimed anonymous Space | Returned by an anonymous [`POST /v1/publish`](/api/reference/publishing/createpublish) | | `sfm_` | Space machine credential | `POST /v1/spaces/{spaceId}/machine-credentials` | | signed partner JWT | Customer credential for one external principal | Your verified customer session and active partner issuer | -| no prefix | Signed-in session or OAuth access token | Dashboard sign-in, [`sf login`](/cli/reference#sf-login), or the OAuth token endpoint | +| no prefix | Signed-in session or OAuth access token | Dashboard sign-in, [`sf login`](/cli/reference/login#sf-login), or the OAuth token endpoint | Partner `JWTs` have no Spacefast prefix. The API recognizes their signed `at+jwt` profile. See [Partner API](/platforms/partner-api) for issuer activation and customer scope. @@ -75,9 +75,9 @@ Three rules the code enforces: - **A key can never exceed its creator.** The derived policy must be a subset of the calling credential's policy. A wider request fails with [`policy_exceeds_grantor`](/errors/policy_exceeds_grantor). - **Secrets are immutable.** There is no rotate-in-place. Create a new key, move traffic, then revoke the old one with [`DELETE /v1/api-keys/{apiKeyId}`](/api/reference/account/revokeapikey). That returns `204` and keeps the record for audit. -[`PATCH /v1/api-keys/{apiKeyId}`](/api/reference/account/updateapikey) changes name, scope, permissions, allowlist, expiry, and `connectorAccess`. `scope` and `permissions` must be sent together or both omitted. From the CLI, manage keys with [`sf api-keys`](/cli/reference#sf-api-keys). +[`PATCH /v1/api-keys/{apiKeyId}`](/api/reference/account/updateapikey) changes name, scope, permissions, allowlist, expiry, and `connectorAccess`. `scope` and `permissions` must be sent together or both omitted. From the CLI, manage keys with [`sf api-keys`](/cli/reference/api-keys#sf-api-keys). -In the dashboard, keys live on the team's **Agents** page under **API keys**. The create form asks for **Name**, a **Policy preset**, and an optional **Expires**, then shows the secret once behind **Copy this key now. It won't be shown again.** +In the dashboard, keys live on the team's [**Agents**](https://my.spacefast.com/?to=/:team/api-keys) page under **API keys**. The create form asks for **Name**, a **Policy preset**, and an optional **Expires**, then shows the secret once behind **Copy this key now. It won't be shown again.** The presets and what they grant: @@ -159,7 +159,7 @@ A token that authenticates but lacks a scope set the operation accepts fails wit A headless client starts at [`POST /v1/auth/device`](/api/reference/account/startdeviceauthorization) and shows the user the verification code. It then polls [`POST /v1/auth/device/poll`](/api/reference/account/polldeviceauthorization) until the user approves. Approval and denial run through [`POST /v1/auth/device/approve`](/api/reference/account/approvedeviceauthorization) and [`POST /v1/auth/device/deny`](/api/reference/account/denydeviceauthorization), which need a signed-in browser session. While the user has not decided yet, the poll answers `authorization_pending`. That is a `wait`, not a failure. -Check the active identity at any time with [`GET /v1/me`](/api/reference/account/getme) or [`sf login`](/cli/reference#sf-login). The code lifetime, poll cadence, and credential lifetime are on [Sign in and security](/authentication#log-the-cli-in). +Check the active identity at any time with [`GET /v1/me`](/api/reference/account/getme) or [`sf login`](/cli/reference/login#sf-login). The code lifetime, poll cadence, and credential lifetime are on [Sign in and security](/authentication#log-the-cli-in). ## Which routes refuse which credential diff --git a/content/(reference)/api/connectors.mdx b/content/(reference)/api/connectors.mdx index 8d3fe0b8..f13cd2e4 100644 --- a/content/(reference)/api/connectors.mdx +++ b/content/(reference)/api/connectors.mdx @@ -1,8 +1,12 @@ --- title: Connectors description: Register tool sources, connect accounts, set policy rules, and run connector tools over the API, with the scopes, shapes, and error codes each step uses +sidebar: + badge: Public Beta --- +Public Beta + Connectors are available on Go, Pro, and Enterprise plans. A team on Personal gets `feature_unavailable`. The connectors API lets a team register tool sources, connect accounts, set policy rules, and run tools. Every operation sits under `/v1/connectors` with the `Connectors` tag. For concepts, dashboard workflows, and Space roles, see [Connectors](/connectors). diff --git a/content/(reference)/api/index.mdx b/content/(reference)/api/index.mdx index ae9d2cfc..a5ffa346 100644 --- a/content/(reference)/api/index.mdx +++ b/content/(reference)/api/index.mdx @@ -67,67 +67,75 @@ Every response carries `X-Request-Id`. It matches `requestId` in problem documen ## Publish with curl +Use a shell with `curl`, `jq`, and `uuidgen`. Start in a directory containing the `index.html` you want to publish. Set `SPACEFAST_API_KEY` to an [API key](/api/authentication) that can create and publish Spaces on your team. Run the steps in the same shell. + - -Call `GET /v1/me` to confirm your credential and copy the `teamId` you want to publish under: + + +Define a helper for authenticated requests and list the teams your key can access: ```bash -curl -sS https://api.spacefast.com/v1/me \ - -H "Authorization: Bearer $SPACEFAST_API_KEY" +api=https://api.spacefast.com +request() { + curl --fail-with-body -sS -H "Authorization: Bearer $SPACEFAST_API_KEY" "$@" +} +request "$api/v1/me" | jq -r '.data.teams[] | [.id, .name] | @tsv' ``` -The response returns the authenticated subject and its team memberships. + - -Create a private Space inside that team: +Run this block and paste the ID of your chosen team when prompted. Spacefast assigns a slug and returns the new Space ID: ```bash -curl -sS -X POST https://api.spacefast.com/v1/spaces \ - -H "Authorization: Bearer $SPACEFAST_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{"teamId":"team_example","slug":"my-space","title":"My Space","access":"private"}' +printf 'Team ID: ' +read -r team_id +space_body=$(jq -nc --arg team "$team_id" \ + '{teamId: $team, access: "private", capabilities: ["optional_access"]}') +space_id=$(request "$api/v1/spaces" -H 'Content-Type: application/json' \ + -d "$space_body" | jq -er '.data.space.id') ``` -This answers `201` with `{ data: { space, access, claim? } }`. The Space ID looks like `spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c`. + - -Upload one or more files with an `Idempotency-Key` so retries stay safe: +Send the Space ID in the JSON `payload` part and the file in its own part. Generate an idempotency key once, before the upload: ```bash -curl -sS -X POST "https://api.spacefast.com/v1/publish?async=1" \ - -H "Authorization: Bearer $SPACEFAST_API_KEY" \ - -H "Idempotency-Key: 01J8ZQ7WYX3M4N5P6R7S8T9V0W" \ - -F "spaceId=spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c" \ - -F "files=@index.html" +publish_key=$(uuidgen) +payload=$(jq -nc --arg space "$space_id" '{spaceId: $space}') ``` -The receipt tells you what to do next: +Then run the upload. Re-run only this block on retry so the same `Idempotency-Key` is reused: -```json -{ - "data": { - "space": { "id": "spc_4a7f...", "slug": "my-space", "liveUrl": "https://my-space.space.fast" }, - "version": { "id": "ver_8c1d...", "status": "finalizing", "number": 7, "immutableUrl": null }, - "next": { "action": "poll", "url": "/v1/operations/op_2f6a...", "retryAfter": 1 }, - "operation": { "id": "op_2f6a...", "kind": "version_finalize", "status": "running" } - } -} +```bash +if receipt=$(request "$api/v1/publish?async=1" -H "Idempotency-Key: $publish_key" \ + --form-string "payload=$payload" -F 'index.html=@index.html'); then + printf '%s\n' "$receipt" | jq '.data | {version: .version.id, next}' +else + printf '%s\n' "$receipt" +fi ``` -Omit `async=1` to wait for finalization to finish inside the request and return `next.action: "done"`. + - -Poll the operation URL until `data.status` is terminal: +If `next.action` is `poll`, wait `next.retryAfter` seconds, then request the returned URL. Skip this block when the action is `done`. ```bash -curl -sS https://api.spacefast.com/v1/operations/op_2f6a9d4c1e7b0a3f8d5c2e6b9a4f1d7c \ - -H "Authorization: Bearer $SPACEFAST_API_KEY" +poll_url=$(printf '%s\n' "$receipt" | jq -er '.data.next.url') +request "$api${poll_url#"$api"}" | jq '.data | {status, retryAfter, diagnostics}' ``` -Stop when `data.status` is `succeeded`, `failed`, or `canceled`. Then read `space.liveUrl` and `version.immutableUrl`. +For `queued` or `running`, wait `retryAfter` seconds (or a second if omitted) and repeat the request. For `failed` or `canceled`, stop and read `diagnostics`. Once the operation succeeds, or the publish receipt says `done`, fetch the version: + +```bash +version_id=$(printf '%s\n' "$receipt" | jq -er '.data.version.id') +request "$api/v1/spaces/$space_id/versions/$version_id" | jq '.data | {immutableUrlStatus, immutableUrl}' +``` + +If `immutableUrlStatus` is `pending`, wait and repeat the version request. Once it is `ready`, open `immutableUrl` while signed in to your team. To give someone else access to this version, [create a viewer link](/share#create-a-share-link) targeting `version:`. + diff --git a/content/(reference)/api/long-running-operations.mdx b/content/(reference)/api/long-running-operations.mdx index f3e254ad..0869be3e 100644 --- a/content/(reference)/api/long-running-operations.mdx +++ b/content/(reference)/api/long-running-operations.mdx @@ -72,7 +72,7 @@ integration_release ## Poll one operation -Poll an operation with [`GET /v1/operations/{operationId}`](/api/reference/activity/getoperation) or from the CLI with [`sf operations`](/cli/reference#sf-operations-operation): +Poll an operation with [`GET /v1/operations/{operationId}`](/api/reference/activity/getoperation) or from the CLI with [`sf operations`](/cli/reference/operations#sf-operations-operation): ```bash curl -sS https://api.spacefast.com/v1/operations/op_2f6a9d4c1e7b0a3f8d5c2e6b9a4f1d7c \ @@ -111,7 +111,7 @@ Start at a few hundred milliseconds and back off toward a second. The publish he ## List operations -Query recent operations with [`GET /v1/operations`](/api/reference/activity/listoperations) or [`sf operations`](/cli/reference#sf-operations-operation): +Query recent operations with [`GET /v1/operations`](/api/reference/activity/listoperations) or [`sf operations`](/cli/reference/operations#sf-operations-operation): ```bash curl -sS "https://api.spacefast.com/v1/operations?spaceId=spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c&limit=20" \ diff --git a/content/(reference)/api/versioning.mdx b/content/(reference)/api/versioning.mdx index 69b802de..89fa1a99 100644 --- a/content/(reference)/api/versioning.mdx +++ b/content/(reference)/api/versioning.mdx @@ -39,7 +39,7 @@ Every live response from a deprecated operation includes standard deprecation he `Deprecation` uses RFC 9745's structured-field Date format (`@` plus Unix seconds) while `Sunset` uses RFC 8594's HTTP-date format. -When you test endpoints with the CLI, pass `--include` to [`sf api`](/cli/reference#sf-api-method-path) to print `deprecation`, `sunset`, and `link` headers to stderr alongside other response metadata: +When you test endpoints with the CLI, pass `--include` to [`sf api`](/cli/reference/api#sf-api-method-path) to print `deprecation`, `sunset`, and `link` headers to stderr alongside other response metadata: ```bash sf api GET /v1/spaces/spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c/usage --include diff --git a/content/(reference)/api/webhooks.mdx b/content/(reference)/api/webhooks.mdx index 9424f785..e94e1c89 100644 --- a/content/(reference)/api/webhooks.mdx +++ b/content/(reference)/api/webhooks.mdx @@ -61,7 +61,7 @@ Store `secret` now. Every later read returns `secretPreview` only. Endpoints must be public HTTPS. Non-HTTPS URLs are rejected. Each connection is pinned to the DNS result that was validated, and redirects are refused. -In the dashboard the same thing lives under **Webhooks** in the team sidebar. **Add webhook** asks for an **Endpoint URL**, then **Events** as either **All events** or **Choose events**, then a **Status** toggle. +In the dashboard the same thing lives under [**Webhooks**](https://my.spacefast.com/?to=/:team/webhooks) in the team sidebar. **Add webhook** asks for an **Endpoint URL**, then **Events** as either **All events** or **Choose events**, then a **Status** toggle. ## Event filters diff --git a/content/(reference)/cli/index.mdx b/content/(reference)/cli/index.mdx index 986d05f5..e651add0 100644 --- a/content/(reference)/cli/index.mdx +++ b/content/(reference)/cli/index.mdx @@ -45,8 +45,8 @@ To sign in without a browser, store an API key with `sf login --token `. In - **Re-authenticating**: `sf login` stores the replacement credential before revoking the old one, so a canceled or expired login never leaves you signed out. Signing in clears your stored default team and resets it from the new identity. - **Handoff-link protection**: passing a browser handoff URL as a command argument aborts with `handoff_link_in_argv` (exit 2) so secrets stay out of shell history and process lists. -- **Signing out**: `sf logout` clears your default team, removes the local CLI credential, and revokes CLI-minted tokens against the API URL they were issued for. It never deletes API keys you created yourself; revoke those with [`sf api-keys revoke`](/cli/reference#sf-api-keys-revoke-key). -- **Bare `sf`**: running `sf` with no subcommand runs [`sf status`](/cli/reference#sf-status), showing your identity, default team, and linked Space. +- **Signing out**: `sf logout` clears your default team, removes the local CLI credential, and revokes CLI-minted tokens against the API URL they were issued for. It never deletes API keys you created yourself; revoke those with [`sf api-keys revoke`](/cli/reference/api-keys#sf-api-keys-revoke-key). +- **Bare `sf`**: running `sf` with no subcommand runs [`sf status`](/cli/reference/status#sf-status), showing your identity, default team, and linked Space. ## Global flags @@ -125,7 +125,7 @@ Run `sf help exit-codes` to print this table offline: | `60` | `outcome` | A change may or may not have been applied. Inspect state before repeating | | `130` | `cancelled` | Interrupted with Ctrl-C, or a confirmation prompt was declined | -[`sf doctor`](/cli/reference#sf-doctor) is the one exception: it exits `1` when any check fails without classifying the failure. +[`sf doctor`](/cli/reference/doctor#sf-doctor) is the one exception: it exits `1` when any check fails without classifying the failure. ## Interactive, CI, and agent modes @@ -211,21 +211,21 @@ Singular topic names work as aliases for plural ones (for example, `sf space lis | Command | What it does | | --- | --- | -| [`sf publish`](/cli/reference#sf-publish-dir) | Publish a file, folder, project, or archive to a Space | -| [`sf init`](/cli/reference#sf-init-name) | Scaffold a project and write `spacefast.config.ts` | -| [`sf add`](/cli/reference#sf-add-recipe-directory) | Add a capability or starter recipe to an existing project | -| [`sf check`](/cli/reference#sf-check-dir) | Validate config, routing rules, Worker routes, and secret scanning offline | -| [`sf versions list`](/cli/reference#sf-versions-list) | List versions (`*` marks live, `>` marks deploying) | -| [`sf versions inspect`](/cli/reference#sf-versions-inspect-version) | Inspect one version's status, files, and diagnostics | -| [`sf versions delete`](/cli/reference#sf-versions-delete-version) | Delete a version not held by a channel or branch hostname | -| [`sf promote`](/cli/reference#sf-promote-version) | Point `live` at a ready version (non-destructive; no confirmation prompt) | -| [`sf rollback`](/cli/reference#sf-rollback-version) | Move `live` back to an older retained ready version | -| [`sf redeploy`](/cli/reference#sf-redeploy-build) | Re-run a previous build | -| [`sf channels list`](/cli/reference#sf-channels-list) | List channels and their active versions | -| [`sf channels set`](/cli/reference#sf-channels-set-name) | Switch a channel's promotion policy between `auto` and `manual` | -| [`sf channels history`](/cli/reference#sf-channels-history-name) | Show promotion history for a channel | -| [`sf apply`](/cli/reference#sf-apply) | Re-finalize the live version to apply saved Space settings | -| [`sf migrate`](/cli/reference#sf-migrate-url) | Import and publish an external website from a public URL | +| [`sf publish`](/cli/reference/publish#sf-publish-dir) | Publish a file, folder, project, or archive to a Space | +| [`sf init`](/cli/reference/init#sf-init-name) | Scaffold a project and write `spacefast.config.ts` | +| [`sf add`](/cli/reference/add#sf-add-recipe-directory) | Add a capability or starter recipe to an existing project | +| [`sf check`](/cli/reference/check#sf-check-dir) | Validate config, routing rules, Worker routes, and secret scanning offline | +| [`sf versions list`](/cli/reference/versions#sf-versions-list) | List versions (`*` marks live, `>` marks deploying) | +| [`sf versions inspect`](/cli/reference/versions#sf-versions-inspect-version) | Inspect one version's status, files, and diagnostics | +| [`sf versions delete`](/cli/reference/versions#sf-versions-delete-version) | Delete a version not held by a channel or branch hostname | +| [`sf promote`](/cli/reference/promote#sf-promote-version) | Point `live` at a ready version (non-destructive; no confirmation prompt) | +| [`sf rollback`](/cli/reference/rollback#sf-rollback-version) | Move `live` back to an older retained ready version | +| [`sf redeploy`](/cli/reference/redeploy#sf-redeploy-build) | Re-run a previous build | +| [`sf channels list`](/cli/reference/channels#sf-channels-list) | List channels and their active versions | +| [`sf channels set`](/cli/reference/channels#sf-channels-set-name) | Switch a channel's promotion policy between `auto` and `manual` | +| [`sf channels history`](/cli/reference/channels#sf-channels-history-name) | Show promotion history for a channel | +| [`sf apply`](/cli/reference/apply#sf-apply) | Re-finalize the live version to apply saved Space settings | +| [`sf migrate`](/cli/reference/migrate#sf-migrate-url) | Import and publish an external website from a public URL | `sf publish` never uploads `.env*`, `.git/`, `node_modules/`, or private key files (`*.pem`, `*.key`, `*.p12`, `*.pfx`). On an anonymous publish, `claim.key` stays `[REDACTED]` in `--json` and non-interactive output unless you pass `--show-secret`. `sf rollback` refreshes current rewrites by default; pass `--no-refresh-rewrites` to restore the exact earlier version. @@ -233,45 +233,45 @@ Singular topic names work as aliases for plural ones (for example, `sf space lis | Command | What it does | | --- | --- | -| [`sf spaces list`](/cli/reference#sf-spaces-list) | List Spaces you can reach | -| [`sf spaces create`](/cli/reference#sf-spaces-create) | Create a new Space | -| [`sf spaces inspect`](/cli/reference#sf-spaces-inspect) | Show a Space's configuration, runtime, and live version | -| [`sf spaces check`](/cli/reference#sf-spaces-check-name) | Check slug availability (advisory; max 55 characters) | -| [`sf spaces update`](/cli/reference#sf-spaces-update) | Update a Space's slug or settings | -| [`sf spaces claim`](/cli/reference#sf-spaces-claim) | Claim an anonymous Space into your account | -| [`sf spaces download`](/cli/reference#sf-spaces-download) | Download a version's files locally | -| [`sf spaces duplicate`](/cli/reference#sf-spaces-duplicate) | Copy a Space into a new Space | -| [`sf spaces key rotate`](/cli/reference#sf-spaces-key-rotate) | Rotate an unclaimed Space's `sfc_` key and claim link | -| [`sf spaces archive`](/cli/reference#sf-spaces-archive) | Archive a Space | -| [`sf spaces restore`](/cli/reference#sf-spaces-restore) | Restore a deleted or archived Space | -| [`sf spaces delete`](/cli/reference#sf-spaces-delete) | Delete a Space | -| [`sf spaces transfer`](/cli/reference#sf-spaces-transfer-team) | Start transferring a Space to another team | -| [`sf transfers list`](/cli/reference#sf-transfers-list) | List incoming and outgoing Space transfers (owners and admins) | -| [`sf transfers accept`](/cli/reference#sf-transfers-accept-transfer) | Accept a pending transfer into the target team | -| [`sf link`](/cli/reference#sf-link) | Bind the current directory to a Space via `.spacefast/space.json` | -| [`sf unlink`](/cli/reference#sf-unlink) | Remove the local Space link without touching the server | -| [`sf open`](/cli/reference#sf-open-target) | Open a Space in your browser with a temporary author handoff | +| [`sf spaces list`](/cli/reference/spaces#sf-spaces-list) | List Spaces you can reach | +| [`sf spaces create`](/cli/reference/spaces#sf-spaces-create) | Create a new Space | +| [`sf spaces inspect`](/cli/reference/spaces#sf-spaces-inspect) | Show a Space's configuration, runtime, and live version | +| [`sf spaces check`](/cli/reference/spaces#sf-spaces-check-name) | Check slug availability (advisory; max 55 characters) | +| [`sf spaces update`](/cli/reference/spaces#sf-spaces-update) | Update a Space's slug or settings | +| [`sf spaces claim`](/cli/reference/spaces#sf-spaces-claim) | Claim an anonymous Space into your account | +| [`sf spaces download`](/cli/reference/spaces#sf-spaces-download) | Download a version's files locally | +| [`sf spaces duplicate`](/cli/reference/spaces#sf-spaces-duplicate) | Copy a Space into a new Space | +| [`sf spaces key rotate`](/cli/reference/spaces#sf-spaces-key-rotate) | Rotate an unclaimed Space's `sfc_` key and claim link | +| [`sf spaces archive`](/cli/reference/spaces#sf-spaces-archive) | Archive a Space | +| [`sf spaces restore`](/cli/reference/spaces#sf-spaces-restore) | Restore a deleted or archived Space | +| [`sf spaces delete`](/cli/reference/spaces#sf-spaces-delete) | Delete a Space | +| [`sf spaces transfer`](/cli/reference/spaces#sf-spaces-transfer-team) | Start transferring a Space to another team | +| [`sf transfers list`](/cli/reference/transfers#sf-transfers-list) | List incoming and outgoing Space transfers (owners and admins) | +| [`sf transfers accept`](/cli/reference/transfers#sf-transfers-accept-transfer) | Accept a pending transfer into the target team | +| [`sf link`](/cli/reference/link#sf-link) | Bind the current directory to a Space via `.spacefast/space.json` | +| [`sf unlink`](/cli/reference/unlink#sf-unlink) | Remove the local Space link without touching the server | +| [`sf open`](/cli/reference/open#sf-open-target) | Open a Space in your browser with a temporary author handoff | ### Domains | Command | What it does | | --- | --- | -| [`sf domains list`](/cli/reference#sf-domains-list) | List domains attached to a Space | -| [`sf domains add`](/cli/reference#sf-domains-add-hostname) | Create, attach, and verify a custom domain | -| [`sf domains check`](/cli/reference#sf-domains-check-domain) | Re-check DNS and TLS verification | -| [`sf domains diagnostics`](/cli/reference#sf-domains-diagnostics-domain) | Inspect DNS, TXT proof, and certificate status | -| [`sf domains update`](/cli/reference#sf-domains-update-domain) | Change a domain's role or primary setting | -| [`sf domains remove`](/cli/reference#sf-domains-remove-domain) | Unassign a domain from a Space without deleting it from the team | -| [`sf domains delete`](/cli/reference#sf-domains-delete-domain) | Delete an unassigned domain from the team inventory | -| [`sf domains search`](/cli/reference#sf-domains-search-query) | Research available domain names and prices (never purchases) | -| [`sf domains contacts`](/cli/reference#sf-domains-contacts) | Save and list personal registrant contacts | -| [`sf domains registration`](/cli/reference#sf-domains-registration-domain) | Inspect, purchase, renew, or transfer domain registrations | -| [`sf domains dns`](/cli/reference#sf-domains-dns) | Manage DNS records on Spacefast DNS | -| [`sf domains nameservers`](/cli/reference#sf-domains-nameservers-domain) | Inspect or update nameservers | -| [`sf domains connect`](/cli/reference#sf-domains-connect) | Manage Domain Connect authorizations and templates | -| [`sf routing inspect`](/cli/reference#sf-routing-inspect) | Validate local redirects, rewrites, and headers | -| [`sf routing compute`](/cli/reference#sf-routing-compute) | Preview compiled routing rules for a Space | -| [`sf rules`](/cli/reference#sf-rules) | List, add, remove, pause, resume, test, and validate traffic rules | +| [`sf domains list`](/cli/reference/domains#sf-domains-list) | List domains attached to a Space | +| [`sf domains add`](/cli/reference/domains#sf-domains-add-hostname) | Create, attach, and verify a custom domain | +| [`sf domains check`](/cli/reference/domains#sf-domains-check-domain) | Re-check DNS and TLS verification | +| [`sf domains diagnostics`](/cli/reference/domains#sf-domains-diagnostics-domain) | Inspect DNS, TXT proof, and certificate status | +| [`sf domains update`](/cli/reference/domains#sf-domains-update-domain) | Change a domain's role or primary setting | +| [`sf domains remove`](/cli/reference/domains#sf-domains-remove-domain) | Unassign a domain from a Space without deleting it from the team | +| [`sf domains delete`](/cli/reference/domains#sf-domains-delete-domain) | Delete an unassigned domain from the team inventory | +| [`sf domains search`](/cli/reference/domains#sf-domains-search-query) | Research available domain names and prices (never purchases) | +| [`sf domains contacts`](/cli/reference/domains#sf-domains-contacts) | Save and list personal registrant contacts | +| [`sf domains registration`](/cli/reference/domains#sf-domains-registration-domain) | Inspect, purchase, renew, or transfer domain registrations | +| [`sf domains dns`](/cli/reference/domains#sf-domains-dns) | Manage DNS records on Spacefast DNS | +| [`sf domains nameservers`](/cli/reference/domains#sf-domains-nameservers-domain) | Inspect or update nameservers | +| [`sf domains connect`](/cli/reference/domains#sf-domains-connect) | Manage Domain Connect authorizations and templates | +| [`sf routing inspect`](/cli/reference/routing#sf-routing-inspect) | Validate local redirects, rewrites, and headers | +| [`sf routing compute`](/cli/reference/routing#sf-routing-compute) | Preview compiled routing rules for a Space | +| [`sf rules`](/cli/reference/rules#sf-rules) | List, add, remove, pause, resume, test, and validate traffic rules | `sf domains contacts add` and `sf domains registration purchase` require a personal sign-in; team API keys cannot save registrant contacts or buy domains. `sf domains remove` unassigns the domain from the Space while keeping it in your team's domain inventory. Edit rules declared in `spacefast.config.ts` in the file and publish; `sf rules remove` removes only rules stored in Space settings. @@ -279,27 +279,27 @@ Singular topic names work as aliases for plural ones (for example, `sf space lis | Command | What it does | | --- | --- | -| [`sf build`](/cli/reference#sf-build-dir) | Build locally and pack `.spacefast/build-output.tgz` (`--json` streams by default) | -| [`sf dev`](/cli/reference#sf-dev) | Run local development for the project in the current directory | -| [`sf builds list`](/cli/reference#sf-builds-list) | List remote builds for a Space | -| [`sf builds inspect`](/cli/reference#sf-builds-inspect-build) | Inspect one remote build | -| [`sf builds logs`](/cli/reference#sf-builds-logs-build) | Read remote build logs | -| [`sf builds cancel`](/cli/reference#sf-builds-cancel-build) | Cancel an in-progress build | -| [`sf builds retry`](/cli/reference#sf-builds-retry-build) | Re-run a terminal build with the same immutable input | -| [`sf builds detect`](/cli/reference#sf-builds-detect-dir) | Inspect detected framework and build candidates | -| [`sf git`](/cli/reference#sf-git) | Connect, update, sync, and build Git repositories | -| [`sf source list`](/cli/reference#sf-source-list) | Browse, search, diff, branch, merge, commit, and tag managed source | -| [`sf source availability`](/cli/reference#sf-source-availability) | Control public main-branch remixing for a Space's source | -| [`sf functions`](/cli/reference#sf-functions) | Inspect Workers routes and runtime configuration | -| [`sf runtime status`](/cli/reference#sf-runtime-status) | Show live version runtime metadata (Worker or capsule) | -| [`sf crons list`](/cli/reference#sf-crons-list) | List scheduled jobs declared by the live version | -| [`sf crons run`](/cli/reference#sf-crons-run-target) | Trigger a declared cron path on demand | -| [`sf app`](/cli/reference#sf-app) | Inspect app environment and run remote WP-CLI (`sf app wp`) | -| [`sf logs`](/cli/reference#sf-logs-target-kind) | Read `access`, `edge`, and `runtime` logs (`--follow` polls) | -| [`sf analytics`](/cli/reference#sf-analytics) | Read live edge traffic stats (`48h`, `7d`, or `30d`) | -| [`sf tags`](/cli/reference#sf-tags) | Manage Spacefast Tag Manager revisions, releases, and debug sessions | -| [`sf pages`](/cli/reference#sf-pages) | Pull and validate Spacefast-authored `_layout.html` and `_pages/*.html` | -| [`sf design generate`](/cli/reference#sf-design-generate) | Extract `theme.json` and `_layout.html` from a `DESIGN.md` file | +| [`sf build`](/cli/reference/build#sf-build-dir) | Build locally and pack `.spacefast/build-output.tgz` (`--json` streams by default) | +| [`sf dev`](/cli/reference/dev#sf-dev) | Run local development for the project in the current directory | +| [`sf builds list`](/cli/reference/builds#sf-builds-list) | List remote builds for a Space | +| [`sf builds inspect`](/cli/reference/builds#sf-builds-inspect-build) | Inspect one remote build | +| [`sf builds logs`](/cli/reference/builds#sf-builds-logs-build) | Read remote build logs | +| [`sf builds cancel`](/cli/reference/builds#sf-builds-cancel-build) | Cancel an in-progress build | +| [`sf builds retry`](/cli/reference/builds#sf-builds-retry-build) | Re-run a terminal build with the same immutable input | +| [`sf builds detect`](/cli/reference/builds#sf-builds-detect-dir) | Inspect detected framework and build candidates | +| [`sf git`](/cli/reference/git#sf-git) | Connect, update, sync, and build Git repositories | +| [`sf source list`](/cli/reference/source#sf-source-list) | Browse, search, diff, branch, merge, commit, and tag managed source | +| [`sf source availability`](/cli/reference/source#sf-source-availability) | Control public main-branch remixing for a Space's source | +| [`sf functions`](/cli/reference/functions#sf-functions) | Inspect Workers routes and runtime configuration | +| [`sf runtime status`](/cli/reference/runtime#sf-runtime-status) | Show live version runtime metadata (Worker or capsule) | +| [`sf crons list`](/cli/reference/crons#sf-crons-list) | List scheduled jobs declared by the live version | +| [`sf crons run`](/cli/reference/crons#sf-crons-run-target) | Trigger a declared cron path on demand | +| [`sf app`](/cli/reference/app#sf-app) | Inspect app environment and run remote WP-CLI (`sf app wp`) | +| [`sf logs`](/cli/reference/logs#sf-logs-target-kind) | Read `access`, `edge`, and `runtime` logs (`--follow` polls) | +| [`sf analytics`](/cli/reference/analytics#sf-analytics) | Read live edge traffic stats (`48h`, `7d`, or `30d`) | +| [`sf tags`](/cli/reference/tags#sf-tags) | Manage Spacefast Tag Manager revisions, releases, and debug sessions | +| [`sf pages`](/cli/reference/pages#sf-pages) | Pull and validate Spacefast-authored `_layout.html` and `_pages/*.html` | +| [`sf design generate`](/cli/reference/design#sf-design-generate) | Extract `theme.json` and `_layout.html` from a `DESIGN.md` file | `sf crons run` cannot send the platform's `x-spacefast-cron` header, so handlers that require authentication on manual runs need a separate header or shared secret. `sf logs --follow` polls rather than opening a persistent socket and remembers up to 5,000 seen keys. Remote `sf app wp` reports exit status and duration without returning command stdout. @@ -307,18 +307,19 @@ Singular topic names work as aliases for plural ones (for example, `sf space lis | Command | What it does | | --- | --- | -| [`sf db`](/cli/reference#sf-db-target) | Inspect a Space's database tables, columns, and migration state | -| [`sf db rows`](/cli/reference#sf-db-rows) | List, add, update, and delete rows in declared tables | -| [`sf db dump`](/cli/reference#sf-db-dump-target) | Dump table rows | -| [`sf db export`](/cli/reference#sf-db-export-target) | Export declared tables to a versioned JSON backup | -| [`sf db migrate`](/cli/reference#sf-db-migrate-source) | Apply schema migrations | -| [`sf db console`](/cli/reference#sf-db-console-target) | Open a single-use browser SQL console (write access required) | -| [`sf storage`](/cli/reference#sf-storage-target) | List runtime storage objects | -| [`sf storage put`](/cli/reference#sf-storage-put-file) | Upload a file to runtime object storage | -| [`sf storage download`](/cli/reference#sf-storage-download-object) | Download a stored object | -| [`sf storage delete`](/cli/reference#sf-storage-delete-object) | Delete a stored object as the Space owner | -| [`sf env`](/cli/reference#sf-env) | List, set, import, pull, and remove Space environment variables | -| [`sf connectors`](/cli/reference#sf-connectors) | Register tool sources, connect accounts, set policies, bind roles, and run tools | +| [`sf db tables`](/cli/reference/db#sf-db-tables) | List tables on a provisioned Space | +| [`sf db`](/cli/reference/db#sf-db-target) | Inspect the declared schema and migration state of a legacy Zero Space | +| [`sf db rows`](/cli/reference/db#sf-db-rows) | Read rows and edit them in writable tables | +| [`sf db dump`](/cli/reference/db#sf-db-dump-target) | Dump table rows | +| [`sf db export`](/cli/reference/db#sf-db-export-target) | Export declared tables to a versioned JSON backup | +| [`sf db migrate`](/cli/reference/db#sf-db-migrate-source) | Apply schema migrations | +| [`sf db console`](/cli/reference/db#sf-db-console-target) | Open a single-use browser SQL console (write access required) | +| [`sf storage`](/cli/reference/storage#sf-storage-target) | List runtime storage objects | +| [`sf storage put`](/cli/reference/storage#sf-storage-put-file) | Upload a file to runtime object storage | +| [`sf storage download`](/cli/reference/storage#sf-storage-download-object) | Download a stored object | +| [`sf storage delete`](/cli/reference/storage#sf-storage-delete-object) | Delete a stored object as the Space owner | +| [`sf env`](/cli/reference/env#sf-env) | List, set, import, pull, and remove Space environment variables | +| [`sf connectors`](/cli/reference/connectors#sf-connectors) | Register tool sources, connect accounts, set policies, bind roles, and run tools | New variables created with `sf env set` default to write-only secrets; pass `--value-from-stdin` to keep secrets out of shell history, or `--no-secret` for readable values. `sf env pull` skips write-only secrets and writes mode `0600`. `sf env` names starting with `SPACEFAST_` are reserved. @@ -326,20 +327,20 @@ New variables created with `sf env set` default to write-only secrets; pass `--v | Command | What it does | | --- | --- | -| [`sf share`](/cli/reference#sf-share) | Manage Grants on a Space | -| [`sf share list`](/cli/reference#sf-share-list) | List every active Grant across audiences | -| [`sf share check`](/cli/reference#sf-share-check) | Explain which Grants match one route, audience, and target | -| [`sf share grant`](/cli/reference#sf-share-grant) | Add a `public`, `team`, or `parent_team` Grant | -| [`sf share revoke`](/cli/reference#sf-share-revoke-grant) | Revoke a managed Grant by ID | -| [`sf share link`](/cli/reference#sf-share-link) | Create, list, copy, update, and revoke share links | -| [`sf share password`](/cli/reference#sf-share-password) | Create, list, rotate, and revoke password Grants (Argon2id) | -| [`sf share people`](/cli/reference#sf-share-people) | Invite, list, update, resend, and remove named People | -| [`sf share token`](/cli/reference#sf-share-token) | Create, list, rotate, and revoke `sfm_` machine credentials | -| [`sf share request`](/cli/reference#sf-share-request) | List, approve, and deny visitor access requests | -| [`sf share identity`](/cli/reference#sf-share-identity) | Manage team OIDC or signer connections and external subject Grants | -| [`sf access sessions revoke`](/cli/reference#sf-access-sessions-revoke) | Revoke every active visitor session on a Space | -| [`sf comments`](/cli/reference#sf-comments) | List, inspect, create, reply, react, resolve, export, and configure Comments | -| [`sf oauth-apps`](/cli/reference#sf-oauth-apps) | Register and manage Sign in with Spacefast OAuth apps | +| [`sf share`](/cli/reference/share#sf-share) | Manage Grants on a Space | +| [`sf share list`](/cli/reference/share#sf-share-list) | List every active Grant across audiences | +| [`sf share check`](/cli/reference/share#sf-share-check) | Explain which Grants match one route, audience, and target | +| [`sf share grant`](/cli/reference/share#sf-share-grant) | Add a `public`, `team`, or `parent_team` Grant | +| [`sf share revoke`](/cli/reference/share#sf-share-revoke-grant) | Revoke a managed Grant by ID | +| [`sf share link`](/cli/reference/share#sf-share-link) | Create, list, copy, update, and revoke share links | +| [`sf share password`](/cli/reference/share#sf-share-password) | Create, list, rotate, and revoke password Grants (Argon2id) | +| [`sf share people`](/cli/reference/share#sf-share-people) | Invite, list, update, resend, and remove named People | +| [`sf share token`](/cli/reference/share#sf-share-token) | Create, list, rotate, and revoke `sfm_` machine credentials | +| [`sf share request`](/cli/reference/share#sf-share-request) | List, approve, and deny visitor access requests | +| [`sf share identity`](/cli/reference/share#sf-share-identity) | Manage team OIDC or signer connections and external subject Grants | +| [`sf access sessions revoke`](/cli/reference/access#sf-access-sessions-revoke) | Revoke every active visitor session on a Space | +| [`sf comments`](/cli/reference/comments#sf-comments) | List, inspect, create, reply, react, resolve, export, and configure Comments | +| [`sf oauth-apps`](/cli/reference/oauth-apps#sf-oauth-apps) | Register and manage Sign in with Spacefast OAuth apps | Grants are additive, so a Space with no Grants is private. Edit Grants declared in `spacefast.config.ts` in the file and publish instead of running `sf share revoke`. The API rejects unsupported IP/CIDR `--network` rules on writes. @@ -347,19 +348,19 @@ Grants are additive, so a Space with no Grants is private. Edit Grants declared | Command | What it does | | --- | --- | -| [`sf teams`](/cli/reference#sf-teams) | List, create, join, and manage teams | -| [`sf teams switch`](/cli/reference#sf-teams-switch-team) | Set the default team for future CLI commands | -| [`sf teams defaults`](/cli/reference#sf-teams-defaults-access) | Read or set default access for new Spaces | -| [`sf teams members`](/cli/reference#sf-teams-members) | List team members and send invitations | -| [`sf teams invitations`](/cli/reference#sf-teams-invitations) | List pending team invitations | -| [`sf teams subteams`](/cli/reference#sf-teams-subteams) | Manage subteams and subteam membership | -| [`sf teams domains`](/cli/reference#sf-teams-domains) | Manage auto-enroll email domains | -| [`sf api-keys`](/cli/reference#sf-api-keys) | Create, list, update, and revoke team API keys | -| [`sf deploy-tokens`](/cli/reference#sf-deploy-tokens) | Create, list, update, rotate, and revoke deploy tokens | -| [`sf usage`](/cli/reference#sf-usage) | Inspect team and Space metered usage | -| [`sf budget`](/cli/reference#sf-budget) | List, set, and clear monthly usage budgets | -| [`sf billing card`](/cli/reference#sf-billing-card) | Inspect the team's saved payment card | -| [`sf purchases inspect`](/cli/reference#sf-purchases-inspect-id) | Inspect, confirm, or cancel a team purchase | +| [`sf teams`](/cli/reference/teams#sf-teams) | List, create, join, and manage teams | +| [`sf teams switch`](/cli/reference/teams#sf-teams-switch-team) | Set the default team for future CLI commands | +| [`sf teams defaults`](/cli/reference/teams#sf-teams-defaults-access) | Read or set default access for new Spaces | +| [`sf teams members`](/cli/reference/teams#sf-teams-members) | List team members and send invitations | +| [`sf teams invitations`](/cli/reference/teams#sf-teams-invitations) | List pending team invitations | +| [`sf teams subteams`](/cli/reference/teams#sf-teams-subteams) | Manage subteams and subteam membership | +| [`sf teams domains`](/cli/reference/teams#sf-teams-domains) | Manage auto-enroll email domains | +| [`sf api-keys`](/cli/reference/api-keys#sf-api-keys) | Create, list, update, and revoke team API keys | +| [`sf deploy-tokens`](/cli/reference/deploy-tokens#sf-deploy-tokens) | Create, list, update, rotate, and revoke deploy tokens | +| [`sf usage`](/cli/reference/usage#sf-usage) | Inspect team and Space metered usage | +| [`sf budget`](/cli/reference/budget#sf-budget) | List, set, and clear monthly usage budgets | +| [`sf billing card`](/cli/reference/billing#sf-billing-card) | Inspect the team's saved payment card | +| [`sf purchases inspect`](/cli/reference/purchases#sf-purchases-inspect-id) | Inspect, confirm, or cancel a team purchase | `sf teams accept`, `sf teams members remove`, `sf teams invitations resend`, and `sf teams invitations cancel` require a dashboard browser session and return `403 authorization_level_not_allowed` with CLI credentials. `sf api-keys create` prints the one-time secret in human output and masks it under `--json`, so run without `--json` when copying a new key. @@ -367,15 +368,15 @@ Grants are additive, so a Space with no Grants is private. Edit Grants declared | Command | What it does | | --- | --- | -| [`sf setup`](/cli/reference#sf-setup) | Interactive onboarding for CLI login, agent tooling, and first publish | -| [`sf setup agent`](/cli/reference#sf-setup-agent) | Detect supported coding agents and configure Spacefast skills and MCP | -| [`sf mcp`](/cli/reference#sf-mcp) | Run the local On-Device MCP server over stdio | -| [`sf mcp install`](/cli/reference#sf-mcp-install) | Write MCP config for detected or selected coding agents | -| [`sf mcp proxy`](/cli/reference#sf-mcp-proxy) | Proxy hosted Spacefast MCP over stdio using your CLI login | -| [`sf skills`](/cli/reference#sf-skills) | Install, check, or remove the bundled `spacefast` agent skill | -| [`sf agents init`](/cli/reference#sf-agents-init-directory) | Insert or refresh the managed Spacefast block in `AGENTS.md` | -| [`sf plugins`](/cli/reference#sf-plugins) | Install the Spacefast plugin for coding agents that support plugins | -| [`sf continue`](/cli/reference#sf-continue) | Exchange a saved `sfc_` Space key for a durable API key after claim approval | +| [`sf setup`](/cli/reference/setup#sf-setup) | Interactive onboarding for CLI login, agent tooling, and first publish | +| [`sf setup agent`](/cli/reference/setup#sf-setup-agent) | Detect supported coding agents and configure Spacefast skills and MCP | +| [`sf mcp`](/cli/reference/mcp#sf-mcp) | Run the local On-Device MCP server over stdio | +| [`sf mcp install`](/cli/reference/mcp#sf-mcp-install) | Write MCP config for detected or selected coding agents | +| [`sf mcp proxy`](/cli/reference/mcp#sf-mcp-proxy) | Proxy hosted Spacefast MCP over stdio using your CLI login | +| [`sf skills`](/cli/reference/skills#sf-skills) | Install, check, or remove the bundled `spacefast` agent skill | +| [`sf agents init`](/cli/reference/agents#sf-agents-init-directory) | Insert or refresh the managed Spacefast block in `AGENTS.md` | +| [`sf plugins`](/cli/reference/plugins#sf-plugins) | Install the Spacefast plugin for coding agents that support plugins | +| [`sf continue`](/cli/reference/continue#sf-continue) | Exchange a saved `sfc_` Space key for a durable API key after claim approval | `sf mcp proxy` caps individual responses at 32 MiB and times out requests after 55 seconds. `sf mcp` restricts publish paths to the workspace root and refuses absolute paths, escaping paths, and symlinks. @@ -383,25 +384,25 @@ Grants are additive, so a Space with no Grants is private. Edit Grants declared | Command | What it does | | --- | --- | -| [`sf login`](/cli/reference#sf-login) | Sign in through the browser or store an API key | -| [`sf logout`](/cli/reference#sf-logout) | Remove local login and revoke CLI-minted credentials | -| [`sf whoami`](/cli/reference#sf-whoami) | Print the authenticated account and teams | -| [`sf auth`](/cli/reference#sf-auth) | Set or clear the local dev guest identity (`sf auth as`, `sf auth reset`) | -| [`sf status`](/cli/reference#sf-status) | Show active auth, default team, and linked Space | -| [`sf switch`](/cli/reference#sf-switch-team) | Switch default team | -| [`sf profiles`](/cli/reference#sf-profiles) | Manage named API base URL and credential profiles | -| [`sf inspect`](/cli/reference#sf-inspect-target) | Inspect any Space by slug, ID, or URL | -| [`sf fetch`](/cli/reference#sf-fetch-path) | Fetch a private Space path using the browser cookie exchange flow | -| [`sf resolve`](/cli/reference#sf-resolve-ref) | Resolve a Space, domain, or URL reference | -| [`sf operations`](/cli/reference#sf-operations-operation) | List or inspect asynchronous operations (no `--follow`; re-run to poll) | -| [`sf activity`](/cli/reference#sf-activity) | Read the audit trail for a team or Space | -| [`sf api`](/cli/reference#sf-api-method-path) | Send authenticated requests to `/v1/` endpoints with optional `--paginate` | -| [`sf search`](/cli/reference#sf-search) | Find the CLI command for a task offline | -| [`sf docs`](/cli/reference#sf-docs-query) | Search bundled Spacefast documentation offline | -| [`sf map`](/cli/reference#sf-map) | Output every CLI command, argument, and option as text or JSON | -| [`sf doctor`](/cli/reference#sf-doctor) | Check local state, project config, auth, API reachability, and Space health | -| [`sf feedback`](/cli/reference#sf-feedback) | Send, list, or inspect feedback reports | -| [`sf autocomplete`](/cli/reference#sf-autocomplete-shell) | Configure shell tab completion | +| [`sf login`](/cli/reference/login#sf-login) | Sign in through the browser or store an API key | +| [`sf logout`](/cli/reference/logout#sf-logout) | Remove local login and revoke CLI-minted credentials | +| [`sf whoami`](/cli/reference/whoami#sf-whoami) | Print the authenticated account and teams | +| [`sf auth`](/cli/reference/auth#sf-auth) | Set or clear the local dev guest identity (`sf auth as`, `sf auth reset`) | +| [`sf status`](/cli/reference/status#sf-status) | Show active auth, default team, and linked Space | +| [`sf switch`](/cli/reference/switch#sf-switch-team) | Switch default team | +| [`sf profiles`](/cli/reference/profiles#sf-profiles) | Manage named API base URL and credential profiles | +| [`sf inspect`](/cli/reference/inspect#sf-inspect-target) | Inspect any Space by slug, ID, or URL | +| [`sf fetch`](/cli/reference/fetch#sf-fetch-path) | Fetch a private Space path using the browser cookie exchange flow | +| [`sf resolve`](/cli/reference/resolve#sf-resolve-ref) | Resolve a Space, domain, or URL reference | +| [`sf operations`](/cli/reference/operations#sf-operations-operation) | List or inspect asynchronous operations (no `--follow`; re-run to poll) | +| [`sf activity`](/cli/reference/activity#sf-activity) | Read the audit trail for a team or Space | +| [`sf api`](/cli/reference/api#sf-api-method-path) | Send authenticated requests to `/v1/` endpoints with optional `--paginate` | +| [`sf search`](/cli/reference/search#sf-search) | Find the CLI command for a task offline | +| [`sf docs`](/cli/reference/docs#sf-docs-query) | Search bundled Spacefast documentation offline | +| [`sf map`](/cli/reference/map#sf-map) | Output every CLI command, argument, and option as text or JSON | +| [`sf doctor`](/cli/reference/doctor#sf-doctor) | Check local state, project config, auth, API reachability, and Space health | +| [`sf feedback`](/cli/reference/feedback#sf-feedback) | Send, list, or inspect feedback reports | +| [`sf autocomplete`](/cli/reference/autocomplete#sf-autocomplete-shell) | Configure shell tab completion | `sf api` calls `/v1/` paths only, prints the raw API body verbatim (or `{"data":null}` on `204`, `205`, and `304`), and prints selected response headers to stderr with `--include`. `--paginate` works only on `GET` operations declared as cursor-paginated lists in the bundled OpenAPI spec. diff --git a/content/(reference)/cli/meta.ts b/content/(reference)/cli/meta.ts index bc921d1c..bf813b65 100644 --- a/content/(reference)/cli/meta.ts +++ b/content/(reference)/cli/meta.ts @@ -1,3 +1,3 @@ import { defineMeta } from "blume"; -export default defineMeta({ title: "CLI", collapsed: false, pages: ["index", "reference"] }); +export default defineMeta({ title: "CLI", collapsed: false, pages: ["index", "reference", "commands"] }); diff --git a/content/(reference)/config-file.mdx b/content/(reference)/config-file.mdx index 493fffcd..8dcc90b3 100644 --- a/content/(reference)/config-file.mdx +++ b/content/(reference)/config-file.mdx @@ -49,7 +49,7 @@ Keep one serving config file in a project: You can declare app definitions (collections, tables, actions, pages, routes, auth, plugins, admin, and locales) either inline under the `app` key in `spacefast.config.ts` or in a standalone `spacepress.config.ts` beside `spacefast.config.ts`. - Putting serving settings in `spacefast.config.ts` and app definitions in `spacepress.config.ts` keeps both files working side by side. -- Define your app in either `spacepress.config.ts` or the inline `app` block of `spacefast.config.ts`, not both; [`sf publish`](/cli/reference#sf-publish-dir) and [`sf check`](/cli/reference#sf-check-dir) refuse a project that declares both at once. +- Define your app in either `spacepress.config.ts` or the inline `app` block of `spacefast.config.ts`, not both; [`sf publish`](/cli/reference/publish#sf-publish-dir) and [`sf check`](/cli/reference/check#sf-check-dir) refuse a project that declares both at once. ### JSONC fallback (`sf.jsonc`) @@ -214,7 +214,7 @@ When you combine them with `spacefast.config.ts` or `sf.jsonc`: - Redirect and rewrite rules merge in this order: `_redirects` first, then config `redirects`, then config `rewrites`. First match wins. A config rule shadowed by an unconditional `_redirects` line reports a `redirect_shadowed_by_file` warning. - Header rules merge with `_headers` winning over config `headers` when both set the same header name. -For new projects, declare `redirects`, `rewrites`, and `headers` in `spacefast.config.ts` so all Space configuration lives in one typed file. Validate changes offline with [`sf check`](/cli/reference#sf-check-dir) (invalid configs return [`config_invalid`](/errors/config_invalid)). See [Redirects and rewrites](/redirects) and [Headers](/headers). +For new projects, declare `redirects`, `rewrites`, and `headers` in `spacefast.config.ts` so all Space configuration lives in one typed file. Validate changes offline with [`sf check`](/cli/reference/check#sf-check-dir) (invalid configs return [`config_invalid`](/errors/config_invalid)). See [Redirects and rewrites](/redirects) and [Headers](/headers). ## Limits diff --git a/content/(reference)/glossary.mdx b/content/(reference)/glossary.mdx index a7d45e28..3aa5ee1a 100644 --- a/content/(reference)/glossary.mdx +++ b/content/(reference)/glossary.mdx @@ -35,7 +35,7 @@ A structured content type declared under `app.collections` in `spacefast.config. ## Drop -The drag-and-drop publish flow at [drop.fast](https://drop.fast): drag a folder, a `.zip`, or a single `index.html` into the browser to publish with no install and no account required. See [Publishing](/publish#publish). +The drag-and-drop publish flow at [drop.fast](https://drop.fast): drag a folder, a `.zip`, or a single `index.html` into the browser to publish with no install and no account required. See [Publishing](/publish#drop). ## Functions diff --git a/content/(routing)/caching.mdx b/content/(routing)/caching.mdx index 2affb3b5..91e9e046 100644 --- a/content/(routing)/caching.mdx +++ b/content/(routing)/caching.mdx @@ -56,7 +56,7 @@ export default defineConfig({ }); ``` -You can also add cache-bypass rules without publishing via [`sf rules add`](/cli/reference#sf-rules-add) (`--kind cache-bypass`) or the dashboard's **Traffic Rules** page. See [Traffic Rules](/redirects#traffic-rules) for the full match grammar and limits. +You can also add cache-bypass rules without publishing via [`sf rules add`](/cli/reference/rules#sf-rules-add) (`--kind cache-bypass`) or the dashboard's [**Traffic Rules**](https://my.spacefast.com/?to=/:team/:space/rules) page. See [Traffic Rules](/redirects#traffic-rules) for the full match grammar and limits. ### Override `Cache-Control` for browsers @@ -93,7 +93,7 @@ The non-`GET` rule has no exceptions. Because the shared cache keys on host, pat Previews are private by default. An authenticated preview response uses `private, no-store`, so it cannot demonstrate the cache behavior of a public live response. -Before promotion, inspect the exact build output you intend to publish with [`sf routing inspect`](/cli/reference#sf-routing-inspect): +Before promotion, inspect the exact build output you intend to publish with [`sf routing inspect`](/cli/reference/routing#sf-routing-inspect): ```bash sf routing inspect --routing ./dist --url https://example.com/path @@ -101,9 +101,9 @@ sf routing inspect --routing ./dist --url https://example.com/path Replace `./dist` with your build's publish root and repeat `--url` to match more URLs. This shows compiled custom header rules, not the complete runtime response or managed edge cache policy. See [Response headers](/headers). -[`sf routing compute`](/cli/reference#sf-routing-compute) (`sf routing compute --space my-space`, or [`computeSpaceRouting`](/api/reference/spaces/computespacerouting) over HTTP) resolves routing with current variables for the ready pending version if one exists, otherwise the live version. It does not accept `--url` or select an arbitrary version. An authenticated request to a preview can inspect its response headers, while its private cache policy stays intentional. +[`sf routing compute`](/cli/reference/routing#sf-routing-compute) (`sf routing compute --space my-space`, or [`computeSpaceRouting`](/api/reference/spaces/computespacerouting) over HTTP) resolves routing with current variables for the ready pending version if one exists, otherwise the live version. It does not accept `--url` or select an arbitrary version. An authenticated request to a preview can inspect its response headers, while its private cache policy stays intentional. -To observe live edge caching, run [`sf promote`](/cli/reference#sf-promote-version) (`sf promote `) and request the public live URL without private access credentials. Run [`sf rollback`](/cli/reference#sf-rollback-version) (`sf rollback `) if you need to return to an earlier version. +To observe live edge caching, run [`sf promote`](/cli/reference/promote#sf-promote-version) (`sf promote `) and request the public live URL without private access credentials. Run [`sf rollback`](/cli/reference/rollback#sf-rollback-version) (`sf rollback `) if you need to return to an earlier version. ## Vary is not part of the cache key diff --git a/content/(routing)/customization.mdx b/content/(routing)/customization.mdx index b3664377..d56a0180 100644 --- a/content/(routing)/customization.mdx +++ b/content/(routing)/customization.mdx @@ -5,7 +5,7 @@ description: Theme Spacefast-drawn pages, set link preview metadata and analytic Customize Spacefast's built-in pages, link previews, and error pages either on the Space in the dashboard or in your published repository with `spacefast.config.ts`, `theme.json`, `_layout.html`, `_pages/.html`, and `404.html`. -Open a Space and go to **Customization** to edit **Theme** and **Search & sharing** with a live **Visitor sees** preview. Teams with [Tag Manager](/tag-manager) also see **Google Analytics** and **Custom JS** tabs there. +Open the Space's [**Customization**](https://my.spacefast.com/?to=/:team/:space/customization) page to edit **Theme** and **Search & sharing** with a live **Visitor sees** preview. Teams with [Tag Manager](/tag-manager) also see **Google Analytics** and **Custom JS** tabs there. ## Space settings versus project configuration @@ -241,4 +241,4 @@ Publish fails on the first error diagnostic and keeps the current live version s - [Project configuration](/config-file): full `meta`, `theme`, and `superpowers` schema - [Workers](/functions): dynamic `404` and custom request handling in `handler.ts` -- [`sf pages` CLI reference](/cli/reference#sf-pages) and [`sf design` CLI reference](/cli/reference#sf-design): command flags +- [`sf pages` CLI reference](/cli/reference/pages#sf-pages) and [`sf design` CLI reference](/cli/reference/design#sf-design): command flags diff --git a/content/(routing)/domains/dns.mdx b/content/(routing)/domains/dns.mdx index f0296485..8fc2cb53 100644 --- a/content/(routing)/domains/dns.mdx +++ b/content/(routing)/domains/dns.mdx @@ -24,9 +24,10 @@ Over the API, call [`replaceSpaceCustomDomainDnsRecords`](/api/reference/domains -1. Open your team's **Domains** page and select the domain. +1. Open your team's [**Domains**](https://my.spacefast.com/?to=/:team/domains) page and select the domain. 2. In the **DNS** section, select **Add record**, or select an existing record to edit or delete it. -3. Changes stay as drafts until you select **Review changes**, check the diff, and select **Apply changes**. Every change in a batch applies together, or none do. +3. Select **Review changes** and check the diff. Changes stay as drafts until you apply them. +4. Select **Apply changes**. Every change in a batch applies together, or none do. To configure common mail or verification services in one step, select **Add a service** and choose a preset. @@ -67,7 +68,13 @@ TTL accepts values from `60` seconds to `86400` seconds (1 day) and defaults to ### Import and export zones -To import records from another DNS provider, export a BIND zone file there, open **Import zone** in the dashboard, and paste the file. Imported records become drafts for review. Turn on **Remove records not in the file** to replace the zone instead of merging. Spacefast skips and lists unsupported record types. +To import records from another DNS provider: + +1. Export a BIND zone file at that provider. +2. Open **Import zone** in the dashboard. +3. Paste the file. Imported records become drafts for review. + +Turn on **Remove records not in the file** to replace the zone instead of merging. Spacefast skips and lists unsupported record types. Select **Export zone** to download or copy a `.zone` file, or **Copy for AI agent** to copy a chat-ready summary. From the terminal, print the zone in BIND format: @@ -177,5 +184,5 @@ Nameserver changes can take up to 48 hours to reach every network. Individual re - [Custom domains](/domains): attach a domain to a Space and issue HTTPS certificates - [Domain registration](/domains/registration): buy domains on Spacefast DNS at cost -- [`sf domains dns` CLI reference](/cli/reference#sf-domains-dns): full DNS command reference -- [`sf domains connect` CLI reference](/cli/reference#sf-domains-connect): full Domain Connect command reference +- [`sf domains dns` CLI reference](/cli/reference/domains#sf-domains-dns): full DNS command reference +- [`sf domains connect` CLI reference](/cli/reference/domains#sf-domains-connect): full Domain Connect command reference diff --git a/content/(routing)/domains/index.mdx b/content/(routing)/domains/index.mdx index c1162d6f..66538c57 100644 --- a/content/(routing)/domains/index.mdx +++ b/content/(routing)/domains/index.mdx @@ -27,7 +27,7 @@ A domain belongs to a **team**, not to a Space. You add it once to the team's in - Open the Space, go to **Domains**, and select **Add domain**. The wizard walks **Enter**, **Setup**, and **Verify**. For a root domain, **Enter** asks you to choose a **Primary address**, either the apex or `www`. + Open the Space's **Domains** page and select [**Add domain**](https://my.spacefast.com/?to=/:team/:space/domains/add). The wizard walks **Enter**, **Setup**, and **Verify**. For a root domain, **Enter** asks you to choose a **Primary address**, either the apex or `www`. @@ -60,7 +60,7 @@ A domain belongs to a **team**, not to a Space. You add it once to the team's in - Edit the row on the Space's **Domains** page and choose **Serve this space** with **Primary domain, the live URL**. + Edit the row on the Space's [**Domains**](https://my.spacefast.com/?to=/:team/:space/domains) page and choose **Serve this space** with **Primary domain, the live URL**. @@ -162,7 +162,7 @@ A domain assigned to a Space either serves the Space or redirects the entire hos sf domains add www.example.com --space my-space --role redirect --redirect-to example.com ``` -`--redirect-status` accepts `301`, `302`, `307`, or `308` and defaults to `308`. In the dashboard, edit the domain row and select **Redirect to another domain**. +`--redirect-status` accepts `301`, `302`, `307`, or `308` and defaults to `308`. In the dashboard, edit the domain row on the Space's [**Domains**](https://my.spacefast.com/?to=/:team/:space/domains) page and select **Redirect to another domain**. A redirecting domain cannot be primary. Setting a redirect on the current primary releases the primary slot; promoting a redirecting domain to primary without clearing its redirect fails with [`domain_primary_redirect_conflict`](/errors/domain_primary_redirect_conflict). @@ -198,7 +198,7 @@ In CLI releases before `sf domains delete` was separated (including `0.8.0` and ## Team domain inventory and limits -Every domain your team owns appears under **Team → Domains**, assigned to a Space or unassigned. Over the API, [`listDomains`](/api/reference/domains/listdomains) (`GET /v1/domains`) lists the team inventory and [`listSpaceDomains`](/api/reference/domains/listspacedomains) (`GET /v1/spaces/{spaceId}/domains`) lists domains attached to one Space. `sf domains list` lists a Space's attached domains. +Every domain your team owns appears under [**Team → Domains**](https://my.spacefast.com/?to=/:team/domains), assigned to a Space or unassigned. Over the API, [`listDomains`](/api/reference/domains/listdomains) (`GET /v1/domains`) lists the team inventory and [`listSpaceDomains`](/api/reference/domains/listspacedomains) (`GET /v1/spaces/{spaceId}/domains`) lists domains attached to one Space. `sf domains list` lists a Space's attached domains. Two teams can add the same hostname to inventory, but only one Space serves it. Publishing a claim's TXT record moves serving to the claiming Space. @@ -265,5 +265,5 @@ www.example.com purpose=www dns=not_configured txt=missing ssl=missing - [DNS](/domains/dns): Spacefast DNS zones, email records, nameservers, and Domain Connect - [Domain registration](/domains/registration): buy domains at cost and manage renewals - [Domain transfers](/domains/transfers): transfer registrations into or out of Spacefast -- [`sf domains` CLI reference](/cli/reference#sf-domains): full command flags and examples +- [`sf domains` CLI reference](/cli/reference/domains#sf-domains): full command flags and examples - [Traffic stats](/stats): monitor visits once your domain is live diff --git a/content/(routing)/domains/registration.mdx b/content/(routing)/domains/registration.mdx index cb4685ad..4ddff2cd 100644 --- a/content/(routing)/domains/registration.mdx +++ b/content/(routing)/domains/registration.mdx @@ -14,7 +14,7 @@ Only team owners and admins can complete a domain purchase. An agent or API key -1. Open your team and select **Domains**. +1. Open your team's [**Domains**](https://my.spacefast.com/?to=/:team/domains) page. 2. Select **Buy domain**. 3. Enter a domain name or describe your project to generate suggestions across extensions such as `.com`, `.org`, `.app`, and `.dev`. 4. Select up to 10 apex domains and continue to **Review and buy**. @@ -40,7 +40,7 @@ Without `--expect-total`, `purchase` holds the names for 24 hours, prints the to sf domains registration purchase example.com --expect-total 10.34 ``` -To pay from an agent wallet instead of the team's saved card, pass `--payment-token spt_...` together with `--expect-total`. To confirm a held purchase later from the CLI, run [`sf purchases confirm`](/cli/reference#sf-purchases-confirm-id) (requires purchasing power on the paying team, or `domains:write` when paying with `--payment-token`): +To pay from an agent wallet instead of the team's saved card, pass `--payment-token spt_...` together with `--expect-total`. To confirm a held purchase later from the CLI, run [`sf purchases confirm`](/cli/reference/purchases#sf-purchases-confirm-id) (requires purchasing power on the paying team, or `domains:write` when paying with `--payment-token`): ```bash sf purchases confirm pur_xxxxxxxx --expect-total 10.34 @@ -173,7 +173,7 @@ If you buy a domain or enable auto-renew fewer than 37 days before expiry, the c To toggle auto-renew (team owners and admins only): -- **Dashboard**: Open team **Domains → ``** and toggle **Auto-renew** on the **Registration** card. +- **Dashboard**: Open the domain from team [**Domains**](https://my.spacefast.com/?to=/:team/domains) and toggle **Auto-renew** on the **Registration** card. - **CLI**: Run `sf domains registration example.com --no-auto-renew` (or `--auto-renew`). - **API**: Call `PATCH /v1/domains/{domainId}/registration` with `{"autoRenew": false}`. @@ -183,7 +183,7 @@ Turning auto-renew off cancels any upcoming automatic charge that has not run ye Renewing adds one year to the existing expiry date, so renewing early loses no time. -- **Dashboard**: Open the domain and select **Renew for 1 year** on the **Registration** card (shown starting 30 days before expiry). +- **Dashboard**: Open the domain from team [**Domains**](https://my.spacefast.com/?to=/:team/domains) and select **Renew for 1 year** on the **Registration** card (shown starting 30 days before expiry). - **CLI**: Run `sf domains registration renew example.com` (available anytime; add `--expect-total` to charge immediately instead of printing a checkout link). - **API**: Call [`createDomainRegistrationAction`](/api/reference/domains/createdomainregistrationaction) with `{"action": "renew"}`. @@ -198,7 +198,7 @@ After the expiry date, status changes to **Expired** and Spacefast stops automat Once the window ends without renewal, Spacefast checks with the registrar. If the registry released the name, Spacefast marks the registration deleted, Spacefast DNS stops serving it, and the domain stays in your team list as an unregistered domain. Released domains can be registered immediately by anyone. -Check upcoming expiration dates in team **Domains** (sort by **Expires soonest**) or with `sf domains registration example.com`. +Check upcoming expiration dates in team [**Domains**](https://my.spacefast.com/?to=/:team/domains) (sort by **Expires soonest**) or with `sf domains registration example.com`. ## Errors @@ -225,4 +225,4 @@ Check upcoming expiration dates in team **Domains** (sort by **Expires soonest** - [Custom domains](/domains): attach your registered domain to a Space - [DNS](/domains/dns): add email records or change nameservers - [Domain transfers](/domains/transfers): transfer registrations into or out of Spacefast -- [`sf domains registration` CLI reference](/cli/reference#sf-domains-registration-domain): full command reference +- [`sf domains registration` CLI reference](/cli/reference/domains#sf-domains-registration-domain): full command reference diff --git a/content/(routing)/domains/transfers.mdx b/content/(routing)/domains/transfers.mdx index c8c4609b..fabe6616 100644 --- a/content/(routing)/domains/transfers.mdx +++ b/content/(routing)/domains/transfers.mdx @@ -25,7 +25,7 @@ Transferring a domain in adds one year to its registration at the extension's cu -1. Open your team's **Domains** page and add the domain or open its existing inventory record. +1. Open your team's [**Domains**](https://my.spacefast.com/?to=/:team/domains) page and add the domain or open its existing inventory record. 2. On the **Registration** card (or in the add-domain transfer flow), enter the **Authorization code**. 3. Select or enter the **Domain owner** details. 4. Select **Continue to Payment** to review the price and pay. Nothing is charged until you pay. @@ -92,7 +92,7 @@ ICANN rules lock a domain for **60 days** after registration, transfer in, or ch -1. Open team **Domains** and select the domain. +1. Open team [**Domains**](https://my.spacefast.com/?to=/:team/domains) and select the domain. 2. On the **Registration** card, select **Transfer to Another Registrar**. 3. Type the domain name to confirm, then select **Unlock and Email Code**. @@ -145,7 +145,8 @@ If you decide not to transfer a domain away, or want to restore protection after -Open the domain's **Registration** card and select **Enable Transfer Lock**. +1. Open team [**Domains**](https://my.spacefast.com/?to=/:team/domains) and select the domain. +2. On the **Registration** card, select **Enable Transfer Lock**. @@ -188,4 +189,4 @@ Enabling the transfer lock again remains available for recovery even when new tr - [Domain registration](/domains/registration): buy domains, manage contacts, and handle renewals - [DNS](/domains/dns): export zones or switch nameservers before or after a transfer -- [`sf domains registration` CLI reference](/cli/reference#sf-domains-registration-transfer-in-domain): full transfer CLI flags +- [`sf domains registration` CLI reference](/cli/reference/domains#sf-domains-registration-transfer-in-domain): full transfer CLI flags diff --git a/content/(routing)/headers.mdx b/content/(routing)/headers.mdx index 11ae94f7..95f1a1dd 100644 --- a/content/(routing)/headers.mdx +++ b/content/(routing)/headers.mdx @@ -118,4 +118,4 @@ Private previews always return `Cache-Control: private, no-store`, so test live - [HTTP and security headers](/infrastructure/http-security-headers): security policy examples and browser checks - [Caching](/caching): default edge and browser cache policies - [Redirects and rewrites](/redirects): path redirects, proxies, and Traffic Rules -- [`sf routing inspect` CLI reference](/cli/reference#sf-routing-inspect): full inspection options +- [`sf routing inspect` CLI reference](/cli/reference/routing#sf-routing-inspect): full inspection options diff --git a/content/(routing)/redirects.mdx b/content/(routing)/redirects.mdx index 950b46c8..7f937bd7 100644 --- a/content/(routing)/redirects.mdx +++ b/content/(routing)/redirects.mdx @@ -270,7 +270,14 @@ sf rules list sf rules remove block-logins --kind firewall ``` -In the dashboard, open **Traffic Rules → New Rule**, choose **Firewall** or **Cache**, configure the match pattern and action, and select **Create Rule**. Use **Move up** and **Move down** to reorder rules, or **Remove** to delete overlay rules. To edit a config rule without publishing, select **Override in Dashboard** to copy it into Space settings. +To add a rule in the dashboard: + +1. Open the Space's [**Traffic Rules**](https://my.spacefast.com/?to=/:team/:space/rules) page and select **New Rule**. +2. Choose **Firewall** or **Cache**. +3. Configure the match pattern and action. +4. Select **Create Rule**. + +Use **Move up** and **Move down** to reorder rules, or **Remove** to delete overlay rules. To edit a config rule without publishing, select **Override in Dashboard** to copy it into Space settings. The **Edge Allowance** card and `sf rules list` (`listSpaceTrafficRules`) show each rule's placement (**Edge** or **Origin**) and state (`live`, `pending`, `over_quota`, `invalid`, `failed`, `suspended`, `disabled`, or `unknown`). Duplicate rules or duplicate names are reported under `collapsed`. @@ -288,7 +295,7 @@ sf rules validate `sf rules validate` checks your config file against the grammar and edge limits, printing field paths such as `firewall[0].match.country` and exiting `2` on errors (same check as [`validateSpaceTrafficRules`](/api/reference/spaces/validatespacetrafficrules)). -In the dashboard, open **Test a request against your rules** under the rule list to test a path with optional **Country**, **IP address**, **User agent**, **Header**, or **Cookie** values. The dashboard tester does not accept method, ASN, referrer, JA3, or JA4 inputs, so rules using those fields may behave differently at the edge. +On the Space's [**Traffic Rules**](https://my.spacefast.com/?to=/:team/:space/rules) page, open **Test a request against your rules** under the rule list to test a path with optional **Country**, **IP address**, **User agent**, **Header**, or **Cookie** values. The dashboard tester does not accept method, ASN, referrer, JA3, or JA4 inputs, so rules using those fields may behave differently at the edge. ### Pause and resume all rules @@ -366,4 +373,4 @@ Space settings and config files each keep their own lists. Keyed fields count on - [Response headers](/headers): set or remove HTTP response headers - [Caching](/caching): default cache policies and testing before promotion -- [`sf routing` CLI reference](/cli/reference#sf-routing-inspect) and [`sf rules` CLI reference](/cli/reference#sf-rules): full flag reference +- [`sf routing` CLI reference](/cli/reference/routing#sf-routing-inspect) and [`sf rules` CLI reference](/cli/reference/rules#sf-rules): full flag reference diff --git a/content/agents/anonymous-and-claim.mdx b/content/agents/anonymous-and-claim.mdx index c27fe164..896f6ef3 100644 --- a/content/agents/anonymous-and-claim.mdx +++ b/content/agents/anonymous-and-claim.mdx @@ -13,7 +13,7 @@ Connect your AI tool to your Spacefast account first (see [Agents](/agents)) to sf publish ./dist ``` -If you are not signed in, [`sf publish`](/cli/reference#sf-publish-dir) publishes anyway (or call [`createPublish`](/api/reference/publishing/createpublish) over HTTP with no credential). The server creates a Space owned only by a secret it returns and prints a live URL you can open immediately. +If you are not signed in, [`sf publish`](/cli/reference/publish#sf-publish-dir) publishes anyway (or call [`createPublish`](/api/reference/publishing/createpublish) over HTTP with no credential). The server creates a Space owned only by a secret it returns and prints a live URL you can open immediately. What comes back is a `claim` block with four fields: @@ -38,7 +38,7 @@ The key is in the claim link's URL fragment. Browsers don't send fragments to se From the browser, [drop.fast](https://drop.fast) does the same thing while signed out, labeled **Anonymous drop · No account needed**. Claiming the resulting Space removes the anonymous publishing deadline, lets you find it again and publish updates, and keeps its existing sharing settings unchanged. A Space published while signed in to your account skips claiming. -Before claiming, you can publish updates, manage scoped viewer links, and promote or roll back to a version ID from an earlier receipt. Listing version history, downloading files, and exporting app data return [`space_unclaimed`](/errors/space_unclaimed) until someone claims the Space. Run [`sf spaces claim`](/cli/reference#sf-spaces-claim) in the publishing directory, sign in, then retry. +Before claiming, you can publish updates, manage scoped viewer links, and promote or roll back to a version ID from an earlier receipt. Listing version history, downloading files, and exporting app data return [`space_unclaimed`](/errors/space_unclaimed) until someone claims the Space. Run [`sf spaces claim`](/cli/reference/spaces#sf-spaces-claim) in the publishing directory, sign in, then retry. ## The clock @@ -114,7 +114,7 @@ After the claim finishes, the page says **<space> is yours.** and offers * The claim page lists those people and links under **Already Shared With** ("They will keep their access."). Claiming changes ownership, not who already has access. -Two things can block a claim (via [`sf spaces claim`](/cli/reference#sf-spaces-claim) or [`claimSpace`](/api/reference/publishing/claimspace)). Claiming moves the Space into the team, so it counts against that team's Space limit like any other create; a team at its limit returns [`quota_exceeded`](/errors/quota_exceeded). Spacefast also re-checks the slug against the receiving team's namespace; a collision returns [`slug_unavailable`](/errors/slug_unavailable) and prompts you to pick a new one. +Two things can block a claim (via [`sf spaces claim`](/cli/reference/spaces#sf-spaces-claim) or [`claimSpace`](/api/reference/publishing/claimspace)). Claiming moves the Space into the team, so it counts against that team's Space limit like any other create; a team at its limit returns [`quota_exceeded`](/errors/quota_exceeded). Spacefast also re-checks the slug against the receiving team's namespace; a collision returns [`slug_unavailable`](/errors/slug_unavailable) and prompts you to pick a new one. ## Keeping your agent publishing @@ -128,7 +128,7 @@ For what a credential like this can and cannot do, see [what agents are allowed ## Rotating the key -If the key leaked, replace it with [`sf spaces key rotate`](/cli/reference#sf-spaces-key-rotate) or [`rotateSpaceKey`](/api/reference/publishing/rotatespacekey): +If the key leaked, replace it with [`sf spaces key rotate`](/cli/reference/spaces#sf-spaces-key-rotate) or [`rotateSpaceKey`](/api/reference/publishing/rotatespacekey): ```bash sf spaces key rotate --space spc_9f2c1ab34d5e4f6789ab01cd23ef4567 @@ -138,7 +138,7 @@ You get a fresh `claim` receipt. The old key, its `url`, its claim link, and eve ## Checking on it -Check live status and the claim deadline with [`sf status`](/cli/reference#sf-status): +Check live status and the claim deadline with [`sf status`](/cli/reference/status#sf-status): ```bash sf status --include-claim-url diff --git a/content/agents/domain-research.mdx b/content/agents/domain-research.mdx index ed591349..cc060cae 100644 --- a/content/agents/domain-research.mdx +++ b/content/agents/domain-research.mdx @@ -42,7 +42,7 @@ Use the first option that works where you run. If it fails, drop to the next. 1. **Spacefast MCP with Apps.** In a host that shows MCP Apps, call `show_domains` with `{ "query": "" }`. The Domains App shows names, prices, and the purchase form. The MCP server at `https://mcp.spacefast.com` needs the person to sign in; see [MCP server](/agents/mcp-server). 2. **Spacefast MCP without Apps.** Call the operation tools and write the results into your reply. They take the same fields as the HTTP requests below, with a request body under `body`: [`searchDomains`](/api/reference/domains/searchdomains) with `{ "body": { "message": "..." } }`, [`checkDomainAvailabilityBatch`](/api/reference/domains/checkdomainavailabilitybatch) with `{ "body": { "mode": "live", "names": ["..."] } }`, and [`getDomainAvailability`](/api/reference/domains/getdomainavailability) with `{ "name": "example.com" }`. 3. **HTTP requests.** Call the REST API below and parse the JSON. -4. **A terminal with network access.** Use `curl`, or [`sf domains search`](/cli/reference#sf-domains-search-query) from the CLI. +4. **A terminal with network access.** Use `curl`, or [`sf domains search`](/cli/reference/domains#sf-domains-search-query) from the CLI. 5. **Web fetch only.** Write the names yourself, then fetch `GET https://api.spacefast.com/v1/domains/research/availability?name=example.com` once for each. It's a plain `GET` with a JSON answer, no account needed. Search and refine need `POST`, so they're out of reach here. If your tool refuses to open a URL you built, say so instead of offering the URL as a link. 6. **No network.** Say that you can't check live availability. Offer your ideas as unverified, and give the person `https://my.spacefast.com/domains/search?q=` followed by their brief, URL-encoded. Searching there needs no account. @@ -240,5 +240,5 @@ Add your own reasoning around the facts: why a name fits, how it reads aloud, wh - [Domain registration](/domains/registration): the same flow for people, plus the purchase details. - [OpenAPI reference](/api/reference): every request and response schema, also at `https://api.spacefast.com/openapi.json`. -- [`sf domains`](/cli/reference#sf-domains): search and buy from a terminal. +- [`sf domains`](/cli/reference/domains#sf-domains): search and buy from a terminal. - [Connect a domain to a Space](/domains) once it's registered. diff --git a/content/agents/index.mdx b/content/agents/index.mdx index 78c65caf..c90835b1 100644 --- a/content/agents/index.mdx +++ b/content/agents/index.mdx @@ -17,7 +17,7 @@ The setup guide distinguishes connected MCP/CLI clients, anonymous HTTP publishi - Add the Spacefast connector once — it syncs across web, mobile, and Claude Desktop. + Add the Spacefast connector once. It syncs across web, mobile, and Claude Desktop. Connect the official Spacefast plugin and mention `@Spacefast` in chat. @@ -62,7 +62,7 @@ Or use the universal installer for `claude-code`, `codex`, `cursor`, `vscode`, ` npx -y plugins add spacefast/plugins -t cursor -y ``` -Nothing assumes the `sf` CLI is already installed. In Claude, adding the Spacefast connector and plugin to your account syncs across web, mobile, and Claude Desktop — you don't need a separate desktop bundle. On a Claude Team or Enterprise plan, an owner must enable the connector first, and `sf setup agent` does not edit `claude_desktop_config.json`. +Nothing assumes the `sf` CLI is already installed. In Claude, adding the Spacefast connector and plugin to your account syncs across web, mobile, and Claude Desktop, so you don't need a separate desktop bundle. On a Claude Team or Enterprise plan, an owner must enable the connector first, and `sf setup agent` does not edit `claude_desktop_config.json`. ### Terminal setup (`npx spacefast setup`) @@ -72,7 +72,7 @@ Run the zero-install setup wizard to sign in, configure detected agents, and pub npx -y spacefast setup ``` -To configure agent tooling alone with an installed CLI, run [`sf setup agent`](/cli/reference#sf-setup-agent). By default it connects editors over `sf mcp proxy` using your CLI login, which helps when an editor lacks native MCP OAuth. See [`sf setup`](/cli/reference#sf-setup) for every flag. +To configure agent tooling alone with an installed CLI, run [`sf setup agent`](/cli/reference/setup#sf-setup-agent). By default it connects editors over `sf mcp proxy` using your CLI login, which helps when an editor lacks native MCP OAuth. See [`sf setup`](/cli/reference/setup#sf-setup) for every flag. ### Direct MCP @@ -115,7 +115,7 @@ Every supported client has its own step-by-step page under [Agent setup](/setup) Plugin with skills and a rule, or a one-click deeplink. - Syncs connectors and plugins from your Claude account — no desktop bundle needed. + Syncs connectors and plugins from your Claude account. No desktop bundle needed. Hosted URL, local stdio command, and generic client config. diff --git a/content/agents/mcp-server.mdx b/content/agents/mcp-server.mdx index 965abd04..632d2acb 100644 --- a/content/agents/mcp-server.mdx +++ b/content/agents/mcp-server.mdx @@ -23,7 +23,7 @@ The same server ships in two runtimes. Both expose the eligible API operations b The hosted endpoint also answers on `/mcp` and `/mcp/`. Only the `mcp.` hostname serves MCP; the path `/mcp` on the API host does not. -There is a third option, [`sf mcp proxy`](/cli/reference#sf-mcp-proxy), which speaks stdio to your editor and HTTPS to the hosted endpoint using your CLI login. It is what [`sf setup agent`](/cli/reference#sf-setup-agent) writes by default. See [Any MCP client](/setup/any-mcp) and [Ways to connect](/connect). +There is a third option, [`sf mcp proxy`](/cli/reference/mcp#sf-mcp-proxy), which speaks stdio to your editor and HTTPS to the hosted endpoint using your CLI login. It is what [`sf setup agent`](/cli/reference/setup#sf-setup-agent) writes by default. See [Any MCP client](/setup/any-mcp) and [Ways to connect](/connect). ## Authentication @@ -67,7 +67,7 @@ Hosted requests are rate limited to 600 per minute per credential and 300 per mi ### Local -The local server takes its credential from the process, never from client config. [`sf mcp`](/cli/reference#sf-mcp) resolves your CLI login and hands it to the in-process server. Standalone runs read `SPACEFAST_TOKEN`. Pass `--read-only` or `--groups` to narrow which tools the server exposes. +The local server takes its credential from the process, never from client config. [`sf mcp`](/cli/reference/mcp#sf-mcp) resolves your CLI login and hands it to the in-process server. Standalone runs read `SPACEFAST_TOKEN`. Pass `--read-only` or `--groups` to narrow which tools the server exposes. | Variable | Effect | |---|---| diff --git a/content/agents/permissions.mdx b/content/agents/permissions.mdx index d2358f49..29867dcf 100644 --- a/content/agents/permissions.mdx +++ b/content/agents/permissions.mdx @@ -11,7 +11,7 @@ An agent can get access in four ways, each approved in your browser: | Method | How it starts | What the agent ends up holding | |---|---|---| -| Device login | The agent runs [`sf login`](/cli/reference#sf-login) and shows you a code | An API key, scoped to what you ticked, good for 30 days or 7 days idle | +| Device login | The agent runs [`sf login`](/cli/reference/login#sf-login) and shows you a code | An API key, scoped to what you ticked, good for 30 days or 7 days idle | | API key | You mint one and paste it into the agent's config | A key with the permissions from the preset and your expiry | | Hosted MCP | The agent sends you to a consent screen | An OAuth token for the scopes and teams you allowed | | Handoff link | You mint a one-use link from the dashboard | An API key bound to one Space or one page | @@ -49,7 +49,7 @@ An agent that logged in with anything other than **All teams** also cannot creat ## Approvals -When an agent hits something risky, it stops and asks. The request appears on the **Approvals** page and in the notification bell in the dashboard header. +When an agent hits something risky, it stops and asks. The request appears on the [**Approvals**](https://my.spacefast.com/approvals) page and in the notification bell in the dashboard header. `/approvals` is titled **Approvals**, with "Waiting on you, highest impact first." Each pending row says what kind of decision it is: @@ -79,10 +79,10 @@ A handoff is a one-use link that gives a local coding agent access to one Space, Open **/start**, pick your agent, and follow the setup. Each agent has its own page at `/start/`. Spacefast shows the link once at creation and never shows it again. - The agent redeems it with [`sf login`](/cli/reference#sf-login) (`sf login --handoff`) and pastes the link when prompted, or pipes it on stdin. The CLI refuses a handoff link passed as a command argument so it stays out of your shell history and process list. + The agent redeems it with [`sf login`](/cli/reference/login#sf-login) (`sf login --handoff`) and pastes the link when prompted, or pipes it on stdin. The CLI refuses a handoff link passed as a command argument so it stays out of your shell history and process list. - The team's **Agents** page has a **Handoff links** section. Rows show **Active**, **Redeemed**, **Expired**, or **Revoked**, which Space the link publishes to, when it was created, and how many times it was fetched. + The team's [**Agents**](https://my.spacefast.com/?to=/:team/agents) page has a **Handoff links** section. Rows show **Active**, **Redeemed**, **Expired**, or **Revoked**, which Space the link publishes to, when it was created, and how many times it was fetched. @@ -90,9 +90,9 @@ A handoff link lives 15 minutes and can be redeemed once. A team can have 10 pen ## Turning access off -**Account settings → Connected apps** lists everything acting as you, labeled **Agent**, **App**, **CLI**, **One-time handoff**, **API key**, or **Machine OAuth client**. Opening one shows which teams it reaches, which permissions it holds, and its recent activity. +[**Account settings → Connected apps**](https://my.spacefast.com/account/connected-apps) lists everything acting as you, labeled **Agent**, **App**, **CLI**, **One-time handoff**, **API key**, or **Machine OAuth client**. Opening one shows which teams it reaches, which permissions it holds, and its recent activity. - Revoking one connection kills the whole thing: its API keys, its OAuth tokens, its handoff links, and any temporary elevation. - **Stop All Agent Access** is the account-wide emergency stop. It revokes everything acting as you and cancels handoff links that were never redeemed. Team-owned automation is not yours alone, so it survives. -Team owners and admins have the same control from the team's **Agents** page, under **Who can act here**. **Remove from team** takes an agent's reach into that one team away and leaves the rest alone. +Team owners and admins have the same control from the team's [**Agents**](https://my.spacefast.com/?to=/:team/agents) page, under **Who can act here**. **Remove from team** takes an agent's reach into that one team away and leaves the rest alone. diff --git a/content/agents/poppy.mdx b/content/agents/poppy.mdx index 84090909..d61f441f 100644 --- a/content/agents/poppy.mdx +++ b/content/agents/poppy.mdx @@ -254,5 +254,5 @@ Spacefast responds with `202 Accepted` and an empty body (`Cache-Control: no-sto - [MCP server](/agents/mcp-server): connect to the MCP endpoint advertised in `apis`. - [Agent permissions](/agents/permissions): role ceilings, approval gates, and revocation. - [API authentication](/api/authentication): OAuth 2.0, DPoP, scopes, and credential rules. -- [`sf setup agent`](/cli/reference#sf-setup-agent): wire local CLI and MCP setup for supported coding agents. +- [`sf setup agent`](/cli/reference/setup#sf-setup-agent): wire local CLI and MCP setup for supported coding agents. - [API reference](/api/reference): every operation behind `https://api.spacefast.com/openapi.json`. diff --git a/content/agents/skills.mdx b/content/agents/skills.mdx index e52e4cb6..0959ce07 100644 --- a/content/agents/skills.mdx +++ b/content/agents/skills.mdx @@ -3,7 +3,7 @@ title: Skills description: The base Spacefast skill and the task skills for saving and using a team's Design System --- -The Spacefast plugins and [`sf skills install`](/cli/reference#sf-skills-install) install the base `spacefast` skill for publishing, inspection, and management. The format and tool choices depend on the client. Adding only an [MCP server](/agents/mcp-server) connection doesn't install the skill; run [`sf setup agent`](/cli/reference#sf-setup-agent) to configure both. +The Spacefast plugins and [`sf skills install`](/cli/reference/skills#sf-skills-install) install the base `spacefast` skill for publishing, inspection, and management. The format and tool choices depend on the client. Adding only an [MCP server](/agents/mcp-server) connection doesn't install the skill; run [`sf setup agent`](/cli/reference/setup#sf-setup-agent) to configure both. The plugins also include task skills for building a Space, editing a Space, sharing, custom domains, fixing a deployment, and saving and using a team's Design System. For custom skills shared across your own team, see [Team Skills](/team-skills). @@ -93,7 +93,7 @@ The rest sets behavior the tools alone do not enforce. - Call the matching operation tool directly. Read its input schema before calling it. - Reuse the `.spacefast/` link in the current directory. Do not list Spaces before an ordinary publish, and set `createNew` only when you asked for a separate Space. - Publish once, then poll `operation_status` until it settles, then read the deployment, then report. -- Report the live URL and the immutable version URL, plus the access URL when the receipt includes one. Current clients create team-owned Spaces without automatic access URLs: the owning team signs in at the live URL, and [`sf share link create`](/cli/reference#sf-share-link-create) makes a link for people outside the team. For an anonymous publish, relay the receipt's claim link and message so the owner can keep the Space. Treat the link as a credential. +- Report the live URL and the immutable version URL, plus the access URL when the receipt includes one. Current clients create team-owned Spaces without automatic access URLs: the owning team signs in at the live URL, and [`sf share link create`](/cli/reference/share#sf-share-link-create) makes a link for people outside the team. For an anonymous publish, relay the receipt's claim link and message so the owner can keep the Space. Treat the link as a credential. - Never print API keys, Space keys, upload tokens, or `.spacefast/state.json`. - Open the URL before claiming success, since a bare live URL is private until access is granted. @@ -118,7 +118,7 @@ sf skills install | `--list` | List the bundled skill files without installing | | `--force` | Overwrite locally modified or unverified Spacefast skill files | -Two sibling commands, [`sf skills status`](/cli/reference#sf-skills-status) and [`sf skills remove`](/cli/reference#sf-skills-remove), round it out. +Two sibling commands, [`sf skills status`](/cli/reference/skills#sf-skills-status) and [`sf skills remove`](/cli/reference/skills#sf-skills-remove), round it out. ```bash sf skills status diff --git a/content/guides/frameworks.mdx b/content/guides/frameworks.mdx index 940205a6..6d0b59e1 100644 --- a/content/guides/frameworks.mdx +++ b/content/guides/frameworks.mdx @@ -26,12 +26,13 @@ With no flags, `sf publish` builds a detected project, and publishes the directo ## Which directory to publish -Detection uses this table for both paths. The output directory column is what to hand `sf publish` when you build yourself. +Detection uses this table for both paths. For a prebuilt static site, pass the output directory to `sf publish`. For a server-rendered Next.js app, run `sf publish` from the project root so Spacefast can package the server. | Framework | Detected by | Default build command | Output directory | | --- | --- | --- | --- | | `vinext` | `vinext` dependency, unless the build script runs `next build`. If `next` is also installed, the build script must run `vinext build`, `vinext deploy`, or `vinext export` | `vinext build` | `dist/client` | -| [Next.js](/guides/recipes/next) | `next` or `nextra` dependency | `next build` | `out` | +| [Next.js, server-rendered](/guides/recipes/next) | `next` or `nextra` dependency on a supported release | `next build` | Run `sf publish` from the project root | +| [Next.js, static export](/guides/recipes/next#the-output-directory) | Next.js configured with `output: "export"` | `next build` | `out` by default. Run `sf publish ./out --prebuilt` | | TanStack Start | `@tanstack/react-start` dependency | package script | `dist/client` | | Nuxt | `nuxt` dependency | `nuxt generate` | `.output/public` | | [Astro](/guides/recipes/astro) | `astro` dependency or `astro.config.*` | `astro build` | `dist` | @@ -115,7 +116,13 @@ export default defineConfig({ `--skip-install` and `--skip-build` cut the corresponding step out entirely. -For a connected repository, the same fields live on the Space. Open **Builds**, then **Build settings**, and fill in **Root directory**, **Install command**, **Build command**, and **Output directory**. Each placeholder reads **Auto**, and the note under them says **Leave a field empty and the builder decides from the detected framework.** **Detect build settings** runs detection against your repo and offers ranked candidates with an **Apply** button. +For a connected repository, the same fields live on the Space: + +1. Open [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds). +2. Open **Build settings**. +3. Fill in **Root directory**, **Install command**, **Build command**, and **Output directory**. + +Each placeholder reads **Auto**, and the note under them says **Leave a field empty and the builder decides from the detected framework.** **Detect build settings** runs detection against your repo and offers ranked candidates with an **Apply** button. ## Variables during a build @@ -171,7 +178,7 @@ sf builds logs bld_7c3e0a19d84b42f0916d5ac8b7e21f34 --follow -**Builds** lists runs newest first under **Runs**. Open one for the log pane, which says **Streaming while the build runs.** while it is live. The meta strip carries **Source**, **Commit**, **Started**, **Duration**, **Artifact**, and either **Will become** or **Produced**. **Cancel** and **Retry build** are in the header. +[**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) lists runs newest first under **Runs**. Open one for the log pane, which says **Streaming while the build runs.** while it is live. The meta strip carries **Source**, **Commit**, **Started**, **Duration**, **Artifact**, and either **Will become** or **Produced**. **Cancel** and **Retry build** are in the header. @@ -247,4 +254,4 @@ Server-rendered builds also work on Next 15.5.29 and later 15.5 releases without ## Next steps -Start with the [plain HTML recipe](/guides/recipes/html) for an exported page. If a build fails, use [Troubleshooting](/troubleshooting) and [`sf builds logs`](/cli/reference#sf-builds-logs-build) to inspect the failure. +Start with the [plain HTML recipe](/guides/recipes/html) for an exported page. If a build fails, use [Troubleshooting](/troubleshooting) and [`sf builds logs`](/cli/reference/builds#sf-builds-logs-build) to inspect the failure. diff --git a/content/guides/index.mdx b/content/guides/index.mdx index 0c7cd795..ca816e9c 100644 --- a/content/guides/index.mdx +++ b/content/guides/index.mdx @@ -7,13 +7,22 @@ Start a new Space from a starter template, wire a full-stack app in one Space, c ## Build your first full-stack Space -Go from an empty folder to a live Space with a database-backed form, outbound email, and a share link in five steps: +Use a signed-in [CLI](/cli), a team with SpacePress enabled, and a custom domain you control for the form’s email notifications. -1. Scaffold the project with [`sf init`](/cli/reference#sf-init-name) and add a form starter with [`sf add form`](/cli/reference#sf-add-recipe-directory) ([Starters and templates](/guides/starters)). -2. Review the generated `contactMessages` table and `sendContactMessage` mutation in `sp/contact.ts` (and the form in `sp/app/contact/page.tsx`; see [Actions and forms](/actions)), then inspect stored rows with [`sf db`](/database). -3. Attach a custom domain if the form sends [Transactional email](/email). -4. Validate offline with [`sf check`](/cli/reference#sf-check-dir) and ship with [`sf publish`](/cli/reference#sf-publish-dir) ([Publishing](/publish)). -5. Keep the Space private by default or create a viewer link in [Share and access](/share). +1. Create the project and add the [contact form starter](/guides/starters). + + ```bash + sf init my-space + cd my-space + sf add form + ``` + +2. Set the `to` address in `sp/contact.ts` to your inbox. Run `sf check`, then `sf publish` from the project directory. +3. Attach your domain, make it primary, and [verify its DKIM records](/email#set-up-your-sending-domain). Wait until the sending domain is ready. +4. Open `/contact` on your Space. Submit a message you can recognize, such as `First form test`. Check your inbox for the notification. +5. Run `sf db tables` to find the table for `contactMessages`. Use the name it prints in `sf db rows list TABLE` and look for your message. See [Inspect tables and rows](/database#inspect-tables-and-rows). + +To let someone else try the form, [create a viewer link](/share). ## Starters diff --git a/content/guides/migrate-from/cloudflare-pages.mdx b/content/guides/migrate-from/cloudflare-pages.mdx index d780c3c8..20a64d9b 100644 --- a/content/guides/migrate-from/cloudflare-pages.mdx +++ b/content/guides/migrate-from/cloudflare-pages.mdx @@ -13,6 +13,7 @@ Your `_redirects` and `_headers` files publish with your pages as optional migra ```bash sf spaces create --slug my-space + sf share set --space my-space --level private ``` @@ -36,8 +37,13 @@ Your `_redirects` and `_headers` files publish with your pages as optional migra Move each Pages function to the [Functions file router](/functions#the-functions-file-router). See the next section. + + For a public site, [set access to Public](/share#make-a-space-public), then open the homepage and a deep link while signed out. For a private site, first confirm neither address shows the page while signed out. Then open a [viewer link](/share#create-a-share-link) that covers both paths and confirm they load. + Add the domain to the Space and add the DNS records it asks for. Delete the old address records, because a leftover record blocks verification. If a proxy sits in front of the hostname, check that it does not block the HTTP validation request. Spacefast issues the certificate once DNS points at it. See [Custom domains](/domains) and [TLS certificates](/infrastructure/tls-certificates). + + Once the certificate is active, repeat both checks on your custom domain. @@ -81,7 +87,3 @@ Requests and responses are the standard `Request` and `Response`, so code inside - **`cloudflare-cdn-cache-control`** and the other CDN-specific cache headers are rejected with `header_cdn_cache_unsupported`. Spacefast manages shared caching; `Cache-Control` still applies to browsers. See [Caching](/caching). - **`_routes.json`** and the `.wrangler` folder are dropped at publish. See [what gets uploaded](/publish#what-gets-uploaded). - **Features Spacefast cannot convert** are flagged at publish. Move them to a supported equivalent, or pass `--allow-unsupported-platform-features` to publish without them. - -## Choose who can open it - -A team's new Spaces start private unless the team changed its default. Make the Space public, or share it with a link, in [Spacefast Share](/share). diff --git a/content/guides/migrate-from/github-pages.mdx b/content/guides/migrate-from/github-pages.mdx index 9c645dbc..30a89480 100644 --- a/content/guides/migrate-from/github-pages.mdx +++ b/content/guides/migrate-from/github-pages.mdx @@ -9,7 +9,14 @@ Connect the repository and Spacefast builds it on every push to the production b - In the dashboard, open the Space's **Builds** page, click **Connect GitHub**, and pick the repository. If it is missing from the list, **Add repositories** takes you to GitHub to grant the Spacefast app access to it. + In the dashboard: + + 1. Create a new Space, or open an existing one. + 2. Open the Space's [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) page. + 3. Click **Connect GitHub**. + 4. Pick the repository. + + If it is missing from the list, **Add repositories** takes you to GitHub to grant the Spacefast app access to it. From the CLI, create the Space, then connect it: @@ -44,6 +51,6 @@ Connect the repository and Spacefast builds it on every push to the production b - **Previews.** Pushes to other branches and pull requests build previews with their own alias, alongside the production branch. - **Overrides.** Set `build` options in `spacefast.config.ts` (see [Project configuration](/config-file)), or set **Root directory**, **Install command**, **Build command**, or **Output directory** under **Build settings**. -- **Logs.** Every run is listed under **Runs** on the **Builds** page, with its log. +- **Logs.** Every run is listed under **Runs** on the [**Builds**](https://my.spacefast.com/?to=/:team/:space/builds) page, with its log. To publish from GitHub Actions instead of a connected repository, see [Publish from CI](/ci). diff --git a/content/guides/migrate-from/index.mdx b/content/guides/migrate-from/index.mdx index 60d428a0..7f58f87f 100644 --- a/content/guides/migrate-from/index.mdx +++ b/content/guides/migrate-from/index.mdx @@ -27,5 +27,5 @@ Most projects move with one publish. Spacefast builds the same source, reads the 1. **Publish it.** Hand Spacefast the source and let it build, so it reads your old platform's config file, or publish the built output. Set environment variables on the Space before the first build. See [Frameworks and builds](/guides/frameworks). 2. **Check what was flagged.** Platform features Spacefast cannot convert are flagged at publish. Move them to a supported equivalent, or pass `--allow-unsupported-platform-features` to publish without them. -3. **Choose who can open it.** A team's new Spaces start private unless the team changed its default. Make the Space public or create a share link with [Spacefast Share](/share). -4. **Point your domain.** Add the domain to the Space and add the DNS records it asks for. Delete the address records that point at your old platform, because a leftover record blocks verification. Spacefast issues the certificate once DNS points at it. See [Custom domains](/domains). +3. **Choose who can open it.** A team's new Spaces start private unless the team changed its default. Make the Space public or create a share link with [Spacefast Share](/share). For a public site, open the Live URL signed out and test the homepage and a deep link. +4. **Point your domain.** Add the domain to the Space and add the DNS records it asks for. Delete the address records that point at your old platform, because a leftover record blocks verification. Spacefast issues the certificate once DNS points at it. Once the certificate is active, repeat both checks on your custom domain. See [Custom domains](/domains). diff --git a/content/guides/migrate-from/netlify.mdx b/content/guides/migrate-from/netlify.mdx index 01c89b5d..6c3c722d 100644 --- a/content/guides/migrate-from/netlify.mdx +++ b/content/guides/migrate-from/netlify.mdx @@ -13,6 +13,7 @@ Spacefast reads `netlify.toml` and any optional `_redirects` and `_headers` file ```bash sf spaces create --slug my-space + sf share set --space my-space --level private ``` @@ -36,8 +37,13 @@ Spacefast reads `netlify.toml` and any optional `_redirects` and `_headers` file Anything Spacefast cannot convert is flagged at publish. Move it to a supported equivalent, or pass `--allow-unsupported-platform-features` to publish without it. + + For a public site, [set access to Public](/share#make-a-space-public), then open the homepage and a deep link while signed out. For a private site, first confirm neither address shows the page while signed out. Then open a [viewer link](/share#create-a-share-link) that covers both paths and confirm they load. + Add the domain to the Space and add the DNS records it asks for. Delete the address records that point at Netlify, because a leftover record blocks verification. Spacefast issues the certificate once DNS points at it. See [Custom domains](/domains). + + Once the certificate is active, repeat both checks on your custom domain. @@ -67,7 +73,3 @@ The full rules for build detection are on [Frameworks and builds](/guides/framew - **Netlify Functions and edge functions.** Move request handling to a [Functions](/functions) route or a supported framework's server. Edge functions are flagged at publish. - **`netlify-cdn-cache-control`** is rejected with `header_cdn_cache_unsupported`. Spacefast manages shared caching; `Cache-Control` still applies to browsers. See [Caching](/caching). - **The `.netlify` folder** is dropped at publish, along with `node_modules` and `.env` files. See [what gets uploaded](/publish#what-gets-uploaded). - -## Choose who can open it - -A team's new Spaces start private unless the team changed its default. Make the Space public, or share it with a link, in [Spacefast Share](/share). diff --git a/content/guides/migrate-from/vercel.mdx b/content/guides/migrate-from/vercel.mdx index 1a05e91b..cf8e4d66 100644 --- a/content/guides/migrate-from/vercel.mdx +++ b/content/guides/migrate-from/vercel.mdx @@ -13,6 +13,7 @@ Spacefast reads `vercel.json`, converts its routing rules and crons, and runs su ```bash sf spaces create --slug my-app + sf share set --space my-app --level private ``` @@ -36,8 +37,13 @@ Spacefast reads `vercel.json`, converts its routing rules and crons, and runs su Anything Spacefast cannot convert, such as Vercel functions, is flagged at publish. Move it to a supported equivalent, or pass `--allow-unsupported-platform-features` to publish without it. + + For a public site, [set access to Public](/share#make-a-space-public), then open the homepage and a deep link while signed out. For a private site, first confirm neither address shows the page while signed out. Then open a [viewer link](/share#create-a-share-link) that covers both paths and confirm they load. + Add the domain to the Space and add the DNS records it asks for. Delete the address records that point at Vercel, because a leftover record blocks verification. Spacefast issues the certificate once DNS points at it. See [Custom domains](/domains). + + Once the certificate is active, repeat both checks on your custom domain. @@ -84,7 +90,3 @@ Older releases have known security vulnerabilities, so they are refused before a - **Vercel functions** are flagged at publish. Move request handling to a [Functions](/functions) route or a supported framework's server. - **The `.vercel` folder** is dropped at publish, along with `node_modules` and `.env` files. See [what gets uploaded](/publish#what-gets-uploaded). - -## Choose who can open it - -A team's new Spaces start private unless the team changed its default. Make the Space public, or share it with a link, in [Spacefast Share](/share). diff --git a/content/guides/migrate.mdx b/content/guides/migrate.mdx index fe867f46..cd53a4ce 100644 --- a/content/guides/migrate.mdx +++ b/content/guides/migrate.mdx @@ -51,7 +51,7 @@ sf migrate URL [--team ] [--name ] [--idempotency-key ] | `--wait-timeout=` | `900` | Seconds to wait for the capture and the publish. Minimum 1 | | `--show-secret` | off | Print the **Open** and **Claim** links in JSON or non-interactive output | -The global flags (`--api-url`, `--profile`, `--token`, `-y`, `--json`) also apply. See [`sf migrate`](/cli/reference#sf-migrate-url) and [the CLI overview](/cli). +The global flags (`--api-url`, `--profile`, `--token`, `-y`, `--json`) also apply. See [`sf migrate`](/cli/reference/migrate#sf-migrate-url) and [the CLI overview](/cli). ## Choose what the URL can be @@ -118,7 +118,7 @@ sf migrate https://example.com --idempotency-key 5f0c6a1e-8a51-4c3b-9d1e-2a7f4b6 Use the same URL, `--team`, `--name`, and credential as the first run. The CLI keeps each attempt under `~/.spacefast/migrations/`, and a repeat with matching inputs resumes it without a new capture. When a run fails after the request starts, the error prints the repeat command. -To return at once and check later, pass `--no-wait`. The receipt has the build ID. Follow it with [`sf builds logs`](/cli/reference#sf-builds-logs-build), or repeat the run with the key. +To return at once and check later, pass `--no-wait`. The receipt has the build ID. Follow it with [`sf builds logs`](/cli/reference/builds#sf-builds-logs-build), or repeat the run with the key. ## Finish the move diff --git a/content/guides/starters.mdx b/content/guides/starters.mdx index 0d66ce3a..f51678d4 100644 --- a/content/guides/starters.mdx +++ b/content/guides/starters.mdx @@ -53,7 +53,7 @@ sf init my-space --dry-run --json `sf init` prints its plan to stderr before writing. Adding an app starter to a non-empty directory asks for confirmation unless you pass `--yes`. `--template static` writes one file and never prompts. Both paths refuse symbolic links, refuse to write outside the current directory, and roll back a newly created directory if initialization fails. -See [`sf init`](/cli/reference#sf-init-name) for the full flag reference and [Project configuration](/config-file) for `spacefast.config.ts`. +See [`sf init`](/cli/reference/init#sf-init-name) for the full flag reference and [Project configuration](/config-file) for `spacefast.config.ts`. ## Add starter code with `sf add` @@ -100,7 +100,7 @@ printf %s "$OPENAI_API_KEY" | sf env set OPENAI_API_KEY --value-from-stdin If every file in a recipe already exists and you omit `--force`, `sf add` reports `no-op` and changes nothing. It checks the whole target tree before writing and refuses symbolic links, missing directories, and Zero projects you have not migrated yet. Migrate Zero projects first with [`sf migrate app --from zero`](/zero-migration). -See [`sf add`](/cli/reference#sf-add-recipe-directory) for the full command specification. +See [`sf add`](/cli/reference/add#sf-add-recipe-directory) for the full command specification. ## Next steps diff --git a/content/index.mdx b/content/index.mdx index e08eb3e3..c899b31e 100644 --- a/content/index.mdx +++ b/content/index.mdx @@ -1,11 +1,11 @@ --- title: Spacefast -description: Build better and ship with Spacefast — skills, database, Workers, auth, domains, and infrastructure in one Space +description: "Build better and ship with Spacefast: skills, database, Workers, auth, domains, and infrastructure in one Space" --- Spacefast is the build companion and infrastructure for you and your AI. Connect it before you start so your agent ships straight to one Space — database, Workers, auth, and domains included — without wiring five separate services together. -Publish with your AI, drag a folder onto [drop.fast](https://drop.fast) (no install, no account required; see [Drop](/publish#publish)), push to `push.fast`, or run the CLI. Already have a website? Paste its address into the [website importer](https://spacefast.com/migrate/) to copy it into a Space; see [Copy a website](/guides/migrate). +Publish with your AI, drag a folder onto [drop.fast](https://drop.fast) (no install, no account required; see [Drop](/publish#drop)), push to [`push.fast`](/git), or run the CLI. Already have a website? Paste its address into the [website importer](https://spacefast.com/migrate/) to copy it into a Space; see [Copy a website](/guides/migrate). @@ -23,13 +23,21 @@ Your AI connects to Spacefast, loads Spacefast skills, and builds and publishes ### From your terminal -Scaffold a Space or publish a folder directly with `npx`: +Set up Spacefast and publish this project with `npx`: + +```bash +npx spacefast setup +``` + +`spacefast setup` signs you in and offers to install the `sf` CLI and the plugins or skills for the agents it finds before asking whether to publish this project. + +Want to try it without setting up? Publish a folder directly: ```bash npx -y spacefast publish ./dist ``` -No account or global install is required for your first publish. Spacefast creates a Space, uploads changed files, and prints a live URL plus a claim link. Sign in later to keep it, or install the `sf` CLI globally with `npm install -g spacefast`. See [`sf publish`](/cli/reference#sf-publish-dir) and [`sf init`](/cli/reference#sf-init-name). +No account is required. Spacefast creates a Space, uploads changed files, and prints a live URL plus a claim link. Sign in later to keep it. See [`sf setup`](/cli/reference/setup#sf-setup), [`sf publish`](/cli/reference/publish#sf-publish-dir), and [`sf init`](/cli/reference/init#sf-init-name). ### From Git or a browser diff --git a/content/platforms/api/meta.ts b/content/platforms/api/meta.ts index 40d03d6e..caf3f170 100644 --- a/content/platforms/api/meta.ts +++ b/content/platforms/api/meta.ts @@ -1,5 +1,5 @@ import { defineMeta } from "blume"; -// The Partner API reference mounts here. Keep the API group open; its -// Reference group and operation tags stay collapsed. +// The Partner API reference mounts here. components/sections.ts folds it into +// the Partner API group as "API reference", so this title shows in breadcrumbs only. export default defineMeta({ title: "API", collapsed: false }); diff --git a/content/platforms/index.mdx b/content/platforms/index.mdx index 9cc332a8..660a0233 100644 --- a/content/platforms/index.mdx +++ b/content/platforms/index.mdx @@ -5,7 +5,7 @@ description: Sell Spacefast infrastructure under your own brand. You keep the cu Spacefast for Platforms is for platforms, domain registrars, agencies, and organizations that run Spaces at scale. You put Spacefast infrastructure inside your own product. Customers see your brand, your prices, and your dashboard, and you don't run any servers. -Spacefast runs on the same infrastructure as WordPress.com and Pressable. The [Partner API](/platforms/partner-api) brings the Spaces and apps your customers build — with agents or by hand — onto that infrastructure under your own name. +Spacefast runs on the same infrastructure as WordPress.com and Pressable. The [Partner API](/platforms/partner-api) brings the Spaces and apps your customers build, with agents or by hand, onto that infrastructure under your own name. Tell us what you want to sell and who you sell it to. We'll set up your partner account. diff --git a/content/platforms/partner-api/go-live.mdx b/content/platforms/partner-api/go-live.mdx index 1b0b7a0c..8f176c95 100644 --- a/content/platforms/partner-api/go-live.mdx +++ b/content/platforms/partner-api/go-live.mdx @@ -1,6 +1,8 @@ --- title: Promote a partner integration to live description: Test failure handling, promote configuration, and verify live publishing and event delivery. +sidebar: + label: Go live --- Test and live are separate tenants with separate credentials and resources. Promotion copies system configuration. It does not turn sandbox customers or Spaces into live resources. diff --git a/content/platforms/partner-api/index.mdx b/content/platforms/partner-api/index.mdx index 02d65269..00e35f99 100644 --- a/content/platforms/partner-api/index.mdx +++ b/content/platforms/partner-api/index.mdx @@ -39,7 +39,7 @@ Set `IDEMPOTENCY_KEY` to a fresh UUID for each new Space and reuse it only to re Save `data.space.id`. Spacefast creates the customer principal when it first owns a resource. There is no separate customer registration call. -Publish content to that Space with the [publish flow](/publish) or [`sf publish --space`](/cli/reference#sf-publish-dir). Test tenants simulate provisioning. A test result does not prove that a live hostname or certificate works. +Publish content to that Space with the [publish flow](/publish) or [`sf publish --space`](/cli/reference/publish#sf-publish-dir). Test tenants simulate provisioning. A test result does not prove that a live hostname or certificate works. ## Use the partner SDK diff --git a/scripts/build-docs-corpus.mjs b/scripts/build-docs-corpus.mjs index 8277e6b5..60ab89ac 100644 --- a/scripts/build-docs-corpus.mjs +++ b/scripts/build-docs-corpus.mjs @@ -8,7 +8,8 @@ const DOCS_BASE = "/docs"; const ESSENTIAL_PATHS = new Set([ "/", "/agents", - "/anonymous-and-claim", + "/agents/anonymous-and-claim", + "/build", "/publish", "/quickstart", ]); @@ -28,19 +29,22 @@ function normalizePath(url) { function pageMetadata(path) { if ( - ["/api/reference", "/partners/api/reference", "/platforms/api/reference"].some( + ["/api/reference", "/platforms/api/reference"].some( (prefix) => path === prefix || path.startsWith(`${prefix}/`), ) ) return { kind: "api", tier: "reference" }; - if (path === "/api") return { kind: "api", tier: "full" }; + if (path === "/api" || path.startsWith("/api/")) return { kind: "api", tier: "full" }; + if (path === "/cli/reference" || path.startsWith("/cli/reference/")) { + return { kind: "cli", tier: "reference" }; + } if (path === "/cli" || path.startsWith("/cli/")) return { kind: "cli", tier: "full" }; if (path === "/errors" || path.startsWith("/errors/")) { return { kind: "error", tier: "reference" }; } - if (path === "/agents" || path === "/anonymous-and-claim" || path === "/publish") { + if (path === "/agents" || path === "/agents/anonymous-and-claim" || path === "/publish") { return { kind: "workflow", tier: ESSENTIAL_PATHS.has(path) ? "essential" : "full" }; } - if (path.startsWith("/recipes/")) return { kind: "recipe", tier: "full" }; + if (path.startsWith("/guides/recipes/")) return { kind: "recipe", tier: "full" }; return { kind: "guide", tier: ESSENTIAL_PATHS.has(path) ? "essential" : "full" }; } diff --git a/scripts/build-docs-corpus.test.mjs b/scripts/build-docs-corpus.test.mjs index 691eed41..1f5974ff 100644 --- a/scripts/build-docs-corpus.test.mjs +++ b/scripts/build-docs-corpus.test.mjs @@ -41,16 +41,38 @@ test("turns Blume's agent-readable output into ranked corpus records", () => { assert.match(pages[1].body, /## Install/u); }); -test("includes the Partner API at the reference tier", () => { - const pages = parseLlmsFull(`# Partner API -Source: https://spacefast.com/docs/partners/api/reference +test("classifies moved IA routes, API guides, and generated references into the right kind and tier", () => { + const cases = [ + ["/", "guide", "essential"], + ["/quickstart", "guide", "essential"], + ["/build", "guide", "essential"], + ["/agents", "workflow", "essential"], + ["/agents/anonymous-and-claim", "workflow", "essential"], + ["/publish", "workflow", "essential"], + ["/guides/recipes/astro", "recipe", "full"], + ["/api", "api", "full"], + ["/api/authentication", "api", "full"], + ["/api/reference/spaces/getspace", "api", "reference"], + ["/platforms/api/reference", "api", "reference"], + ["/cli", "cli", "full"], + ["/cli/reference", "cli", "reference"], + ["/cli/reference/publish", "cli", "reference"], + ["/errors/rate_limited", "error", "reference"], + ]; -Tenant and customer operations. -`); - assert.deepEqual( - pages.map(({ path, tier }) => ({ path, tier })), - [{ path: "/partners/api/reference", tier: "reference" }], - ); + const source = cases + .map( + ([route]) => + `# Page ${route}\nSource: https://spacefast.com/docs${route === "/" ? "" : route}\n\nSummary text for ${route}.`, + ) + .join("\n---\n"); + + const byPath = new Map(parseLlmsFull(source).map((page) => [page.path, page])); + for (const [route, kind, tier] of cases) { + const page = byPath.get(route); + assert.ok(page, `missing parsed page for ${route}`); + assert.deepEqual({ kind: page.kind, tier: page.tier }, { kind, tier }, route); + } }); test("writes a versioned corpus artifact", async () => { diff --git a/scripts/build-llms-index.mjs b/scripts/build-llms-index.mjs index 050488c2..b704a93f 100644 --- a/scripts/build-llms-index.mjs +++ b/scripts/build-llms-index.mjs @@ -31,6 +31,7 @@ const DOCS_ROOT = `${SITE}${deploymentBase}`; // "## Other" would defeat any heading-based filter. Route is the stable signal. const COLLAPSED_ROOTS = [ "/errors", + "/cli/reference", "/api/reference", "/platforms/api/reference", "/partners/api/reference", diff --git a/scripts/cli-command-pages.mjs b/scripts/cli-command-pages.mjs new file mode 100644 index 00000000..74b169ae --- /dev/null +++ b/scripts/cli-command-pages.mjs @@ -0,0 +1,39 @@ +// Splits the generated CLI reference into one page per top-level command. +// /cli/reference keeps the whole reference and every anchor; these pages carry +// the same sections under /cli/reference/, so a heading's anchor is +// the same on both. + +const commandHeading = /^## `sf ([a-z0-9][a-z0-9-]*)[^`\n]*`[ \t]*$/u; + +export function commandPages(reference) { + const lines = reference.split("\n"); + const sections = []; + let fenceLength = 0; + for (const line of lines) { + if (fenceLength === 0) { + const open = /^(`{3,})[^`]*$/u.exec(line); + if (open) fenceLength = open[1].length; + } else { + const close = /^(`{3,})[ \t]*$/u.exec(line); + if (close && close[1].length >= fenceLength) fenceLength = 0; + } + const topic = fenceLength > 0 ? undefined : commandHeading.exec(line)?.[1]; + if (topic) sections.push({ topic, lines: [] }); + sections.at(-1)?.lines.push(line); + } + if (sections.length === 0) throw new Error("The CLI reference has no `sf` command sections."); + + const pages = new Map(); + for (const { topic, lines: body } of sections) { + const page = pages.get(topic) ?? { topic, summary: body.slice(1).find((line) => line.trim() !== "")?.trim(), body: [] }; + page.body.push(body.join("\n").trimEnd()); + pages.set(topic, page); + } + return [...pages.values()].map(({ topic, summary, body }) => { + if (!summary || summary.startsWith("```")) throw new Error(`\`sf ${topic}\` has no summary line.`); + return { + topic, + content: `---\ntitle: sf ${topic}\ndescription: ${JSON.stringify(summary)}\nslug: cli/reference/${topic}\n---\n\n${body.join("\n\n")}\n`, + }; + }); +} diff --git a/scripts/cli-command-pages.test.mjs b/scripts/cli-command-pages.test.mjs new file mode 100644 index 00000000..5fcbe7c0 --- /dev/null +++ b/scripts/cli-command-pages.test.mjs @@ -0,0 +1,70 @@ +import assert from "node:assert/strict"; +import test from "node:test"; + +import { commandPages } from "./cli-command-pages.mjs"; + +const reference = [ + "---", + "title: CLI reference", + "---", + "", + "## Commands", + "", + "- [`sf domains`](#sf-domains)", + "", + "## `sf domains`", + "", + "Manage domains.", + "", + "```text", + "## `sf not-a-heading`", + "```", + "", + "## `sf domains add HOSTNAME`", + "", + "Add a domain.", + "", + "## `sf whoami`", + "", + 'Show the "current" account: yours.', + "", +].join("\n"); + +test("groups command sections into one page per top-level command", () => { + const pages = commandPages(reference); + assert.deepEqual(pages.map(({ topic }) => topic), ["domains", "whoami"]); + + const [domains, whoami] = pages; + assert.match(domains.content, /^---\ntitle: sf domains\ndescription: "Manage domains\."\nslug: cli\/reference\/domains\n---\n/u); + assert.match(domains.content, /## `sf domains`[\s\S]+## `sf domains add HOSTNAME`\n\nAdd a domain\.\n$/u); + assert.ok(domains.content.includes("## `sf not-a-heading`"), "a heading inside a code block stays in its section"); + assert.ok(!domains.content.includes("## Commands"), "the reference preamble is not repeated"); + assert.match(whoami.content, /description: "Show the \\"current\\" account: yours\."/u); +}); + +test("tracks fence length so nested backtick fences do not swallow later commands", () => { + const nested = [ + "## `sf first`", + "", + "First summary.", + "", + "````markdown", + "```bash", + "## `sf fake`", + "```", + "````", + "", + "## `sf second`", + "", + "Second summary.", + "", + ].join("\n"); + + const pages = commandPages(nested); + assert.deepEqual(pages.map(({ topic }) => topic), ["first", "second"]); + assert.ok(pages[0].content.includes("## `sf fake`")); +}); + +test("refuses a reference without command sections", () => { + assert.throws(() => commandPages("---\ntitle: CLI reference\n---\n\nNothing here.\n"), /no `sf` command sections/u); +}); diff --git a/scripts/docs-experience.test.mjs b/scripts/docs-experience.test.mjs index d3cfc977..d42b9a75 100644 --- a/scripts/docs-experience.test.mjs +++ b/scripts/docs-experience.test.mjs @@ -42,10 +42,10 @@ test("a browser-first reader sees Drop before the CLI install on the homepage", const home = await builtPage("/"); const publish = await builtPage("/publish"); const drop = home.indexOf("no install, no account required"); - const install = home.indexOf("npm install -g spacefast"); - assert.ok(drop >= 0 && install > drop, "show Drop before the install command"); - assert.match(home, /\[Drop\]\(\/docs\/publish\/#publish\)/u); - assert.match(publish.replaceAll("**", ""), /Drop takes a folder/iu); + const install = home.indexOf("npx spacefast setup"); + assert.ok(drop >= 0 && install > drop, "show Drop before the CLI command"); + assert.match(home, /\[Drop\]\(\/docs\/publish\/#drop\)/u); + assert.match(publish.replaceAll("**", ""), /^## Drop\n+Drop takes a folder/mu); }); test("Quickstart gives a no-install route before the CLI steps", async () => { @@ -53,7 +53,7 @@ test("Quickstart gives a no-install route before the CLI steps", async () => { const drop = quickstart.indexOf("Don't want to install anything?"); const install = quickstart.indexOf("Install the CLI"); assert.ok(drop >= 0 && install > drop, "offer Drop before CLI instructions"); - assert.match(quickstart.slice(drop, install), /\[Drop\]\(\/docs\/publish\/#publish\)/u); + assert.match(quickstart.slice(drop, install), /\[Drop\]\(\/docs\/publish\/#drop\)/u); }); test("unfamiliar homepage terms have a linked glossary with definitions", async () => { @@ -128,3 +128,18 @@ for (const { route, question, evidence } of firstFactCases) { for (const pattern of evidence) assert.match(lead, pattern); }); } + +test("each CLI command has the same anchor in the full and family references", async () => { + const index = await builtPage("/cli/reference"); + const commands = [...index.matchAll(/^- \[`sf ([a-z0-9-]+)[^`]*`\]\(#(sf-[a-z0-9-]+)\)/gmu)]; + assert.ok(commands.length > 0, "the full reference lists its commands"); + const readHtml = (route) => readFile(path.join(dist, route, "index.html"), "utf8"); + const full = await readHtml("cli/reference"); + const families = new Map(); + for (const [, topic, anchor] of commands) { + if (!families.has(topic)) families.set(topic, await readHtml(`cli/reference/${topic}`)); + for (const html of [full, families.get(topic)]) { + assert.ok(html.includes(`id="${anchor}"`), `missing anchor ${anchor} for sf ${topic}`); + } + } +}); diff --git a/scripts/prepare-generated.mjs b/scripts/prepare-generated.mjs index b23cf9d4..802a08f9 100644 --- a/scripts/prepare-generated.mjs +++ b/scripts/prepare-generated.mjs @@ -1,6 +1,7 @@ -import { copyFile, cp, lstat, mkdir, readdir, readFile, rename, rm, writeFile } from "node:fs/promises"; +import { copyFile, cp, lstat, mkdir, mkdtemp, readdir, readFile, rename, rm, writeFile } from "node:fs/promises"; import path from "node:path"; +import { commandPages } from "./cli-command-pages.mjs"; import { buildRoutingRules, verifyRoutingBudget } from "./redirect-rules.mjs"; import { redirects as authoredRedirects } from "../redirects.ts"; @@ -56,6 +57,43 @@ async function presentHistory(directory) { } } +// A setup page's action links ("Install from the plugin marketplace") arrive as +// a line holding one external link. Bold them like the page's one-click link, +// which theme.css draws as the primary button. +// The vendors that publish a button image for their install link, served from +// their own hosts as their docs show. Cursor has one per theme; theme.css shows +// the one that suits the page. +const officialButtons = [ + { + prefix: "https://cursor.com/install-mcp?", + images: ["https://cursor.com/deeplink/mcp-install-dark.svg", "https://cursor.com/deeplink/mcp-install-light.svg"], + }, + { prefix: "https://kiro.dev/launch/mcp/add?", images: ["https://kiro.dev/images/add-to-kiro.svg"] }, +]; + +async function presentSetupActions(directory) { + const entries = await readdir(directory, { recursive: true, withFileTypes: true }); + for (const entry of entries.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))) { + const file = path.join(entry.parentPath, entry.name); + const source = await readFile(file, "utf8"); + let fenced = false; + const presented = source + .split("\n") + .map((line) => { + if (line.startsWith("```")) fenced = !fenced; + if (fenced) return line; + return line + .replace(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/u, "**[$1]($2)**") + .replace(/^\*\*\[([^\]!]+)\]\((https?:\/\/[^)\s]+)\)\*\*/u, (action, label, href) => { + const images = officialButtons.find(({ prefix }) => href.startsWith(prefix))?.images; + return images ? `**[${images.map((src) => `![${label}](${src})`).join("")}](${href})**` : action; + }); + }) + .join("\n"); + if (presented !== source) await writeFile(file, presented); + } +} + async function presentClaudeAppSetup(directory) { let file = path.join(directory, "(featured)", "claude-app.md"); if (!(await exists(file))) { @@ -212,6 +250,7 @@ for (const tree of trees) { } } await presentClaudeAppSetup(target); + await presentSetupActions(target); } if (tree.source === "generated/connect") { await writeFile( @@ -231,6 +270,45 @@ await copyFile( path.join(root, "generated/cli/index.md"), path.join(root, "content/(reference)/cli/reference.md"), ); +// One page per top-level command, beside the full reference. +const commandsTarget = path.join(root, "content/(reference)/cli/commands"); +const commandsMarker = path.join(commandsTarget, markerName); +const replaceCommands = await exists(commandsTarget); +if (replaceCommands) { + if (!(await lstat(commandsTarget)).isDirectory() || + (await readFile(commandsMarker, "utf8").catch(() => null)) !== "spacefast-public-docs\n") { + throw new Error("refusing to replace unowned generated overlay: content/(reference)/cli/commands"); + } +} +const commands = commandPages(await readFile(path.join(root, "generated/cli/index.md"), "utf8")); +// Keep incomplete output outside the content tree. Only install a marked directory. +const staging = await mkdtemp(path.join(root, ".spacefast-cli-")); +try { + const next = path.join(staging, "commands"); + await mkdir(next); + for (const { topic, content } of commands) { + await writeFile(path.join(next, `${topic}.md`), content); + } + await writeFile( + path.join(next, "meta.ts"), + `import { defineMeta } from "blume";\n\nexport default defineMeta(${JSON.stringify({ + title: "Commands", + collapsed: true, + pages: commands.map(({ topic }) => topic), + })});\n`, + ); + await writeFile(path.join(next, markerName), "spacefast-public-docs\n"); + const previous = path.join(staging, "previous"); + if (replaceCommands) await rename(commandsTarget, previous); + try { + await rename(next, commandsTarget); + } catch (error) { + if (replaceCommands) await rename(previous, commandsTarget).catch(() => {}); + throw error; + } +} finally { + await rm(staging, { recursive: true, force: true }); +} const redirectsTarget = path.join(root, "public/_redirects"); if (await exists(redirectsTarget)) { const current = await readFile(redirectsTarget, "utf8"); diff --git a/scripts/sidebar-routes.mjs b/scripts/sidebar-routes.mjs index 22879d38..b574231f 100644 --- a/scripts/sidebar-routes.mjs +++ b/scripts/sidebar-routes.mjs @@ -12,6 +12,7 @@ const GENERATED_ROUTES = [ ]; const GENERATED_DIRECTORIES = new Set([ "content/(reference)/changelog", + "content/(reference)/cli/commands", "content/(reference)/errors", "content/connect", "content/setup", diff --git a/scripts/verify-routes.mjs b/scripts/verify-routes.mjs index 8188da92..15689206 100644 --- a/scripts/verify-routes.mjs +++ b/scripts/verify-routes.mjs @@ -151,6 +151,7 @@ const representativePages = [ ["api/reference/index.html", `${docsRoot}/api/reference`, "Spacefast API"], ["cli/index.html", `${docsRoot}/cli`, "Global flags"], ["cli/reference/index.html", `${docsRoot}/cli/reference`, "CLI reference"], + ["cli/reference/domains/index.html", `${docsRoot}/cli/reference/domains`, "sf domains add"], ["errors/index.html", `${docsRoot}/errors`, "Error reference"], ["errors/rate_limited/index.html", `${docsRoot}/errors/rate_limited`, "rate_limited"], ["zero-migration/index.html", `${docsRoot}/zero-migration`, "Zero 0.8"], @@ -323,7 +324,7 @@ for (const [file, prev, next] of [ ["spaces/index.html", "/quickstart", "/request-lifecycle"], ["agents/mcp-server/index.html", "/agents", "/agents/poppy"], ["setup/vscode/index.html", "/setup/windsurf", "/setup/github-copilot"], - ["api/index.html", "/cli/reference", "/api/authentication"], + ["api/index.html", "/cli/reference/whoami", "/api/authentication"], ]) { const pager = (await readBuilt(file)).split("").at(-1); const links = [...pager.matchAll(/]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gu)]; @@ -413,7 +414,7 @@ for (const route of llmsRoutes) { } // Each collapsed family contributes its index page and nothing more. This is // what stops the "## Other" pile from quietly returning. -for (const collapsed of ["/errors", "/api/reference", "/changelog", "/setup", "/connect"]) { +for (const collapsed of ["/errors", "/cli/reference", "/api/reference", "/changelog", "/setup", "/connect"]) { const descendants = [...llmsRoutes].filter((route) => route.startsWith(`${collapsed}/`)); const unexpected = descendants.filter((route) => !requiredIaRoutes.includes(route)); if (unexpected.length > 0) { diff --git a/theme.css b/theme.css index 96806f56..0c746e16 100644 --- a/theme.css +++ b/theme.css @@ -39,6 +39,75 @@ color: var(--sf-ink); } +/* + * Five tabs, the wordmark, and the header actions need about 1080px side by + * side. Blume shows the tab bar from `md`, where the wordmark ran over it, so + * keep the tabs in the drawer until `lg`. + */ +@media (min-width: 768px) and (max-width: 1023.98px) { + [data-blume-header] > nav { + display: none; + } + + #blume-nav-drawer nav[class~="md:hidden"] { + display: block; + } +} + +/* + * A setup page's one-click link ("Add to Cursor") is its primary action, so it + * is drawn as the brand's primary button, like the header's. The generated + * Markdown writes it as a bold link that opens a paragraph. + */ +.prose p > strong:first-child > a[data-blume-external] { + display: inline-flex; + align-items: center; + gap: 0.375rem; + margin-inline-end: 0.375rem; + padding: 0.5rem 1.125rem; + border-radius: 999px; + background: var(--sf-green); + color: var(--sf-ink); + font-weight: 500; + text-decoration: none; + transition: opacity 140ms ease; +} + +.prose p > strong:first-child > a[data-blume-external]:hover { + opacity: 0.85; +} + +/* One primary button a page: the action links after it are outlined. */ +.prose p:has(> strong:first-child > a[data-blume-external]) ~ p > strong:first-child > a[data-blume-external] { + background: transparent; + color: var(--blume-foreground); + box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--blume-foreground) 35%, transparent); +} + +/* + * A vendor's own button image (Cursor, Kiro) is the whole button: no pill + * around it. Cursor publishes a dark button for light pages and a light one for + * dark pages. + */ +.prose p > strong:first-child > a[data-blume-external]:has(img) { + padding: 0; + border-radius: 0; + background: none; + box-shadow: none; + vertical-align: middle; +} + +.prose p > strong:first-child > a[data-blume-external] img { + height: 2.25rem; + width: auto; + margin: 0; +} + +:root:not([data-theme="dark"]) .prose a img[src$="/mcp-install-light.svg"], +:root[data-theme="dark"] .prose a img[src$="/mcp-install-dark.svg"] { + display: none; +} + /* * Headings follow the brand's type scale: Medium for display sizes, slight * negative tracking, no serif. @@ -84,6 +153,11 @@ font-weight: 500; } +/* The API reference sits inside its API group but reads as a section of its own. */ +[data-blume-nav-tree] summary.blume-nav-summary:has(> a:is([href$="/api/reference"], [href$="/api/reference/"])) { + color: var(--blume-foreground); +} + [data-blume-nav-tree] > ul > li > details[open] > summary.blume-nav-summary { margin-bottom: 0.25rem; }