← 返回命令列表

Linux command

bun-init 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize new project interactively

bun init

Initialize with defaults (skip prompts)

bun init -y

Initialize React project

bun init --react

Initialize React with Tailwind

bun init --react=tailwind

Initialize React with shadcn/ui

bun init --react=shadcn

说明

bun init scaffolds a new Bun project with sensible defaults. It creates essential project files including package.json, tsconfig.json or jsconfig.json, entry point, README, and .gitignore. The command is non-destructive when run multiple times and will not overwrite existing files.

参数

-y, --yes
Accept defaults without prompting
--react
Scaffold React project (optionally: tailwind, shadcn)
--cwd _directory_
Initialize in different directory

FAQ

What is the bun-init command used for?

bun init scaffolds a new Bun project with sensible defaults. It creates essential project files including package.json, tsconfig.json or jsconfig.json, entry point, README, and .gitignore. The command is non-destructive when run multiple times and will not overwrite existing files.

How do I run a basic bun-init example?

Run `bun init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -y, --yes do in bun-init?

Accept defaults without prompting