Skip to Content
CLIdeploy

flexkit deploy

Deploys the schema for every project defined in your local Flexkit config and streams progress until completion. Deploying is what updates the Studio: it renders the deployed schema, not the file on disk.

Synopsis

flexkit deploy [options]

Behavior

  • Reads projects from your local flexkit.config.ts (or the --local-config path). .js and .mjs are also accepted.
  • Serializes each project to pure data before sending it: title, projectId, menuGroups, scopes, spaces and schema. Every attribute validation function is compiled to a JSON Schema (draft-07) fragment; see Validation.
  • Starts one deploy job per configured project.
  • Prints state transitions such as queued, validating, building, uploading, activating, and final status.
  • Reports “no changes” with a returned schema hash when nothing changed.
  • Handles Ctrl+C gracefully and stops the deploy run.
  • Returns non-zero exit code if any project deploy fails.

Failures before anything is sent

The CLI refuses the config locally in these cases. Nothing is deployed for any project.

  • flexkit.config.tsx or .jsx: config files from the JSX era are refused with migration guidance. Rename the file to flexkit.config.ts, replace icon components with lucide icon names (icon: 'Tag'), use booleans for hidden and readOnly, and remove extensions, basePath and commands.
  • No default export: the file must export default defineConfig(...).
  • Validation that JSON Schema cannot express: .refine(), .superRefine(), .check(), .transform(), z.custom(), z.date(), unsupported string formats, or a validation that throws. The error names the entity and attribute, for example Attribute "price" of entity "product": validation uses refine() ....
  • Callbacks or React elements in the config: a non-boolean hidden or readOnly, or a non-string menu.icon or groups[].icon.

Failures reported by the server

  • Schema managed in the app (409, code: schema_source_mismatch): the project’s schema is managed by the Flexkit Agent. An owner can switch it to Managed from code under Settings → General → Schema Management.
  • Compatibility errors: removed entities or attributes, and changed data types. See Schema Deploy Errors.
  • Invalid validation fragment (422 at schema[i].attributes[j].validation): the backend compiles every fragment with Ajv and rejects one it cannot compile.
  • Undeclared menu group (schema[i].menu.group): the entity uses a menu.group that is not listed in menuGroups.

Options

  • --allow-breaking-changes: Acknowledge and deploy intentional entity or attribute removals. This option does not allow unsafe data type changes or invalid schemas.
  • --force: Deploy even when the schema has not changed. Boolean flag; it takes no value.
  • See also the global options.

Examples

# Deploy using config in current directory
flexkit deploy
 
# Force deployment when the schema has not changed
flexkit deploy --force
 
# Deploy intentional entity or attribute removals
flexkit deploy --allow-breaking-changes
 
# Deploy using an explicit config file
flexkit --local-config ./flexkit.config.ts deploy
 
# Deploy from another directory
flexkit --cwd ./apps/my-app deploy

After a successful deploy, reload the Studio to see the new schema. See Schema Deploy Errors for instructions when a schema compatibility check stops deployment.

Last updated on