Skip to content
Latchkey

bun create: Scaffold From a Template

bun create scaffolds a new project from an official template, a create-* package, or a GitHub repo.

bun create is the templated counterpart to bun init. It can run a create-<x> generator (create-vite, create-next-app) or clone a starter from GitHub, then install dependencies.

What it does

bun create <target> <dir> scaffolds a project. The target can be a built-in template name, a create-<x> package on npm (bun create vite runs create-vite), or a GitHub user/repo. After copying files it runs bun install in the new directory.

Common usage

Terminal
bun create vite my-app
bun create next-app my-app
bun create github-user/template-repo my-app
bun create ./local-template my-app

Options

FlagWhat it does
<template> <dir>Template/create-package/repo, and target directory
--no-installSkip the automatic bun install after scaffolding
--no-gitDo not initialize a git repository

In CI

bun create reaches the network (npm and/or GitHub), so in pipelines that test scaffolding, pin the template and tolerate transient fetch failures with a retry. Use --no-install if you want to control the install step separately, for example to add --frozen-lockfile semantics.

Common errors in CI

"error: package <create-x> not found" means the create-package name is wrong; bun create vite maps to create-vite. A GitHub source that 404s means a private or misspelled repo. If the post-scaffold install fails, it surfaces as a normal bun install error; check the registry and lockfile.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →