Skip to Content
šŸš€ Alpha Release - Yama JS is currently in alpha. APIs may change without notice.

CLI Reference

Complete reference for all Yama CLI commands.

Project Commands

yama create

Create a new Yama project.

yama create <project-name> [options]

Alias: yama new

Options:

OptionDescription
--database <type>Database type: postgresql, pglite, none
-y, --yesSkip prompts and use defaults
--template <name>Project template to use

Examples:

yama create my-api yama create my-api --database postgresql yama create my-api -y

yama dev

Start the development server with hot reload.

yama dev [options]

Options:

OptionDescription
-p, --port <port>Server port (default: 4000)
--host <host>Server host (default: localhost)
--no-watchDisable file watching
--config <path>Path to config file
--env <environment>Environment to use
--generateAuto-generate on startup

Examples:

yama dev yama dev --port 3000 yama dev --env staging

yama start

Start the production server.

yama start [options]

Options:

OptionDescription
-p, --port <port>Server port
--config <path>Path to config file

yama build

Build the application for production.

yama build [options]

Code Generation

yama generate

Generate TypeScript types and SDK from your configuration.

yama generate [options]

Alias: yama gen

Options:

OptionDescription
--types-onlyGenerate types only
--sdk-onlyGenerate SDK only
--watchWatch for changes
--framework <name>Target framework: react, nextjs, node
--output <dir>Output directory

Examples:

yama generate yama generate --types-only yama generate --watch

yama docs

Generate API documentation.

yama docs [options]

Options:

OptionDescription
--format <type>Output format: openapi, markdown
--output <path>Output file path

Examples:

yama docs --format openapi --output openapi.json yama docs --format markdown --output API.md

Schema & Migrations

yama schema:generate

Generate a new migration from schema changes.

yama schema:generate [options]

Options:

OptionDescription
--name <name>Migration name (required)
--env <environment>Target environment

Example:

yama schema:generate --name add_users_table

yama schema:apply

Apply pending migrations to the database.

yama schema:apply [options]

Options:

OptionDescription
--env <environment>Target environment
--forceSkip confirmation prompts
--dry-runShow what would be applied

Examples:

yama schema:apply yama schema:apply --env production yama schema:apply --dry-run

yama schema:status

Check migration status.

yama schema:status [options]

Options:

OptionDescription
--env <environment>Target environment

yama schema:history

View migration history.

yama schema:history [options]

yama schema:rollback

Roll back migrations.

yama schema:rollback [options]

Options:

OptionDescription
--steps <n>Number of migrations to roll back
--env <environment>Target environment

yama schema:check

Check if database is in sync with schema.

yama schema:check [options]

yama schema:scaffold

Scaffold common schema changes.

yama schema:scaffold <action> [args]

Actions:

ActionDescription
add-table <name>Add a new table
add-column <table> <column>Add a column to a table
add-index <table> <column>Add an index

Examples:

yama schema:scaffold add-table posts yama schema:scaffold add-column users avatar_url

Database Commands

yama db list

List database tables.

yama db list [options]

yama db inspect

Inspect a table’s schema and data.

yama db inspect <table> [options]

Options:

OptionDescription
--limit <n>Number of rows to show

Validation

yama validate

Validate your configuration file.

yama validate [options]

Options:

OptionDescription
--strictEnable strict validation
--config <path>Path to config file

yama endpoints

List all defined endpoints.

yama endpoints

yama schemas

List all defined schemas.

yama schemas

Plugin Commands

yama plugin list

List installed plugins.

yama plugin list

yama plugin install

Install a plugin.

yama plugin install <name>

yama plugin validate

Validate plugin configuration.

yama plugin validate

Utility Commands

yama config

Show current configuration.

yama config [options]

Options:

OptionDescription
--env <environment>Target environment

yama add

Add resources to your project.

yama add:endpoint yama add:schema yama add:entity yama add:plugin

Global Options

These options work with all commands:

OptionDescription
--helpShow help for a command
--versionShow CLI version
--debugEnable debug output
--quietSuppress output
Last updated on