# version

Bump artifact version numbers

Canonical URL: https://docs.paradoc.dev/cli/commands/version/

Bumps the semantic version in an artifact file.

## Usage

```bash
paradoc version <file> <bump-type>
```

## Arguments

| Argument    | Description                   |
| ----------- | ----------------------------- |
| `file`      | Artifact file to bump version |
| `bump-type` | Bump type or specific version |

## Bump types

| Type         | Description                   | Example            |
| ------------ | ----------------------------- | ------------------ |
| `major`      | Bump major version            | 1.2.3 → 2.0.0      |
| `minor`      | Bump minor version            | 1.2.3 → 1.3.0      |
| `patch`      | Bump patch version            | 1.2.3 → 1.2.4      |
| `premajor`   | Bump to next major prerelease | 1.2.3 → 2.0.0-0    |
| `preminor`   | Bump to next minor prerelease | 1.2.3 → 1.3.0-0    |
| `prepatch`   | Bump to next patch prerelease | 1.2.3 → 1.2.4-0    |
| `prerelease` | Bump prerelease version       | 1.2.3-0 → 1.2.3-1  |
| `<version>`  | Set specific version          | 1.2.3 → 2.5.0-rc.1 |

## Description

The `version` command reads an artifact file, validates it, updates the version field according to semantic versioning rules, and writes the file back. Versions follow [SemVer 2.0.0](https://semver.org), so prerelease versions such as `2.0.0-rc.1` are valid artifact versions and can be published to a registry. An explicit version must be SemVer: `v2.0.0` is refused.

## Examples

Bump patch version:

```bash
paradoc version my-form.yaml patch
```

Bump minor version:

```bash
paradoc version my-form.yaml minor
```

Set specific version:

```bash
paradoc version my-form.yaml 2.0.0
```

## Output

```
✓ Version bumped: 1.2.3 → 1.3.0

Updated: my-form.yaml
```

## Error handling

Invalid bump type:

```
Error: Invalid bump type: invalid
Valid types: major, minor, patch, premajor, preminor, prepatch, prerelease, or a specific version
```

Missing version field:

```
Error: Artifact does not have a version field
```

## See also

* [validate](/cli/commands/validate) - Validate artifact before versioning
* [new](/cli/commands/new) - Create new artifacts with initial version

`version` must run inside a Paradoc project.
