Skip to content

CLI Reference

The Kyro CMS CLI is available as npx kyro or as a command in your project after installing @kyro-cms/core.

kyro dev

Start the development server with hot reload.

bash
kyro dev [--port <port>] [--host <host>]
npx kyro dev --port 4321 --host localhost
FlagTypeDefaultDescription
--port, -pnumber4321Development server port
--host, -hstringlocalhostHost interface to bind to

kyro generate

Generate TypeScript type definitions and client code from collection configurations or a remote Kyro CMS instance.

bash
# Generate from local config files
kyro generate --config ./src/kyro --output ./src/types/kyro.d.ts --watch

# Generate from a remote running Kyro instance
kyro generate --url https://my-cms.example.com --api-key kc_abc123 --output ./src/types/kyro.d.ts
FlagTypeDefaultDescription
--config, -cstring./src/kyroPath to config file or directory
--output, -ostring./src/types/kyro.d.tsOutput file path for generated TypeScript declarations
--watch, -wbooleanfalseWatch config directory for changes and regenerate automatically
--urlstringBase URL of a running Kyro CMS server for remote schema generation
--api-keystringAPI key for authentication when using --url

Database Commands (kyro db)

kyro db generate

Generate migration files from your current database schema definitions via Drizzle Kit.

bash
kyro db generate
npx kyro db generate

kyro db migrate

Run pending database migrations.

bash
kyro db migrate
npx kyro db migrate

kyro db push

Push schema changes directly to the database in development mode without creating migration files.

bash
kyro db push
npx kyro db push

WARNING

In production environments, use kyro db migrate rather than push to prevent unintended data loss.


kyro db seed

Seed the database with default initial data using src/database/drizzle/seed.ts.

bash
kyro db seed
npx kyro db seed

kyro db studio

Launch Drizzle Studio in your browser to visually explore and edit database tables.

bash
kyro db studio
npx kyro db studio

Authentication Commands (kyro auth)

kyro auth bootstrap

Create the initial admin user account. Required on first deployment or setting up a fresh database.

bash
kyro auth bootstrap --email admin@example.com --password "SecurePass123!" --role admin
FlagTypeDefaultDescription
--email, -estringKYRO_ADMIN_EMAIL envAdmin user email address
--password, -pstringKYRO_ADMIN_PASSWORD envAdmin user password
--role, -rstringadminAdmin user role

System Commands

kyro health

Check system and database connection health (verifies PostgreSQL, MongoDB, or SQLite connectivity).

bash
kyro health
npx kyro health

kyro-codegen

Generate TypeScript types from a running Kyro server via HTTP. Ships as a binary with the @kyro-cms/connect package.

bash
npx kyro-codegen \
  --url https://my-cms.example.com \
  --api-key kc_abc123 \
  --output ./src/kyro.generated.d.ts
FlagRequiredDefaultDescription
--urlYesBase URL of a running Kyro CMS server
--api-keyYesAPI key with access to the schema endpoint
--outputNokyro.generated.d.tsOutput path

Deployment Commands (kyro deploy)

kyro deploy cloudflare

Deploy your Kyro CMS application to Cloudflare Workers with Assets (+ Cloudflare D1 / Hyperdrive PostgreSQL + Cloudflare R2 storage):

bash
npx kyro deploy cloudflare -d d1 -n my-cms-app -y
FlagLong OptionDescriptionDefault
-d--databaseDatabase type (d1 or postgres)d1
-u--database-urlPostgreSQL connection string (when database = postgres)
-n--nameCloudflare Workers project namekyro-app-<random>
-b--r2-bucketR2 storage bucket namekyro-media-<random>
-e--emailInitial Super Admin emailadmin@kyro-cms.com
-p--passwordInitial Super Admin passwordAuto-generated
-y--non-interactiveSkip interactive prompts and accept defaultsfalse
-q--quietRun silently without prompts or spinnersfalse
-j--jsonEmit machine-readable JSON deployment resultsfalse

Released under the MIT License.