Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/snippets/cli/add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ bun add <package> <@version>
<code>-a</code>
</ParamField>

<ParamField path="--linker" type="string">
Linker strategy (one of <code>isolated</code> or <code>hoisted</code>)
</ParamField>

<ParamField path="--minimum-release-age" type="number">
Only install package versions published at least this many seconds ago
</ParamField>

### Network & Registry

<ParamField path="--ca" type="string">
Expand Down Expand Up @@ -158,6 +166,18 @@ bun add <package> <@version>
Don't print a summary
</ParamField>

### Platform Targeting

<ParamField path="--cpu" type="string">
Override CPU architecture for optional dependencies (e.g., <code>x64</code>, <code>arm64</code>, <code>*</code> for
all)
</ParamField>

<ParamField path="--os" type="string">
Override operating system for optional dependencies (e.g., <code>linux</code>, <code>darwin</code>, <code>*</code> for
all)
</ParamField>

### Global Configuration &amp; Context

<ParamField path="--config" type="string">
Expand Down
25 changes: 25 additions & 0 deletions docs/snippets/cli/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ bun install <name>@<version>
Add the exact version instead of the ^ range
</ParamField>

<ParamField path="--catalog" type="string">
Add the resolved version to the root <code>package.json</code> catalog and depend on it as <code>catalog:</code>;{" "}
<code>--catalog=NAME</code> targets <code>catalogs.NAME</code>
</ParamField>

### Lockfile Control

<ParamField path="--yarn" type="boolean">
Expand Down Expand Up @@ -104,6 +109,10 @@ bun install <name>@<version>
Platform-specific optimizations: "clonefile", "hardlink", "symlink", "copyfile"
</ParamField>

<ParamField path="--linker" type="string">
Linker strategy (one of <code>isolated</code> or <code>hoisted</code>)
</ParamField>

<ParamField path="--filter" type="string">
Install packages for the matching workspaces
</ParamField>
Expand All @@ -112,6 +121,18 @@ bun install <name>@<version>
Recursively analyze & install all dependencies of files passed as arguments
</ParamField>

### Platform Targeting

<ParamField path="--cpu" type="string">
Override CPU architecture for optional dependencies (e.g., <code>x64</code>, <code>arm64</code>, <code>*</code> for
all)
</ParamField>

<ParamField path="--os" type="string">
Override operating system for optional dependencies (e.g., <code>linux</code>, <code>darwin</code>, <code>*</code> for
all)
</ParamField>

### Caching Options

<ParamField path="--cache-dir" type="string">
Expand Down Expand Up @@ -150,6 +171,10 @@ bun install <name>@<version>
Add to trustedDependencies in the project's package.json and install the package(s)
</ParamField>

<ParamField path="--minimum-release-age" type="number">
Only install package versions published at least this many seconds ago
</ParamField>

### Concurrency & Performance

<ParamField path="--concurrent-scripts" type="number">
Expand Down