mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
85 lines
1.9 KiB
Plaintext
85 lines
1.9 KiB
Plaintext
## CLI Usage
|
||
|
||
```bash terminal icon="terminal"
|
||
bun init <folder?>
|
||
```
|
||
|
||
### Initialization Options
|
||
|
||
<ParamField path="--yes" type="boolean">
|
||
{" "}
|
||
Accept all default prompts without asking questions. Alias: <code>-y</code>{" "}
|
||
</ParamField>
|
||
<ParamField path="--minimal" type="boolean">
|
||
{" "}
|
||
Only initialize type definitions (skip app scaffolding). Alias: <code>-m</code>{" "}
|
||
</ParamField>
|
||
|
||
### Project Templates
|
||
|
||
<ParamField path="--react" type="string|boolean">
|
||
{" "}
|
||
Scaffold a React project. When used without a value, creates a baseline React app.
|
||
<br /> Accepts values for presets:{" "}
|
||
<ul>
|
||
{" "}
|
||
<li>
|
||
<code>tailwind</code> – React app preconfigured with Tailwind CSS
|
||
</li>{" "}
|
||
<li>
|
||
<code>shadcn</code> – React app with <code>@shadcn/ui</code> and Tailwind CSS
|
||
</li>{" "}
|
||
</ul>{" "}
|
||
Examples:{" "}
|
||
<pre>
|
||
<code>bun init --react bun init --react=tailwind bun init --react=shadcn</code>
|
||
</pre>{" "}
|
||
</ParamField>
|
||
|
||
### Output & Files
|
||
|
||
<ParamField path="(result)" type="info">
|
||
{" "}
|
||
Initializes project files and configuration for the chosen options (e.g., creating essential config files and a
|
||
starter directory structure). Exact files vary by template.{" "}
|
||
</ParamField>
|
||
|
||
### Global Configuration & Context
|
||
|
||
<ParamField path="--cwd" type="string">
|
||
{" "}
|
||
Run <code>bun init</code> as if started in a different working directory (useful in scripts).{" "}
|
||
</ParamField>
|
||
|
||
### Help
|
||
|
||
<ParamField path="--help" type="boolean">
|
||
{" "}
|
||
Print this help menu. Alias: <code>-h</code>{" "}
|
||
</ParamField>
|
||
|
||
### Examples
|
||
|
||
- Accept all defaults
|
||
|
||
```bash terminal icon="terminal"
|
||
bun init -y
|
||
```
|
||
|
||
- React
|
||
|
||
```bash terminal icon="terminal"
|
||
bun init --react
|
||
```
|
||
|
||
- React + Tailwind CSS
|
||
|
||
```bash terminal icon="terminal"
|
||
bun init --react=tailwind
|
||
```
|
||
|
||
- React + @shadcn/ui
|
||
```bash terminal icon="terminal"
|
||
bun init --react=shadcn
|
||
```
|