OOlgax DXP
Reference

create-olgax-site

CLI reference for create-olgax-site, the command that scaffolds a complete Olgax DXP project with Payload CMS, Next.js and the Puck page builder.

npx create-olgax-site <project-name>

Also works with pnpm dlx create-olgax-site <project-name>.

Requirements

  • Node.js 20.9 or newer
  • pnpm

What it does

  1. Converts <project-name> to a folder name (lowercase, hyphens) and refuses to continue if that folder exists and is not empty.
  2. Copies the project template.
  3. Renames the template's gitignore to .gitignore and sets the package name.
  4. Creates .env from .env.example with a freshly generated random PAYLOAD_SECRET.
  5. Runs pnpm install.
  6. Runs pnpm seed to create an admin user, a published home page and a reusable cta-banner section.
  7. Prints the next steps.

If step 5 or 6 fails, the CLI tells you which command to run yourself.

After the CLI finishes

cd my-site
pnpm dev
WhatWhere
Sitehttp://localhost:3000
Page builderhttp://localhost:3000/home/edit
Dashboardhttp://localhost:3000/dashboard
Adminhttp://localhost:3000/admin
Login[email protected] and ChangeMe123!. Change the password.

Scripts in the generated project

ScriptPurpose
pnpm devStart the dev server
pnpm build and pnpm startBuild and run for production
pnpm lintLint the project
pnpm seedCreate the admin user and demo content
pnpm new:component NameGenerate a custom block. See Custom components.
pnpm migrate:create, pnpm migrate, pnpm migrate:statusDatabase migrations. See Production.
pnpm generate:typesRegenerate Payload's TypeScript types
pnpm generate:importmapRegenerate Payload's admin import map
pnpm payloadRun the Payload CLI

Questions, ideas or something not working?

Ask in our official Discord, open an issue on GitHub, or edit this page.

On this page