CLI (omni)
The omni CLI is planned for v0.2 — a comprehensive command-line interface for scaffolding, database management, and developer tooling.
CLI — omni (Planned for v0.2)
The omni CLI is in development. When released, it will be the primary interface for project scaffolding, code generation, database management, and developer diagnostics.
The omni CLI is the primary developer tool for OmniSvelte projects. It covers the full development lifecycle — from project creation to production deployment.
Installation
When released, the CLI will be available globally or via npx:
# Global install
pnpm add -g omni-svelte
# Or run without installing
npx omni <command>Command groups
Project commands
omni init <name>
Scaffold a new OmniSvelte project interactively:
npx omni init my-appInteractive wizard asks:
- Package manager (
pnpm,npm,bun) - Database (PostgreSQL, SQLite, none)
- Auth strategies (email, OAuth providers, magic link)
- UI framework (shadcn-svelte, none)
- Planned features to stub out
omni migrate
Migrate an existing SvelteKit project to OmniSvelte:
cd my-existing-app
npx omni migrate sveltekitomni add
Add OmniSvelte features and plugins to your project (coming soon):
npx omni add stripeGenerate commands
omni generate model <name>
Scaffold a .schema.ts + model + factory:
omni generate model post
# Creates: src/lib/post.schema.ts
# After save: auto-generates model, validation, factoryomni generate resource <name>
Full CRUD scaffold — schema, model, routes, and UI:
omni generate resource post
# Creates:
# src/lib/post.schema.ts
# src/routes/posts/+page.svelte (list)
# src/routes/posts/[id]/+page.svelte (show)
# src/routes/posts/new/+page.svelte (create form)
# src/routes/posts/[id]/edit/+page.svelte (edit form)
# src/routes/posts/+page.server.ts
# src/routes/posts/[id]/+page.server.tsomni generate auth-page
Add login, register, forgot password, and reset password pages:
omni generate auth-page
# Creates: src/routes/(auth)/login, register, forgot-password, reset-passwordomni generate email <name>
Scaffold an email template:
omni generate email welcome
# Creates: src/emails/welcome.tsxDatabase commands
omni db migrate
Run all pending migrations:
omni db migrate
omni db migrate --db-url=postgres://... # override DATABASE_URLomni db rollback
Roll back the last batch of migrations (manual guidance):
omni db rollbackomni db fresh
Drop all tables and re-run all migrations from scratch. Destructive. (manual guidance):
omni db freshomni seed
Run database seeders:
omni seed
omni seed --file=scripts/seed-users.tsomni db:push
Push schema changes directly without a migration file (dev only):
omni db:pushomni db:pull
Introspect an existing database and generate a schema file:
omni db:pullDevelopment commands
omni serve
Start the SvelteKit dev server (alias for pnpm dev):
omni serve
omni serve --port=3000
omni serve --with-admin # include admin panel (planned)
omni serve --realtime # enable WebSocket serveromni tinker
Interactive REPL with all models, $db, and $auth pre-loaded:
omni tinkerOmniSvelte REPL v0.2.0
> await Posts.count()
42
> await Users.query().where('role', 'admin').get()
[{ id: 1, name: 'Admin', ... }]
> .exit
Debug commands
omni debug:routes
List all registered SvelteKit routes:
omni debug:routes
# ┌──────────────────────────────────┬─────────────┐
# │ Route │ Type │
# ├──────────────────────────────────┼─────────────┤
# │ / │ page │
# │ /posts │ page │
# │ /posts/[id] │ page │
# │ /api/auth/** │ api (auth) │
# └──────────────────────────────────┴─────────────┘omni debug:models
List all models, their fields, and relationships:
omni debug:modelsomni debug:permissions
Show the role/permission matrix:
omni debug:permissionsomni debug:config
Print the resolved OmniSvelte configuration:
omni debug:configCode quality commands
omni lint # ESLint
omni format # Prettier
omni test # Vitest
omni test --coverage # Coverage reportCache commands
omni cache:clear # Flush all cached entries
omni cache:stats # Show hit rate, memory usage, key countMonitor commands
omni monitor:queries # Show slow database queries in real time
omni monitor:realtime # Monitor active WebSocket connectionsDocs commands
omni docs:generate # Generate API docs from schema + JSDoc comments
omni docs:serve # Serve generated docs at http://localhost:4000Deployment commands
omni build:production # Optimized production build
omni deploy --env=staging # Deploy to a named environment
omni deploy --env=production --confirmPlugin commands
Plugins can register their own commands under omni <plugin>:<command>:
omni my-plugin:init
omni audit:report --from=2025-01-01See Creating Plugins for how to register commands.
Global flags
feat/omni-cli