Docs Cloud
Docs Cloud is the hosted layer around @farming-labs/docs. Your repository stays the source of
truth, your docs app still owns the runtime, and Cloud adds managed deploys, analytics, publish
workflows, and agent operations around it.
The Cloud contract has three parts:
docs.config.tsstays the executable config for the docs runtime.docs.jsonis the serializable project contract that Cloud can read.- Docs Cloud owns hosted services such as deploys, analytics storage, and publish workflows.
Cloud access
Docs Cloud is rolling out gradually. If your workspace does not have access yet, join the Cloud waitlist. Once access is enabled, create the API key from your Docs Cloud project settings.
Cloud Sections
| Page | Use it for |
|---|---|
| Deploy | API keys, docs deploy, preview deploys, publish mode, and deploy troubleshooting |
| Analytics | Cloud analytics storage, project identity, privacy defaults, and optional customer callbacks |
| docs.json | The repo-level contract that Cloud reads |
| CLI | The complete command reference |
Minimal Config
Add a cloud block when the project should participate in Cloud-aware CLI flows:
import { defineDocs } from "@farming-labs/docs";
export default defineDocs({
entry: "docs",
cloud: {
apiKey: { env: "DOCS_CLOUD_API_KEY" },
deploy: { enabled: true },
publish: { mode: "draft-pr", baseBranch: "main" },
},
});cloud.apiKey.env names the environment variable that stores the project API key. The raw key stays
outside source control.
Sync The Contract
Run cloud sync to write the serializable Cloud contract:
pnpm dlx @farming-labs/docs cloud syncdocs.json is safe to commit because it contains configuration and environment variable names, not
secret values.
Check Before Deploy
Run a read-only check when you want to validate Cloud wiring without creating a preview:
pnpm dlx @farming-labs/docs cloud checkUse --analytics, --ask-ai, or --deploy when you only want to validate one part of the Cloud
setup. The check reports stale docs.json, missing project/API key env vars, hosted API reachability,
and CORS issues before you spend time on a deploy.
Next Step
Use the deploy page for the full preview flow:
pnpm dlx @farming-labs/docs deploySee Deploy for API key setup, command options, preview behavior, publish mode, and troubleshooting.
Related Docs
- Deploy covers hosted preview deployments.
- Analytics covers Cloud-managed analytics storage.
- docs.json explains the repo-level contract that Cloud reads.
- Configuration lists the
cloudconfig fields. - CLI covers the full command surface.
- Cloud landing page explains the managed product direction and waitlist.
Overview of Docs Cloud projects, deploys, analytics, and the docs.json contract
How is this guide?