CLI
Hypersonic ships a CLI for scaffolding projects and managing the admin dashboard.
npm install -g @hypersonic-js/clihypersonic new
Scaffolds a new project interactively. Run this once to create a project — see Quick Start for the full walkthrough.
hypersonic newhypersonic admin
The admin group contains three subcommands for managing the admin dashboard.
hypersonic admin scaffold
Copies the four admin page components into your project. hypersonic new runs this automatically, so you only need it if you deleted the files or are setting up manually.
hypersonic admin scaffoldWrites the following files into resources/js/Pages/Admin/:
Dashboard.tsxModelIndex.tsxModelForm.tsxUserCreate.tsx
These components are schema-driven and never need to be regenerated after schema changes — only generate-meta needs to re-run.
| Option | Default | Description |
|---|---|---|
--target-dir <dir> | resources/js/Pages | Directory to scaffold admin pages into |
-f, --force | false | Overwrite existing files |
hypersonic admin generate-meta
Reads your Prisma schema and writes prisma/admin-meta.json — the static metadata the admin dashboard uses at runtime to know which models exist and how to display them.
hypersonic admin generate-metaRe-run this every time you change your Prisma schema. Commit prisma/admin-meta.json to your repository.
| Option | Default | Description |
|---|---|---|
--schema <path> | prisma/schema.prisma | Path to Prisma schema file |
--output <path> | prisma/admin-meta.json | Output path for the generated meta file |
hypersonic admin create-admin
Creates a user with role: admin in your database. hypersonic new runs this automatically at the end of setup. Use it again to add a second admin account from the command line.
hypersonic admin create-adminPrompts interactively:
Email: you@example.com
Name: Your Name
Password:DATABASE_URL and BETTER_AUTH_SECRET must be set in your .env before running this command.