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:
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.
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 devto start the development server or watch mode.
Templates
When creating a project, choose from the following templates provided by create-rstack:
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 .:
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:
All CLI flags supported by create-rstack:
Install Rstack
Install rstack as a development dependency in a project that has a package.json:
CLI commands
Add the commands your project needs to the scripts field in package.json. For example:
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:
See Configuration for all available configuration APIs.
AI
To learn how to use Rstack CLI with coding agents, see the AI guide.