CLI Reference
Documentation for the OmniSvelte Command Line Interface (CLI)
CLI Reference
The omni command-line interface provides tools to bootstrap, configure, generate code, and manage database workflows for your OmniSvelte project.
Installation
You can run the CLI directly using your preferred package manager:
npx omni <command>
# or
pnpm dlx omni <command>Or install it globally:
pnpm install -g omni-svelte
omni <command>Interactive Mode
Running omni with no arguments launches an interactive selection menu powered by @clack/prompts:
omniCommands
init [name]
Scaffolds a new OmniSvelte-ready SvelteKit application.
omni init my-appOptions:
--cwd <path>: Create the project from a different directory.--skip-install: Skip final dependency installation.--package-manager <name>: Force a specific package manager (npm|pnpm|yarn|bun).--omni-pkg <package>: Install omni-svelte from a specific package or local path (useful for local testing).
migrate [type] (alias: m)
Migrates an existing project to OmniSvelte (or between OmniSvelte versions). Installs the omni-svelte package and patches vite.config.ts automatically.
omni migrate sveltekit
omni migrate sveltekit --cwd ./my-appOptions:
--cwd <path>: Target project directory (defaults to current directory).-D, --dev: Install as a dev dependency.--package-manager <name>: Force a specific package manager (e.g. pnpm).--omni-pkg <package>: Install omni-svelte from a specific package or local path.
add [feature] (alias: a)
Adds OmniSvelte features and plugins to your project. (Note: plugins are coming in a future release).
omni add stripe
omni add dockergenerate [type] [name] (alias: g)
Generates schema or migration files. Falls back to an interactive prompt when arguments are omitted.
omni generate schema users
omni g migration add_posts_table --output src/lib/db/migrationsTypes:
schema— Generates adefineSchemafile insrc/lib/db/schemas/.migration— Generates a timestamped migration stub inmigrations/.resource(planned) — Full CRUD resource scaffold.auth-page(planned) — Authentication page scaffold.email(planned) — Email template scaffold.
Options:
-o, --output <path>: Custom output directory (relative to--cwd).-f, --force: Overwrite existing output files.--cwd <path>: Working directory (defaults to current directory).--schema-mode <mode>: OverrideOmniConfig.schema.mode.--schema-output-dir <dir>: OverrideOmniConfig.schema.output.directory.
db [action]
Runs Drizzle database tasks. Prompts interactively when no action is provided.
omni db push
omni db seed --script db:seed
omni db studio --config drizzle.config.tsActions:
push— Push schema to the database without a migration file.pull— Pull the existing schema from the database.generate— Generate Drizzle migration files.migrate— Run pending migrations viadrizzle-kit migrate.check— Validate migration state.studio— Open Drizzle Studio.seed— Run the database seed script.
Options:
--config <path>: Path to the drizzle config file.--script <name>: Script name for theseedtask (default:db:seed).--cwd <path>: Working directory.--db-url <url>: Override the database connection URL (setsDATABASE_URL).
migrate [action]
Runs migrations with safe defaults via drizzle-kit migrate.
omni migrate
omni migrate rollback
omni migrate freshActions:
- (no action) /
up— Run pending migrations (default). rollback— Prints rollback guidance (manual process).fresh— Prints fresh-reset guidance (manual process).
Options:
--cwd <path>: Working directory.--config <path>: Path to the drizzle config file.--db-url <url>: Override the database connection URL.
ui [action] [components...]
Runs shadcn-svelte init or add flows from Omni. Prompts interactively when no action is given.
omni ui init
omni ui add button card dialog
omni ui add --yesActions:
init— Initialize shadcn-svelte in the project.add [components...]— Add one or more shadcn-svelte components.
Options:
--cwd <path>: Working directory.-y, --yes: Skip interactive prompts in the shadcn CLI.
doctor
Runs project health checks and detects the package manager. Reports whether package.json, vite.config.ts, svelte.config.js, and the .omni directory are present.
omni doctorOptions:
--cwd <path>: Working directory.
install-dependency <packages...> (alias: installdependency)
Installs one or more dependencies using the automatically detected package manager.
omni install-dependency zod
omni install-dependency vitest @testing-library/svelte -DOptions:
--cwd <path>: Working directory.-D, --dev: Install as dev dependencies.
Dev Script Aliases
The following commands proxy to your project's package manager scripts, forwarding any extra arguments:
All accept:
--cwd <path>: Working directory.- Any extra positional arguments are forwarded to the underlying script.
omni test --reporter=verbose
omni build --mode productionGlobal Options
Running any command with an unknown option shows a suggestion:
omni init --hlep
# error: unknown option '--hlep'
# (Did you mean --help?)Planned Commands
The following commands are registered as stubs and will be implemented in upcoming releases: