# publish

## Usage

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

## Arguments

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

## Options

| **Option** | **Description** |
| :--- | :--- |
| `-w, --workspace <domain>` | Workspace URL handle. Can be set via variable: BUDDY_WORKSPACE |
| `--scope <scope>` | Force scope (WORKSPACE, PROJECT). By default calculated by provided options and environmental variables (--project, BUDDY_PROJECT, linked project) |
| `-p, --project <name>` | Project name. Can be set via variable: BUDDY_PROJECT |
| `-c, --create` | Create artifact if not exists |
| `--note <note>` | Note of the artifact version |
| `--agent-note <note>` | Note of the artifact version for AI agents |
| `--ignore <patterns>` | Comma-separated paths or globs left out of the package (.git is always left out) |
| `-h, --help` | display help for command |

## Examples

### Publish new version of composer artifact

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

### Publish version from composer.json

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

### Create new composer artifact

```bash
bdy art cmp pub artifact-identifier --create /path/to/dir
```

### Publish without test files

```bash
bdy art cmp pub artifact-identifier /path/to/dir --ignore "tests,**/*.log"
```


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