Skip to Content
New to cms0? Start with the hosted, self-hosted, or app integration path.
CLIConfiguration

The CLI searches upward from the current working directory for:

  • cms0.config.ts
  • cms0.config.js
  • cms0.config.mjs
  • cms0.config.cjs
  • cms0.config.json
    • cms0.config.ts
      • cms0.ts
cms0.config.ts
import "dotenv/config"; import { defineConfig } from "@cms0/cms0/config"; export default defineConfig({ entry: "./src/cms0.ts", api: { baseUrl: process.env.CMS0_API_BASE_URL, key: process.env.CMS0_API_KEY, }, });

Fields

FieldRequiredDescription
entryYesFile that calls cms0<T>(), relative to the config file
tsconfigNoTypeScript config used for schema analysis
api.baseUrlNoRuntime API base URL; when set, the CLI publishes the schema
api.keyNoAPI key sent as Authorization: Bearer ... during publish

Config and runtime client

The CLI config and runtime client usually read the same URL and key:

src/cms0.ts
export const cms = cms0<RootSchema>({ apiConfig: { baseUrl: process.env.CMS0_API_BASE_URL, key: process.env.CMS0_API_KEY, }, });

Success check

Run:

Terminal
pnpm exec cms0 build

If the config is valid, the CLI resolves the entry file and publishes the generated schema.

If you need a different schema file per app, keep each app’s cms0.config.ts next to that app’s package manifest and run the CLI from that directory.