1 min read

create-document0

The create-document0 CLI scaffolds a complete, working docs site based on the document0 template.

Usage

npx create-document0 my-docs
pnpm dlx create-document0 my-docs
bunx create-document0 my-docs

If you omit the project name, the CLI will prompt you for one.

What gets scaffolded

my-docs/
├── app/
│   ├── layout.tsx
│   ├── page.tsx                     ← redirects to /docs
│   └── docs/
│       ├── layout.tsx               ← sidebar + main layout
│       └── [[...slug]]/
│           └── page.tsx             ← MDX rendering page
├── components/
│   ├── sidebar.tsx
│   ├── breadcrumbs.tsx
│   ├── page-navigation.tsx
│   ├── table-of-contents.tsx
│   └── mdx-components.tsx
├── content/
│   └── docs/
│       ├── _meta.json
│       ├── index.mdx
│       ├── installation.mdx
│       ├── configuration.mdx
│       └── guides/
│           └── index.mdx
├── lib/
│   ├── source.ts
│   ├── highlighter.ts
│   └── utils.ts
├── next.config.ts
├── tsconfig.json
└── package.json

The scaffolded site is intentionally unstyled: it uses inline styles as a baseline so you can see the structure and replace everything with your own design system.

Options

FlagDescription
--no-installSkip installing dependencies

Package manager detection

The CLI detects your package manager from npm_config_user_agent and uses it automatically:

pnpm dlx create-document0 my-docs   # uses pnpm install
yarn dlx create-document0 my-docs   # uses yarn
bunx create-document0 my-docs       # uses bun install
npx create-document0 my-docs        # uses npm install

After scaffolding

cd my-docs
pnpm dev

Open http://localhost:3000/docs to see your site.

From there:

  1. Replace the inline styles in components/ with your design system
  2. Edit content/docs/ with your actual documentation
  3. Update _meta.json files to control page ordering