Quick start
Set up a Rspress documentation site.
Read the current quick start guide at https://rspress.rs/guide/start/getting-started.md before running commands. Setup can change between versions, so use the latest CLI and linked docs instead of writing the setup from memory. Add .md to a docs page URL to read it as Markdown.
## New site
Create the site in a new folder, or as a workspace package in an existing monorepo:
npx -y create-rspress@latest my-docs --template basic-theme --skill rspress-docs-generator,rspress-best-practices,rspress-custom-theme
- Replace my-docs with the requested path. In a monorepo, follow its workspace layout and package manager.
- Use basic-theme for a single-language site. Use i18n-theme when the user requests multiple languages; it starts with English and Chinese content.
- These templates include a theme/ folder for customization. The --skill option installs local guidance for the tasks below.
- Explicitly pass the path and template to avoid interactive prompts. Check npx -y create-rspress@latest --help for current options.
- Use an empty target folder. If a Rspress site already exists, inspect and update it instead of scaffolding over it.
## Theme and colors
Read https://rspress.rs/guide/basic/custom-theme.md and https://rspress.rs/ui/vars.md, then use the installed rspress-custom-theme skill.
Choose colors from the user's preferences or existing project branding. If neither is provided, choose a palette that suits the project's content. Apply the colors through CSS variables in theme/index.css for both light and dark appearances, including links and the homepage background. Keep the theme/index.tsx re-export from @rspress/core/theme-original.
## Finish the setup
Install dependencies with the project's package manager, start the dev server, and open the local URL printed by the server. Verify that the homepage loads. Report the project path, chosen template and colors, and the local URL. If any step fails, fix it before reporting completion.
For follow-up tasks, read the relevant docs first:
- Writing pages: https://rspress.rs/guide/use-mdx/frontmatter.md
- Organizing navigation: https://rspress.rs/guide/basic/auto-nav-sidebar.md
- Configuring languages: https://rspress.rs/guide/basic/i18n.md
- Other tasks: https://rspress.rs/llms.txt
Environment preparation
Rspress supports using Node.js, Deno, or Bun as the JavaScript runtime.
Use one of the following installation guides to set up a runtime:
Version requirements
Rspress requires Node.js version 20.19+, 22.12+.
Create a Rspress project
The recommended way to start a new Rspress project is to use the create-rspress scaffold:
npm create rspress@latest
pnpm create rspress@latest
bun create rspress@latest
deno init --npm rspress@latest
vlt create rspress@latest
The scaffold will ask for the project name or path, whether to set up i18n, whether to create a theme folder for customization, and which optional tools or skills to add.
By default, the scaffold initializes a Git repository in the generated project. Pass --no-git to skip Git initialization.
After the project is created, follow the next steps printed in the terminal:
cd rspress-project
npm install
npm run dev
The dev server will print the local URL after startup. Open it in your browser to view the generated documentation site.
Templates
Rspress provides the following built-in templates:
During project creation, you can select optional tools for linting or formatting:
Optional skills
If you plan to maintain the documentation site with an AI agent, you can select optional Agent Skills during project creation. The CLI will generate a .agents/skills directory in your project and add the selected skills there.
For most documentation sites, we recommend selecting:
- rspress-docs-generator: helps AI agents create and maintain Rspress documentation sites, especially when a monorepo keeps a dedicated Rspress project as its docs site.
- rspress-best-practices: provides Rspress project structure, config, MDX, theme, and deployment guidance for AI agents.
- rspress-description-generator: helps AI agents write and maintain page descriptions for SEO, search, and AI-readable outputs.
If you choose the basic-theme or i18n-theme template, the following skill is selected by default:
- rspress-custom-theme: enables your AI agent to customize the Rspress theme, such as CSS variables, layout slots, and theme component overrides.
These skills do not affect the runtime behavior of your Rspress site. They only provide local guidance for AI agents when editing or maintaining the project. If you do not use an AI agent, you can deselect them or press Enter to skip this option.
For more information about Agent Skills and other AI-related capabilities, see AI.
Current directory
To create a project in the current directory, enter . as the project path when prompted:
◆ Create Rspress Project
◇ Project name or path
│ .
If the current directory is not empty, the CLI will ask whether to continue and overwrite files.
Non-interactive mode
You can pass CLI options to create a project without interactive prompts:
npx -y create-rspress@latest my-docs --template basic-theme --tools rslint,prettier
You can also scaffold the multilingual template:
npx -y create-rspress@latest my-docs --template i18n
Or scaffold a multilingual site with a theme folder:
npx -y create-rspress@latest my-docs --template i18n-theme
You can also add Agent Skills explicitly:
npx -y create-rspress@latest my-docs --template basic-theme --skill rspress-docs-generator,rspress-best-practices,rspress-description-generator
All CLI flags supported by create-rspress:
Usage: create-rspress [dir] [options]
Options:
-h, --help display help for command
-d, --dir <dir> create project in specified directory
-t, --template <tpl> specify the template to use
--no-git skip Git repository initialization
--tools <tool> add additional tools, comma separated
--skill <skill> add optional skills, comma separated
--override override files in target directory
--packageName <name> specify the package name
--template-version <ver> specify the npm template version
Available templates:
basic, basic-theme, i18n, i18n-theme
Optional tools:
eslint, rslint, biome, prettier
Optional skills:
rspress-docs-generator, rspress-best-practices, rspress-custom-theme, rspress-description-generator
Manual setup
If you want to add Rspress to an existing project or create the minimal files yourself, start by creating a directory:
mkdir rspress-app && cd rspress-app
Initialize a package.json:
Install Rspress:
npm install @rspress/core -D
yarn add @rspress/core -D
pnpm add @rspress/core -D
deno add npm:@rspress/core -D
vlt install @rspress/core -D
Create the first document:
mkdir docs && echo '# Hello world' > docs/index.md
Add the following scripts to package.json:
{
"scripts": {
"dev": "rspress dev",
"build": "rspress build",
"preview": "rspress preview"
}
}
Create a configuration file:
import { defineConfig } from '@rspress/core';
export default defineConfig({
root: 'docs',
});
Create tsconfig.json:
{
"compilerOptions": {
"lib": ["DOM", "ES2023"],
"jsx": "react-jsx",
"target": "ES2023",
"noEmit": true,
"skipLibCheck": true,
"useDefineForClassFields": true,
/* modules */
"module": "ESNext",
"moduleDetection": "force",
"moduleResolution": "bundler",
"verbatimModuleSyntax": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"noUncheckedSideEffectImports": true,
"isolatedModules": true,
/* type checking */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["docs", "theme", "rspress.config.ts"],
"mdx": {
"checkMdx": true
}
}
Start dev server
Start the local development server with the following command:
TIP
For the dev command, you can specify the port number or host of the development server with the --port or --host parameter, such as rspress dev --port 8080 --host 0.0.0.0.
Build for production
Build the production bundle with the following command:
By default, Rspress will output the production files to the doc_build directory.
Preview locally
Start the local preview server with the following command:
The preview server serves the production output from doc_build.
Next steps
- Read Basic features to learn routing, homepages, static assets, deployment, and other common documentation site features.
- Read Use MDX to learn how to write MDX and use components in documentation.
- Read Configuration to learn all supported Rspress config options.