# @packall/cli

Bundle npm packages and their complete dependency closure into tarballs that can be
carried across an air gap and imported into a restricted registry.

## Install

```bash
npm install -g @packall/cli
```

The package installs both `packall` and `npmb` as command names. For a one-off run:

```bash
npx @packall/cli react@18.2.0
```

## Common commands

```bash
# Bundle one package and everything it needs
packall react@18.2.0

# Bundle several roots with a shared, deduplicated download
packall react@18.2.0 react-dom@18.2.0 lodash

# Preview resolution without downloading
packall --dry-run --file package.json

# Bundle a package.json, including development dependencies by default
packall --file package.json

# Bundle only production dependencies
packall --file package.json --prod

# Reproduce the exact versions recorded by a lockfile
packall --file pnpm-lock.yaml
```

Input can be package specs, a `package.json`, npm/pnpm/bun lockfile, or a text file with
one spec per line. Use `--out` to choose the output directory, `--layout` to choose
`per-spec`, `single`, `dir`, or `flat`, and `--json` for machine-readable output.

The registry options cover `.npmrc` credentials and per-scope registries, `--timeout`,
transient-only `--retries`, `--concurrency`, and `--rewrite-tarball-host`. Integrity is
verified by default; `--no-verify` is an explicit opt-out.

## Main options

| Option            | Purpose                                                  |
| ----------------- | -------------------------------------------------------- |
| `--file PATH`     | Read a `package.json`, lockfile, or spec list.           |
| `--prod`          | Exclude `devDependencies` when reading a `package.json`. |
| `--lockfile MODE` | Detect, disable, require, or select a lockfile.          |
| `--out DIR`       | Choose the output directory.                             |
| `--layout KIND`   | Write `per-spec`, `single`, `dir`, or `flat` output.     |
| `--all-versions`  | Bundle every published version matching a range.         |
| `--platform LIST` | Restrict optional dependencies to selected platforms.    |
| `--registry URL`  | Override the registry selected from `.npmrc`.            |
| `--dry-run`       | Resolve and report without downloading.                  |
| `--force`         | Replace existing output files.                           |
| `--yes`           | Never prompt; use defaults.                              |

Every flag and its default is listed in the [options reference](https://packall.vercel.app/docs/reference/cli).
For workflows, see the [packall documentation](https://packall.vercel.app/docs), and for the
programmatic API, the [`@packall/cli` API reference](https://packall.vercel.app/docs/api/cli).

## License

MIT
