CLI reference
Create, develop, build, and extend a documentation project.
Creator and runtime
The creator, @lexibase/create-rdx, generates a new directory. The runtime command,
rdx, belongs to the installed @lexibase/rdx package and works inside an
existing documentation project. You do not need a global RDX installation.
Create a project
pnpm create @lexibase/rdx@latest my-docs
The Yarn creator example uses yarn dlx (Yarn 2+).
Omit the name to get an interactive prompt. The directory name is preserved; the generated package name is normalized to lowercase. Existing directories are not overwritten.
| Creator option | Effect |
|---|---|
--help | Show usage without creating a project |
--version | Print the creator's version |
--skip-install | Create files and leave installation to you |
Development and production
Run these from the generated project root:
pnpm dev
pnpm build
pnpm start
dev starts the development server, build prepares a production build, and
start serves that build. Stop the development server before building for production.
build checks documentation before preparing or compiling the site. Problems
stop the build and include their source file, line and column. See
Checking documentation for the checks performed.
The underlying commands are rdx dev, rdx build, and rdx start. They prepare
the internal app automatically. Forward Next.js arguments when needed:
pnpm rdx dev --port 3001
pnpm rdx start --hostname 127.0.0.1 --port 3001
Check documentation
pnpm rdx check
Validate static document links, section anchors and local assets without building
or preparing the site. Problems include their file, line and column. The command
exits with 1 when it finds errors, exceeds the optional --max-warnings N
limit, or finds warnings that are new to a file supplied with --baseline FILE.
Use --write-baseline FILE to save the current warnings to a new file.
Use rdx check --json for a report that scripts and CI can read, or
rdx check --help for usage. See
Checking documentation for scope and examples.
Prepare without starting a server
pnpm rdx prepare
This validates configuration and prepares .rdx/, including public assets and
configured plugin preparation. It does not create a documentation snapshot.
Plugins and snapshots
Activate content languages with the optional i18n installer:
pnpm rdx add i18n
It uses lang as the primary language, asks for additional languages and
prepares their folders. Use --locales en,es-ES to supply additional languages
without a prompt, and --package-manager npm|pnpm|yarn to choose the installer.
Later language additions are made in locales and their translation directories.
Use rdx i18n sync to add missing homepage phrases to the configured languages'
home.json catalogs.
See Languages.
pnpm rdx add versioning
pnpm rdx version 1.0.0
pnpm rdx archive 1.0.0
pnpm rdx unarchive 1.0.0
version, archive, unarchive, and delete are registered only after the versioning
plugin is configured. version publishes the ready docs/ content, replacing
the published edition of the same major or adding a new major. Superseded URLs
redirect to the updated edition. Archiving and restoring update the manifest without
modifying snapshot contents. rdx delete <version> permanently removes the
snapshot. See Delete a version
for how it handles superseded versions and frozen translations.
See Plugins and Versioning
before creating snapshots. rdx --help lists the built-in command usage.
The installer can be selected explicitly with
rdx add versioning --package-manager npm (or pnpm / yarn). Normally RDX
detects the package manager from how the command was invoked.