CLI Workflow

Create and Generate

Use `create-vista-app` for fast project bootstrap, then add new modules with a repeatable CLI-driven workflow.

Bootstrap App

bash

npx create-vista-app@latest
cd my-vista-app
npm run dev

In interactive mode, create-vista-app now prompts for:

  • engine: default or flashpack
  • package manager: npm, pnpm, yarn, or bun

Dependencies install automatically by default after scaffold. Use --skip-install when you only want the files without downloading packages yet.

The CLI does not copy deploy configs or a components/ folder. Theme lives in vista/theme (ThemeProvider, ThemeScript, ThemeToggle). Run vista deploy when you want platform files.

To choose the Rust-first engine during scaffold:

bash

npx create-vista-app@latest my-vista-app --engine flashpack

To pick a package manager explicitly without the prompt:

bash

npx create-vista-app@latest my-vista-app --package-manager pnpm

Shortcut flags also work:

  • --npm
  • --pnpm
  • --yarn
  • --bun

A new app gets AGENTS.md and CLAUDE.md at the project root. AGENTS.md tells coding agents to read the version-matched guides in node_modules/vista/docs/ and the workflow skills in node_modules/vista/skills/ (vista-dev-loop, vista-agent, vista-rag). Pass --no-agents-md to skip those two files.

Generated apps always keep the same scripts:

  • npm run dev
  • npm run build
  • npm run start

The selected engine is stored in vista.config.ts, so switching engines later is a config change instead of a script rename.

Generate commands

bash

vista g api-init
vista g router <name>
vista g procedure <name> [get|post]
vista g agent <name>
vista g auth
vista g seo

vista g auth writes auth.ts, the catch-all auth route, /signin, /account, fail-closed middleware.ts, a SessionProvider wrapper, and .env.example. Set AUTH_SECRET before signing in. Credentials sign-in POSTs; OAuth keeps callbackUrl.

vista g seo writes app/robots.ts, app/sitemap.ts, and app/manifest.ts using vista/metadata helpers (/robots.txt, /sitemap.xml, /manifest.webmanifest). New apps from create-vista-app already include robots/sitemap and OG defaults — see Metadata and SEO (/docs/seo/metadata).

Typed Starter

Typed starter scaffolds app/api/typed.ts, app/api/routers, and app/api/procedures so your API contract starts strongly typed from day one.

Suggested Team Workflow

  • Create feature route in app/<feature>/ first.
  • Extract shared UI into components/ only after second reuse.
  • Add server logic in app/api/procedures/ and expose from router.
  • Keep release scripts in package.json so CI and local run identical commands.