close
  • English
  • Commands

    Through this chapter, you can learn about the built-in commands of Rspress and how to use them.

    rspress dev

    The rspress dev command is used to start a local development server, providing a development environment for document preview and debugging.

    Usage: rspress dev [root] [options]
    
    Options:
       root                 specify the root directory of the project, which is `docs` in current directory by default, Optional
       -c --config <config> specify config file path, which can be a relative path or an absolute path
       --port <port>        specify port number
       --host <host>        specify host
       --base <base>        specify deployment base path and override config.base
       -h, --help           show command help

    rspress build

    The rspress build command is used to build documentation site for production.

    Usage: rspress build [root] [options]
    
    Options:
       root                 specify the root directory of the project, which is `docs` in current directory by default, Optional
       -c --config <config> specify config file path, which can be a relative path or an absolute path
       --base <base>        specify deployment base path and override config.base
       -h, --help           show command help

    rspress preview

    The rspress preview command is used to preview the output files of the rspress build command locally.

    Usage: rspress preview [root] [options]
    
    Options:
       root                 specify the root directory of the project, which is `docs` in current directory by default, Optional
       -c --config <config> specify config file path, which can be a relative path or an absolute path
       --port <port>        specify port number
       --host <host>        specify host
       --base <base>        specify deployment base path and override config.base
       -h, --help           show command help

    rspress eject

    The rspress eject command copies a built-in theme component to your project so you can customize it.

    Usage: rspress eject [component]
    
    Arguments:
       component             (optional) the theme component to eject; if omitted, all available components are listed

    After ejection, the component files are placed in theme/components/<ComponentName>. Re-export the component in theme/index.tsx to use your customized version.