absolute generate
Scaffold a page, API plugin, or component — and have the route, imports, and navigation wired into your app for you.
#Usage
absolute generate (alias g) has three subcommands — page, api, and component. It reads your absolute.config.ts to find each framework's directory, so --framework is only required when more than one framework is configured. Names are PascalCased for files and kebab-cased for routes (user-settings → UserSettings.tsx at /user-settings), and every generator is idempotent — it warns instead of overwriting.
# Generate a page — component file, CSS, nav, and route all wired up
absolute generate page dashboard --framework react
# --framework is optional when only one framework is configured
absolute generate page settings
# An API plugin with GET/POST stubs, mounted on the server
absolute generate api users
# A reusable component (no route)
absolute generate component Button --framework svelte#Pages
generate page writes a minimal, idiomatic page for the chosen framework, then wires it in: it adds the route (with the correct page handler and manifest keys) to your pagesPlugin.ts — or inline in server.ts if that's where your routes live — editing the file through the TypeScript compiler API so your formatting and comments survive. Pages link to each other through a shared src/frontend/shared/navData.ts: JS-framework pages import and render it live, and static HTML/HTMX pages bake a snapshot that is re-synced on every generate. Stylesheets are detected — the page joins your app's shared CSS if it has one, otherwise it gets its own indexes/<name>.css.
$ absolute generate page dashboard --framework react✓ Generated page dashboard (react) Created src/frontend/react/pages/Dashboard.tsx src/frontend/styles/indexes/dashboard.css src/frontend/shared/navData.ts Updated src/backend/plugins/pagesPlugin.ts Route /dashboard Next run `absolute prettier --write` to format edits, then `absolute dev`
#API & components
generate api <name> creates src/backend/plugins/<name>Plugin.ts — an Elysia plugin with GET/POST stubs under /api/<name> — and mounts it on your server with .use(...). generate component <name> creates a reusable component in the framework's components/ directory with no route. If a file is too customized to edit safely, the generator prints the exact import and wiring to paste instead, so it never corrupts your code. Run absolute prettier --write afterward to reflow the inserted lines.