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-configpath)..jsand.mjsare also accepted. - Serializes each project to pure data before sending it:
title,projectId,menuGroups,scopes,spacesandschema. Every attributevalidationfunction 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.tsxor.jsx: config files from the JSX era are refused with migration guidance. Rename the file toflexkit.config.ts, replace icon components with lucide icon names (icon: 'Tag'), use booleans forhiddenandreadOnly, and removeextensions,basePathandcommands.- 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 avalidationthat throws. The error names the entity and attribute, for exampleAttribute "price" of entity "product": validation uses refine() .... - Callbacks or React elements in the config: a non-boolean
hiddenorreadOnly, or a non-stringmenu.iconorgroups[].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 (
422atschema[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 amenu.groupthat is not listed inmenuGroups.
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 deployAfter 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