# add

## Usage

```bash
bdy context add [options] <name>
```

## Arguments

| **Argument** | **Description** |
| :--- | :--- |
| `name` | Context name (required) |

## Options

| **Option** | **Description** |
| :--- | :--- |
| `--context <name>` | Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation. |
| `--examples` | Show only examples; with this flag --format accepts text, json or jsonl |
| `--verbose` | Show REST API requests, responses, timing and retries on stderr |
| `--format <text|json>` | Output format: json, text. JSON CLI errors: {error:{code,message,hint}}, exit 1. Default: text (choices: "text", "json") |
| `-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 |
| `--token <token>` | REST API token for this context; omitted means inherit the default authentication mechanism |
| `--api <endpoint>` | HTTPS API endpoint for this context; omitted means inherit the default endpoint mechanism |
| `--from-link` | Resolve workspace and project from .bdy/project.json in the current directory |
| `--from-git` | Resolve workspace and project from a Buddy Git remote in the current repository |
| `--remote <name>` | Git remote to read with --from-git. Default: origin |
| `-h, --help` | display help for command |

## Examples

### Save a fixed workspace and project

```bash
bdy context add backend --workspace acme --project backend
```

### Resolve the buddy remote on each invocation

```bash
bdy context add company --from-git --remote buddy
```


---
Original source: https://buddy.works/docs/cli/context/add