LinuxCommandLibrary

bun-init

Scaffold a new project

TLDR

Initialize new project interactively

$ bun init
copy
Initialize with defaults (skip prompts)
$ bun init -y
copy
Initialize React project
$ bun init --react
copy
Initialize React with Tailwind
$ bun init --react=tailwind
copy
Initialize React with shadcn/ui
$ bun init --react=shadcn
copy

SYNOPSIS

bun init [options]

DESCRIPTION

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.

PARAMETERS

-y, --yes

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

CREATED FILES

package.json

Project manifest (name defaults to directory name)
tsconfig.json / jsconfig.json
TypeScript/JavaScript configuration
index.ts
Entry point (or index.tsx, index.js, etc.)
README.md
Project documentation
.gitignore
Git ignore patterns
bun.lockb
Lockfile (after install)

PROJECT STRUCTURE

$ my-project/
├── node_modules/
├── index.ts
├── .gitignore
├── README.md
├── bun.lockb
└── package.json
copy

CAVEATS

Automatically runs bun install to install @types/bun. Entry point defaults to index.ts unless other index files exist. TypeScript is preferred by default.

SEE ALSO

bun(1), bun-create(1), npm-init(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community