The CLI's authoring commands create [spaces and pages](/organize/spaces-and-navigation) and wire them into `docs.json` automatically. This is the **blessed path*...
The CLI's authoring commands create [spaces and pages](/organize/spaces-and-navigation) and wire them into `docs.json` automatically. This is the **blessed path*...
The CLI's authoring commands create spaces and pages and wire them into docs.json automatically. This is the blessed path for building structure: it keeps your files on disk and your navigation manifest in sync, so you never end up with orphan pages that don't appear on your site.
Create a space
A space is a top-level section (a top-bar entry on your site):
dxb space create "Guides" --slug guidesThis adds the space to docs.json and creates its folder. Options:
| Flag | Description |
|---|---|
| `--slug <slug>` | URL slug for the space (defaults to a slugified name). |
| `--locale <locale>` | The locale the space belongs to. |
| `--parent <slug>` | Nest it under another space as a sub-space. |
List existing spaces with dxb space list (alias dxb space ls).
Create a page
dxb new page creates an .mdx file and references it in docs.json in one step:
dxb new page guides/quickstart --title "Quickstart"This creates docs/guides/quickstart.mdx with frontmatter and adds a page entry to the nav.
| Flag | Description |
|---|---|
| `--title <title>` | Page title (sets the H1 and frontmatter). |
| `--space <slug>` | Target space (default: the first space). |
Nested folders become groups
When the path has intermediate folders, the CLI creates the nesting as groups:
dxb new page guides/advanced/performance-tuning --title "Performance tuning"This creates docs/guides/advanced/performance-tuning.mdx and nests it under an Advanced group inside the Guides space.
Hand-create, then sync
If you'd rather create files directly in your editor, write the .mdx files and then fold them into docs.json with dxb sync:
# Preview what sync would add (no changes)
dxb sync --dry-run
# Fold all orphan files into docs.json
dxb sync
# Force everything into one space (folders become groups)
dxb sync --space docsdxb sync scans your base path for .mdx files not referenced in docs.json (orphans) and adds them with this mapping:
| On disk | Becomes |
|---|---|
| Top-level folder | A **space** |
| Nested folder | A **group** (nesting preserved) |
| Root-level `.mdx` | A page in the first space |
dxb sync is additive and idempotent — running it repeatedly is safe. Orphan pages aren't published until they're in docs.json; dxb push warns about orphans (and --strict fails) until you sync them.Moving, renaming, and removing
- Rename or move a page — move the
.mdxfile in your editor (or withgit mv), then rundxb syncto re-wire it, or edit its entry indocs.json. - Remove a nav entry —
dxb nav remove guides/old-topic(aliasrm) takes the page out of the navigation.
After moving published pages, consider adding a redirect so existing links keep working (see SEO & site layout).
Inspect structure
See the current navigation tree without opening docs.json:
dxb nav treeDocumentation (docs)
├─ Get started
│ ├─ Introduction
│ └─ Quickstart
└─ Guides
└─ Advanced
└─ Performance tuning