@@ -124,7 +124,23 @@ Install [`rstack`](https://www.npmjs.com/package/rstack) as a development depend
124124
125125## CLI commands
126126
127- Add the commands your project needs to the ` scripts ` field in ` package.json ` . For example:
127+ The following commands are available:
128+
129+ - [ ` rs dev ` ] ( ./cli/dev ) : Start the application development server.
130+ - [ ` rs build ` ] ( ./cli/build ) : Build the application for production.
131+ - [ ` rs preview ` ] ( ./cli/preview ) : Preview the application's production build locally.
132+ - [ ` rs lib ` ] ( ./cli/lib ) : Build a library with Rslib.
133+ - [ ` rs doc ` ] ( ./cli/doc ) : Develop, build, or preview a documentation site with Rspress.
134+ - [ ` rs test ` ] ( ./cli/test ) : Run tests with Rstest.
135+ - [ ` rs check ` ] ( ./cli/check ) : Run linting and formatting checks, with optional TypeScript type checking.
136+ - [ ` rs lint ` ] ( ./cli/lint ) : Lint source code with Rslint.
137+ - [ ` rs fmt ` ] ( ./cli/fmt ) : Format code.
138+ - [ ` rs hooks ` ] ( ./cli/hooks ) : Install, update, or uninstall repository-level Git hooks.
139+ - [ ` rs staged ` ] ( ./cli/staged ) : Run tasks against files staged in Git with lint-staged.
140+
141+ ### Run with package scripts
142+
143+ Add frequently used commands to the ` scripts ` field in ` package.json ` :
128144
129145``` json title="package.json"
130146{
@@ -140,21 +156,33 @@ Add the commands your project needs to the `scripts` field in `package.json`. Fo
140156}
141157```
142158
159+ Then run the script with your package manager. For example, to run the ` dev ` script above:
160+
161+ <PackageManagerTabs
162+ command = { {
163+ pnpm: ' pnpm run dev' ,
164+ npm: ' npm run dev' ,
165+ yarn: ' yarn run dev' ,
166+ bun: ' bun run dev' ,
167+ }}
168+ />
169+
143170Package scripts use the project-local ` rs ` binary, so Rstack CLI does not need to be installed globally.
144171
145- The following commands are available:
172+ ### Run directly in the terminal
146173
147- - [ ` rs dev ` ] ( ./cli/dev ) : Start the application development server.
148- - [ ` rs build ` ] ( ./cli/build ) : Build the application for production.
149- - [ ` rs preview ` ] ( ./cli/preview ) : Preview the application's production build locally.
150- - [ ` rs lib ` ] ( ./cli/lib ) : Build a library with Rslib.
151- - [ ` rs doc ` ] ( ./cli/doc ) : Develop, build, or preview a documentation site with Rspress.
152- - [ ` rs test ` ] ( ./cli/test ) : Run tests with Rstest.
153- - [ ` rs check ` ] ( ./cli/check ) : Run linting and formatting checks, with optional TypeScript type checking.
154- - [ ` rs lint ` ] ( ./cli/lint ) : Lint source code with Rslint.
155- - [ ` rs fmt ` ] ( ./cli/fmt ) : Format code.
156- - [ ` rs hooks ` ] ( ./cli/hooks ) : Install, update, or uninstall repository-level Git hooks.
157- - [ ` rs staged ` ] ( ./cli/staged ) : Run tasks against files staged in Git with lint-staged.
174+ You can also run Rstack CLI through your package manager without adding a package script. For example, to start the development server directly:
175+
176+ <PackageManagerTabs
177+ command = { {
178+ pnpm: ' pnpm rs dev' ,
179+ npm: ' npx rs dev' ,
180+ yarn: ' yarn exec rs dev' ,
181+ bun: ' bunx rs dev' ,
182+ }}
183+ />
184+
185+ Rstack CLI also provides ` rstack ` as an alias for ` rs ` . For example, ` pnpm rstack dev ` is equivalent to ` pnpm rs dev ` .
158186
159187## Configure Rstack CLI \{ #configure-rstack}
160188
0 commit comments