Telaio
CLI

CLI Overview

All telaio CLI commands, config discovery, and how to invoke the binary.

CLI Overview

Telaio ships a telaio binary. Run it with pnpx from your project root:

pnpx telaio <command>

Config discovery

The CLI looks for telaio.config.ts in your project root. This file exports a defineConfig call that controls CLI behavior and code generation settings.

// telaio.config.ts
import { defineConfig } from 'telaio';

export default defineConfig({
  app: 'src/app.ts',
  modules: {
    server: true,
    database: true,
    cache: true,
  },
});

This mirrors how Vite and Vitest discover config files -- the CLI resolves the file relative to process.cwd().

Commands

CommandDescription
telaio init [dir]Scaffold a new Telaio project in the given directory
telaio migrate create <name>Create a new timestamped migration file
telaio migrate latestRun all pending migrations
telaio migrate upRun the next pending migration only
telaio migrate downRoll back the most recent migration
telaio migrate statusShow which migrations have run and which are pending
telaio gen-clientGenerate a TypeScript API client from the OpenAPI spec
telaio db:typesGenerate TypeScript types from your database schema

telaio.config.ts options

import { defineConfig } from 'telaio';

export default defineConfig({
  // Path to the app builder module (used by gen-client)
  app: 'src/app.ts',

  // Zod modules for config schema composition
  modules: { server: true, database: true, cache: true, queue: true },

  // Custom Zod schema to extend the base config
  extend: z.object({ MY_VAR: z.string() }),

  // API client generation options
  client: {
    output: 'client',
    enabled: true,
    plugins: ['@hey-api/typescript'],
  },
});

On this page