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 CLI to an existing project, and introduces the available workflows.
Environment preparation
Rstack CLI supports using Node.js, Deno, or Bun as the JavaScript runtime.
Use one of the following installation guides to set up a runtime:
Rstack CLI requires Node.js 22.18.0+ or 24.3.0+.
Create a Rstack project
create-rstack lets you quickly create an application, library, documentation site, or monorepo 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:
Migrate an existing project
To migrate an existing project to Rstack CLI, see the migration guide for supported tools and how to use the migration skill.
Install Rstack CLI
Install rstack as a development dependency in a project that has a package.json:
CLI commands
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 hooks: Install, update, or uninstall repository-level Git hooks.rs staged: Run tasks against files staged in Git with lint-staged.
Run with package scripts
Add frequently used commands to the scripts field in package.json:
Then run the script with your package manager. For example, to run the dev script above:
Package scripts use the project-local rs binary, so Rstack CLI does not need to be installed globally.
Run directly in the terminal
You can also run Rstack CLI through your package manager without adding a package script. For example, to start the development server directly:
Rstack CLI also provides rstack as an alias for rs. For example, pnpm rstack dev is equivalent to pnpm rs dev.
Configure Rstack CLI
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.