For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/quick-start.md.
  • English
  • Quick start

    Rstack CLI brings the Rstack toolchain together with one CLI and one configuration file. This guide shows how to create a new Rstack project or add Rstack to an existing project, and introduces the available workflows.

    Environment preparation

    Rstack 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

    Rstack requires Node.js 22.12.0 or higher when using Node.js as the runtime.

    Create a Rstack project

    create-rstack lets you quickly create an application, library, or documentation site with Rstack configured. We recommend using pnpm as your package manager.

    pnpm
    npm
    yarn
    bun
    deno
    pnpm create rstack@latest

    Follow the prompts to complete the setup.

    After creating the project, do the following:

    • Run pnpm install (or your package manager's install command) to install dependencies.
    • Run pnpm run dev to start the development server or watch mode.

    Templates

    When creating a project, choose from the following templates provided by create-rstack:

    Project typeTemplates
    Web applicationVanilla JavaScript, React, Preact, Vue, Lit, Svelte, Solid
    LibraryNode.js, React, Vue, Svelte, Solid
    Documentation siteSingle language, multilingual

    All application and library templates are available in both JavaScript and TypeScript.

    Current directory

    To create a project in the current directory, set the project name or path to .:

    ◆  Create Rstack Project
    
    ◇  Project name or path
    │  .
    
    ◇  "." is not empty, please choose:
    │  Continue and override files

    Non-interactive mode

    create-rstack supports a non-interactive mode via command-line options. This mode skips prompts and creates the project directly, which is useful for scripts, CI, and automation.

    For example, the following command creates a TypeScript React application in the my-project directory:

    npx -y create-rstack@latest my-project --template app-react-ts
    
    # Using abbreviations
    npx -y create-rstack@latest my-project -t app-react-ts
    
    # Skip Git repository initialization
    npx -y create-rstack@latest my-project -t app-react-ts --no-git

    All CLI flags supported by create-rstack:

    Usage: create-rstack [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
      --override                override files in target directory
      --package-name <name>     specify the package name
      --template-version <ver>  specify the npm template version
    
    Available templates: app-vanilla, app-vanilla-ts, app-react, app-react-ts, app-preact, app-preact-ts, app-vue, app-vue-ts, app-lit, app-lit-ts, app-svelte, app-svelte-ts, app-solid, app-solid-ts, lib-node, lib-node-ts, lib-react, lib-react-ts, lib-vue, lib-vue-ts, lib-svelte, lib-svelte-ts, lib-solid, lib-solid-ts, doc, doc-i18n

    Install Rstack

    Install rstack as a development dependency in a project that has a package.json:

    npm
    yarn
    pnpm
    bun
    npm install -D rstack

    CLI commands

    Add the commands your project needs to the scripts field in package.json. For example:

    package.json
    {
      "scripts": {
        "dev": "rs dev",
        "build": "rs build",
        "preview": "rs preview",
        "test": "rs test",
        "check": "rs check",
        "lint": "rs lint",
        "format": "rs fmt"
      }
    }

    Package scripts use the project-local rs binary, so Rstack does not need to be installed globally.

    The following commands are available:

    • rs dev: Start the application development server.
    • rs build: Build the application for production.
    • rs preview: Preview the application's production build locally.
    • rs lib: Build a library with Rslib.
    • rs doc: Develop, build, or preview a documentation site with Rspress.
    • rs test: Run tests with Rstest.
    • rs check: Run linting and formatting checks, with optional TypeScript type checking.
    • rs lint: Lint source code with Rslint.
    • rs fmt: Format code.
    • rs setup: Install repository-level Git hooks.
    • rs staged: Run tasks against files staged in Git with lint-staged.

    Configure Rstack

    Create rstack.config.ts in the project root and register the configurations your project needs. The following is a minimal example for an application with testing and linting:

    rstack.config.ts
    // Rstack configuration guide: https://rstack.rs/config
    import { define } from 'rstack';
    
    define.app({
      // Rsbuild configuration
    });
    
    define.test({
      // Rstest configuration
    });
    
    define.lint({
      // Rslint configuration
    });

    See Configuration for all available configuration APIs.

    AI

    To learn how to use Rstack CLI with coding agents, see the AI guide.