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

# Build a plugin archive

> wpc plugin:build

Generate a ZIP archive from a plugin folder, with optional metadata override and repository push.

If a `.wpcignore` file is present in the plugin folder, it will be used to exclude files from the archive.  See [documentation](/cli/wpcignore) for details.

## Usage

```bash theme={null}
wpc plugin:build [options] [--] [<input>]
```

## Arguments

<ParamField body="input" type="string">
  Input directory containing plugin sources (default: current working directory).
</ParamField>

## Options

<ParamField body="--slug, -s" type="string">
  Plugin slug. If omitted, the working directory name will be used.
</ParamField>

<ParamField body="--output-dir, -o" type="string" default="../dist">
  Output directory for the ZIP archive.
</ParamField>

<ParamField body="--filename, -f" type="string">
  Name of the output ZIP file.
</ParamField>

<ParamField body="--header" type="string[]" repeatable>
  Override one or more plugin headers (e.g. `--header="Version=1.2.3"`).\
  Only existing headers in the plugin file will be replaced, new ones will be ignored. Original file will be unchanged.
</ParamField>

<ParamField body="--push, -p" type="boolean">
  Push the archive to the configured repository.
  [See push documentation](/cli/plugins/push).
</ParamField>

<ParamField body="--message, -m" type="string">
  Release notes used during push (ignored without push option).
</ParamField>

<ParamField body="--clean" type="boolean">
  Delete the ZIP file after it has been uploaded (ignored without push option).
</ParamField>

## Examples

```bash theme={null}
# Build a zip from current working directory
$ wpc plugin:build

# Build a zip by providing all directories and files name
$ wpc plugin:build --slug=my-plugin --output-dir=build --filename=my-plugin.zip my-plugin

# Build and push a zip with a specific version and with release notes
$ wpc plugin:build --header="Version=1.2.3" --push --m "Add new block"
```
