> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Quick start

## Environment preparation

Rslib supports using [Node.js](https://nodejs.org/), [Deno](https://deno.com/), or [Bun](https://bun.sh/) as the JavaScript runtime.

Use one of the following installation guides to set up a runtime:

- [Install Node.js](https://nodejs.org/en/download)
- [Install Bun](https://bun.com/docs/installation)
- [Install Deno](https://docs.deno.com/runtime/getting_started/installation/)

:::tip Version requirements

Rslib v1 requires Node.js version 20.19+, 22.12+.

:::

## Creating an Rslib project

Use [`create-rslib`](https://www.npmjs.com/package/create-rslib) to create a new Rslib project. Run the following command:


```sh [npm]
npm create rslib@latest
```

```sh [yarn]
yarn create rslib
```

```sh [pnpm]
pnpm create rslib@latest
```

```sh [bun]
bun create rslib@latest
```

```sh [deno]
deno init --npm rslib@latest
```

Follow the prompts step by step. During project creation, you can choose a template, language, optional tools, and optional skills.

All templates include [Rstest](https://rstest.rs/) by default for testing.

By default, the scaffold initializes a Git repository in the generated project. Pass `--no-git` to skip Git initialization.

After creating the project, do the following:

- Run `npm install` (or your package manager's install command) to install dependencies.
- Run `npm run dev` to start watch mode and begin development.

### Templates

When creating a project, you can choose from the following templates provided by `create-rslib`:

| Template        | Description              |
| --------------- | ------------------------ |
| Node.js package | Node.js package          |
| React           | React component library  |
| Vue             | Vue component library    |
| Svelte          | Svelte component library |
| Solid           | Solid component library  |

### Optional tools

`create-rslib` can help you set up the following commonly used tools. Use the arrow keys to navigate and the space bar to select. Press Enter without selecting anything to skip these tools.

| Tool                                                      | Use                                                       |
| --------------------------------------------------------- | --------------------------------------------------------- |
| [ESLint](https://eslint.org/)                             | Linting                                                   |
| [Rslint](https://rslint.rs/)                              | Linting                                                   |
| [Prettier](https://prettier.io/)                          | Formatting                                                |
| [Biome](https://biomejs.dev/)                             | Linting and formatting                                    |
| [Rspress](https://rspress.rs/)                            | Component documentation, React + TypeScript template      |
| [Storybook](https://storybook.js.org/)                    | Component development and preview, React or Vue templates |
| [React Compiler](/guide/solution/react.md#react-compiler) | Optimizing React components, React template only          |

### Optional skills

`create-rslib` can install optional skills for coding agents that support Skills. In interactive mode, your selections in “Optional tools” affect the available skill options. The currently available skills are:

| Name                                                                                                    | Condition        |
| ------------------------------------------------------------------------------------------------------- | ---------------- |
| [rslib-best-practices](https://github.com/rstackjs/agent-skills#rslib-best-practices)                   | Default          |
| [rstest-best-practices](https://github.com/rstackjs/agent-skills#rstest-best-practices)                 | Default          |
| [rspress-custom-theme](https://github.com/rstackjs/agent-skills#rspress-custom-theme)                   | Choose `Rspress` |
| [rspress-description-generator](https://github.com/rstackjs/agent-skills#rspress-description-generator) | Choose `Rspress` |

Use the arrow keys to navigate and the space bar to select. Press Enter without selecting anything to skip.

```text
◆  Select optional skills (Use <space> to select, <enter> to continue)
│  ◻ Rslib - best practices
│  ◻ Rstest - best practices
```

For more details about Agent Skills and other AI-related capabilities, see [AI](/guide/start/ai.md).

### Current directory

To create a project in the current directory, set the target folder to `.`:

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

### Non-interactive mode

[create-rslib](https://www.npmjs.com/package/create-rslib) 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 React project in the `my-project` directory:

```bash
npx -y create-rslib@latest my-project --template react

# Using abbreviations
npx -y create-rslib@latest my-project -t react

# Specify multiple tools
npx -y create-rslib@latest my-project -t react --tools storybook,biome

# Install an optional skill for coding agents
npx -y create-rslib@latest my-project -t react --skill rslib-best-practices
```

All CLI flags supported by `create-rslib`:

```text
Usage: create-rslib [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

Available templates:
  node-js, node-ts, react-js, react-ts, vue-js, vue-ts, svelte-js, svelte-ts, solid-js, solid-ts

Optional tools:
  react-compiler, eslint, rslint, biome, prettier, rspress, storybook

Optional skills:
  rslib-best-practices, rstest-best-practices, rspress-custom-theme, rspress-description-generator
```

## Migrate from existing projects

To migrate from an existing project to Rslib, refer to the following guides:

- [Migrating from tsup](/guide/migration/tsup.md)
- [Migrating from tsc](/guide/migration/tsc.md)

### Other projects

For other types of projects, you can manually install the [@rslib/core](https://www.npmjs.com/package/@rslib/core) package:


```sh [npm]
npm add @rslib/core -D
```

```sh [yarn]
yarn add @rslib/core -D
```

```sh [pnpm]
pnpm add @rslib/core -D
```

```sh [bun]
bun add @rslib/core -D
```

```sh [deno]
deno add npm:@rslib/core -D
```

Then refer to the guide and documentation to enable the features you need:

- See [CLI](/guide/basic/cli.md) to learn about available CLI commands.
- See [Configure Rslib](/guide/basic/configure-rslib.md) to configure Rslib.
