# create

## Usage

```bash
bdy target create|add [options]
```

## 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 |
| `--pipeline <identifier>` | Pipeline identifier to scope the target to. Requires --project |
| `--environment <identifier>` | Environment identifier to scope the target to. Resolves a workspace environment; add --project to point at a project environment |
| `--scope <scope>` | Force scope (WORKSPACE, PROJECT, ENVIRONMENT, PIPELINE). By default calculated by provided options and environmental variables (--pipeline, |
| `--environment, --project` | BUDDY_PROJECT, linked project) |
| `--yaml <content|@path>` | Complete target YAML. To specify file use @path/to/file format in value |
| `-h, --help` | display help for command |

## Examples

### Create workspace target from yaml file

```bash
bdy tg create --yaml @target.yml
```

### Create project target

```bash
bdy tg create --yaml @target.yml -p project
```

### Create pipeline target

```bash
bdy tg create --yaml @target.yml -p project --pipeline pipeline-identifier
```

### Create workspace environment target

```bash
bdy tg create --yaml @target.yml --environment environment-identifier
```

### Create project environment target

```bash
bdy tg create --yaml @target.yml -p project --environment environment-identifier
```


---
Original source: https://buddy.works/docs/cli/target/create