# publish

## Usage

```bash
bdy artifact publish|pub [options] <identifier> <directory>
```

## Arguments

| **Argument** | **Description** |
| :--- | :--- |
| `identifier` | Human-readable ID of the artifact and optionally version: artifact@version (optional) |
| `directory` | Path to the directory or file (required) |

## Options

| **Option** | **Description** |
| :--- | :--- |
| `-w, --workspace <domain>` | Workspace URL handle. Can be set via variable: BUDDY_WORKSPACE |
| `-p, --project <name>` | Project name. Can be set via variable: BUDDY_PROJECT |
| `-c, --create` | Create artifact if not exists |
| `-f, --force` | Allow overwriting existing version |
| `-h, --help` | display help for command |

## Examples

### Publish new version of file artifact

```bash
bdy art pub artifact-identifier@version /path/to/dir
```

### Create new file artifact

```bash
bdy art pub artifact-identifier --create
```

### Overwrite existing version

```bash
bdy art pub artifact-identifier@version /path/to/dir -f
```


---
Original source: https://buddy.works/docs/cli/artifact/publish