> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talosjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# npm:publish

> Publish a package or module to npm.

Publish packages and modules to the npm registry. Each target is packed with `bun pm pack` (so workspace dependencies resolve to real version ranges), extracted into `dist/publish`, and published with `npm publish`. Versions already present on the registry are skipped, so the command is safe to re-run.

Publishing requires npm credentials saved with [`npm:credentials:create`](/cli/commands/npm-credentials-create).

## Usage

```bash theme={null}
talos npm:publish [options]
```

## Examples

Publish every package and module in the workspace:

```bash theme={null}
talos npm:publish
```

Publish specific packages (comma-separated):

```bash theme={null}
talos npm:publish --packages=cli,logger
```

Publish specific modules:

```bash theme={null}
talos npm:publish --modules=billing,catalog
```

Publish as a restricted (private) package:

```bash theme={null}
talos npm:publish --packages=cli --access=restricted
```

## Options

| Option       | Description                                                   | Default                  |
| ------------ | ------------------------------------------------------------- | ------------------------ |
| `--packages` | Comma-separated package names to publish (under `packages/`). | All packages and modules |
| `--modules`  | Comma-separated module names to publish (under `modules/`).   | All packages and modules |
| `--access`   | npm access level: `public` or `restricted`.                   | `public`                 |
| `--silent`   | Suppress log output and the publishing spinner.               | `false`                  |

With neither `--packages` nor `--modules`, every directory under `packages/` and `modules/` is treated as a target. A target whose `package.json` version already exists on the registry is reported as ignored rather than re-published. At the end the command prints a summary of how many targets were published versus ignored.
