Installation
Included in the starter. Every new site has it in src/components/ui/package-managers/. Import it where you need it, or register it in src/components.ts to use it on every page. If your site predates it, install it:
npx @cloudflare/nimbus-docs add package-managersyarn nimbus-docs add package-managerspnpm nimbus-docs add package-managersbunx @cloudflare/nimbus-docs add package-managersPreview
npm i @cloudflare/nimbus-docsyarn add @cloudflare/nimbus-docspnpm add @cloudflare/nimbus-docsbun add @cloudflare/nimbus-docs<PackageManagers pkg="@cloudflare/nimbus-docs" type="add" />Examples
exec: the project’s installed CLI
Use type=“exec” for a command that runs inside a project. pnpm and Yarn run the installed bin, so they get the bin name; npm and bun keep the scoped package name, which uses the local install.
npx @cloudflare/nimbus-docs listyarn nimbus-docs listpnpm nimbus-docs listbunx @cloudflare/nimbus-docs list<PackageManagers
pkg="@cloudflare/nimbus-docs"
type="exec"
args="list"
/>dlx with args
Use type=“dlx” to invoke a CLI without installing — useful for scaffolders. Yarn’s dlx runs in an isolated workspace, so it can’t run a CLI that needs the project’s own packages.
# Scaffold a new project
npx create-astro@latest# Scaffold a new project
yarn dlx create-astro@latest# Scaffold a new project
pnpm dlx create-astro@latest# Scaffold a new project
bunx create-astro@latest<PackageManagers
pkg="create-astro@latest"
type="dlx"
comment="Scaffold a new project"
/>API reference
Every prop the component accepts, sourced from a single declaration.
| Prop | Type |
|---|---|
pkg | string |
type | "add" | "create" | "dlx" | "exec" | "install" | "remove" | "run" |
args | string |
dev | boolean |
comment | string |