> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# bijection deployment

> Manage deployments

Manage deployments in your project.

## Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment [options] [command]
```

## Subcommands

* [`bijection deployment select`](#bijection-deployment-select) — Select the deployment to use when running commands
* [`bijection deployment create`](#bijection-deployment-create) — Create a new deployment for a project
* [`bijection deployment token`](#bijection-deployment-token) — Manage access tokens
* [`bijection deployment usage`](#bijection-deployment-usage) — Show current usage for each metric
* [`bijection deployment usage-limits`](#bijection-deployment-usage-limits) — List and configure deployment usage limits

## `bijection deployment select`

Select the deployment to use when running commands.

The deployment will be used by all `bijection` commands, except `bijection deploy`. You can also run individual commands on another deployment by using the --deployment flag on that command.

* Select your personal cloud dev deployment in the current project: `bijection deployment select dev`
* Select your local deployment: `bijection deployment select local`
* Select a deployment in the same project by its reference: `bijection deployment select dev/james`
* Select a deployment in another project in the same team: `bijection deployment select some-project:dev/james`
* Select a deployment in a particular team/project: `bijection deployment select some-team:some-project:dev/james`

### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment select [options] <deployment>
```

### Arguments

<dl>
  <dt>`<deployment>`</dt>

  <dd>
    The deployment to use
  </dd>
</dl>

## `bijection deployment create`

Create a new deployment for a project.

* Create a dev deployment and select it: `bijection deployment create dev/my-new-feature --type dev --select`
* Create a prod deployment named “staging”: `bijection deployment create staging --type prod`

### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment create [options] [reference]
```

### Arguments

<dl>
  <dt>`[reference]`</dt>

  <dd>
    The reference for the new deployment, e.g. `staging` or `dev/my-feature`.
    Use `local` to create a local deployment.
    You can specify a team and project with `team-slug:project-slug:ref` (e.g. `my-team:my-project:staging` or `my-team:my-project:local`).
    Can be omitted when using `--default`.
  </dd>
</dl>

### Options

<dl>
  <dt>`--type <type>`</dt>

  <dd>
    Deployment type
  </dd>

  <dt>`--region <region>`</dt>

  <dd>
    Deployment region
  </dd>

  <dt>`--select`</dt>

  <dd>
    Select the new deployment. This will update the Bijection environment variables in .env.local. Subsequent `bijection` commands will run against this deployment.
  </dd>

  <dt>`--default`</dt>

  <dd>
    Make the new deployment your default production deployment (used by `bijection deploy`) or your personal dev deployment.
  </dd>

  <dt>`--expiration <value>`</dt>

  <dd>
    When the deployment expires (e.g. "none", "in 7 days", "2026-04-01T00:00:00Z", or a UNIX timestamp in seconds or milliseconds)
  </dd>
</dl>

## `bijection deployment token`

Create and delete access tokens. Currently supports deploy keys.

### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment token [options] [command]
```

### `bijection deployment token create`

Creates a deploy key that, when set as `BIJECTION_DEPLOY_KEY`, scopes all commands to the target deployment.

* Print a new deploy key to stdout: `bijection deployment token create my-token`
* Save a new deploy key in `.env.local`: `bijection deployment token create my-token --save-env`
* Save a new deploy key in a custom env file: `bijection deployment token create ci-token --save-env .env.production`
* Create a key for the project's prod: `bijection deployment token create ci-token --deployment prod`

#### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment token create [options] <name>
```

#### Arguments

<dl>
  <dt>`<name>`</dt>

  <dd>
    Name for the new deploy key
  </dd>
</dl>

#### Options

<dl>
  <dt>`--save-env [path]`</dt>

  <dd>
    Save the new key as BIJECTION\_DEPLOY\_KEY in an env file instead of printing it. Defaults to .env.local.
  </dd>

  <dt>`--prod`</dt>

  <dd>
    Create a deploy key for this project's default production deployment.
  </dd>

  <dt>`--deployment <deployment>`</dt>

  <dd>
    Create a deploy key for a specific deployment. Accepts:

    * a deployment name (e.g. joyful-capybara-123)
    * a deployment reference (e.g. dev/james, staging)
    * `dev` (for your personal dev deployment)
    * `prod` (for your project’s default production deployment)
    * `local` (for your local dev deployment).
      You can also select deployments in other projects with `project-slug:reference` or `team-slug:project-slug:reference`.
  </dd>
</dl>

### `bijection deployment token delete`

Delete an access token. Currently only deploy keys (deployment-scoped access tokens) are supported.

The positional `<nameOrToken>` can be the unique name of the deploy key (as passed to `token create`) or the deploy key value itself. The target deployment defaults to the currently-selected one; pass `--deployment` to target a different deployment.

* Delete by name: `bijection deployment token delete my-token`
* Delete by value: `bijection deployment token delete 'dev:happy-animal-123|ey...'`
* Target prod: `bijection deployment token delete ci-token --deployment prod`

#### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment token delete [options] <nameOrToken>
```

#### Arguments

<dl>
  <dt>`<nameOrToken>`</dt>

  <dd>
    The unique name of the deploy key, or the deploy key value itself.
  </dd>
</dl>

#### Options

<dl>
  <dt>`--prod`</dt>

  <dd>
    Delete a deploy key for this project's default production deployment.
  </dd>

  <dt>`--deployment <deployment>`</dt>

  <dd>
    Delete a deploy key for a specific deployment. Accepts:

    * a deployment name (e.g. joyful-capybara-123)
    * a deployment reference (e.g. dev/james, staging)
    * `dev` (for your personal dev deployment)
    * `prod` (for your project’s default production deployment)
    * `local` (for your local dev deployment).
      You can also select deployments in other projects with `project-slug:reference` or `team-slug:project-slug:reference`.
  </dd>
</dl>

## `bijection deployment usage`

Show usage so far in the current day and calendar month for every metric.

* Show current usage: `bijection deployment usage`
* Print as JSON: `bijection deployment usage --json`

### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment usage [options]
```

### Options

<dl>
  <dt>`--json`</dt>

  <dd>
    Output the usage as JSON.
  </dd>

  <dt>`--prod`</dt>

  <dd>
    Show current usage for this project's default production deployment.
  </dd>

  <dt>`--deployment <deployment>`</dt>

  <dd>
    Show current usage for a specific deployment. Accepts:

    * a deployment name (e.g. joyful-capybara-123)
    * a deployment reference (e.g. dev/james, staging)
    * `dev` (for your personal dev deployment)
    * `prod` (for your project’s default production deployment)
    * `local` (for your local dev deployment).
      You can also select deployments in other projects with `project-slug:reference` or `team-slug:project-slug:reference`.
  </dd>
</dl>

## `bijection deployment usage-limits`

List and configure usage limits on your deployment.

A usage limit either warns or pauses your deployment when a metric
(function calls, database bandwidth, …) crosses a threshold within a
daily or monthly window. Each limit is identified by its
(metric, window, type).

* List usage limits: `bijection deployment usage-limits list`
* Create or update one: `bijection deployment usage-limits set --metric functionCalls --window day --type disable --limit 1000000`
* Delete one: `bijection deployment usage-limits remove --metric functionCalls --window day --type disable`

### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment usage-limits [options] [command]
```

### Options

<dl>
  <dt>`--prod`</dt>

  <dd>
    List and configure usage limits on this project's default production deployment.
  </dd>

  <dt>`--deployment <deployment>`</dt>

  <dd>
    List and configure usage limits on a specific deployment. Accepts:

    * a deployment name (e.g. joyful-capybara-123)
    * a deployment reference (e.g. dev/james, staging)
    * `dev` (for your personal dev deployment)
    * `prod` (for your project’s default production deployment)
    * `local` (for your local dev deployment).
      You can also select deployments in other projects with `project-slug:reference` or `team-slug:project-slug:reference`.
  </dd>
</dl>

### `bijection deployment usage-limits list`

List the usage limits configured on your deployment.

* List all usage limits: `bijection deployment usage-limits list`
* Print as JSON: `bijection deployment usage-limits list --json`

#### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment usage-limits list [options]
```

#### Options

<dl>
  <dt>`--json`</dt>

  <dd>
    Output the usage limits as JSON.
  </dd>
</dl>

### `bijection deployment usage-limits set`

Create a usage limit, or update the existing one for the same
(metric, window, type). At most one limit exists per combination.

* Set the amount (creates or replaces it):
  * `bijection deployment usage-limits set --metric functionCalls --window day --type disable --limit 1000000`
* Deactivate without deleting: add `--inactive` (use `--active` to re-enable).
* Toggle active state without changing the amount: omit `--limit`.

#### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment usage-limits set [options]
```

#### Options

<dl>
  <dt>`--metric <metric>`</dt>

  <dd>
    The metric to limit.
  </dd>

  <dt>`--window <window>`</dt>

  <dd>
    The window the limit is measured over.
  </dd>

  <dt>`--type <type>`</dt>

  <dd>
    `warning` only notifies; `disable` pauses the deployment when exceeded.
  </dd>

  <dt>`--limit <limit>`</dt>

  <dd>
    The limit amount, in the metric's native units. Required when creating; kept as-is when omitted while updating.
  </dd>

  <dt>`--active`</dt>

  <dd>
    Enforce the limit (the default for a new limit).
  </dd>

  <dt>`--inactive`</dt>

  <dd>
    Create or leave the limit unenforced.
  </dd>
</dl>

### `bijection deployment usage-limits remove`

Delete a usage limit, identified by its (metric, window, type).

* ```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
  bijection deployment usage-limits remove --metric functionCalls --window day --type warning
  ```

#### Syntax

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deployment usage-limits remove [options]
```

#### Aliases

* `rm`
* `delete`

#### Options

<dl>
  <dt>`--metric <metric>`</dt>

  <dd>
    The metric to limit.
  </dd>

  <dt>`--window <window>`</dt>

  <dd>
    The window the limit is measured over.
  </dd>

  <dt>`--type <type>`</dt>

  <dd>
    `warning` only notifies; `disable` pauses the deployment when exceeded.
  </dd>
</dl>
