# CLI

Daytona provides command-line access to core features for interacting with Daytona Sandboxes, including managing their lifecycle, snapshots, and more.

The CLI reference lists all commands supported by the `daytona` command-line tool, complete with a description of their behavior, and any supported flags.
You can access this documentation on a per-command basis by appending the `--help`/`-h` flag when invoking `daytona`.

## Installation

Install the Daytona CLI to interact with Daytona sandboxes from the command line.


```bash
brew install daytonaio/cli/daytona
```

Trust the tap once so routine `brew upgrade` keeps the Daytona CLI up to date. Recent Homebrew versions require third-party taps to be explicitly trusted; without it, a bare `brew upgrade` skips the Daytona tap and the CLI goes stale:

```bash
brew trust daytonaio/cli
```

To upgrade the Daytona CLI to the latest version:

```bash
brew upgrade daytonaio/cli/daytona
```

Alternatively, install directly without Homebrew:

For Apple Silicon (`arm64`):

  ```bash
  sudo curl -fL https://github.com/daytona/clients/releases/latest/download/daytona-darwin-arm64 -o /usr/local/bin/daytona && sudo chmod +x /usr/local/bin/daytona
  ```

For Intel (`amd64`):

  ```bash
  sudo curl -fL https://github.com/daytona/clients/releases/latest/download/daytona-darwin-amd64 -o /usr/local/bin/daytona && sudo chmod +x /usr/local/bin/daytona
  ```


Choose the command for your Linux architecture. Both commands download the latest binary from GitHub releases and install it to `/usr/local/bin`, overwriting any existing version.

For `amd64` (`x86_64`):

  ```bash
  sudo curl -fL https://github.com/daytona/clients/releases/latest/download/daytona-linux-amd64 -o /usr/local/bin/daytona && sudo chmod +x /usr/local/bin/daytona
  ```

For `arm64` (`aarch64`):

  ```bash
  sudo curl -fL https://github.com/daytona/clients/releases/latest/download/daytona-linux-arm64 -o /usr/local/bin/daytona && sudo chmod +x /usr/local/bin/daytona
  ```


```bash
powershell -Command "irm https://get.daytona.io/windows | iex"
```


After installing the Daytona CLI, use the `daytona` command to interact with Daytona sandboxes from the command line.

{/* The section list below is generated by tools/v2/generate-cli-docs. Do not edit it directly; run yarn update-v2-cli-reference. */}

## Sections

The reference groups commands into the following sections. Global flags that apply to every command are listed under [`daytona`](#daytona).

| Section | Commands |
| :------ | :------- |
| [Login and context](https://www.daytona.io/docs/en/v2/cli/login-and-context.md) | [`daytona login`](https://www.daytona.io/docs/en/v2/cli/login-and-context.md#daytona-login), [`daytona logout`](https://www.daytona.io/docs/en/v2/cli/login-and-context.md#daytona-logout), [`daytona profile`](https://www.daytona.io/docs/en/v2/cli/login-and-context.md#daytona-profile), [`daytona whoami`](https://www.daytona.io/docs/en/v2/cli/login-and-context.md#daytona-whoami) |
| [Sandboxes and resources](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md) | [`daytona cpu-type`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-cpu-type), [`daytona image`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-image), [`daytona mac-model`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-mac-model), [`daytona region`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-region), [`daytona reservation`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-reservation), [`daytona sandbox`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-sandbox), [`daytona snapshot`](https://www.daytona.io/docs/en/v2/cli/sandboxes-and-resources.md#daytona-snapshot) |
| [Organization management](https://www.daytona.io/docs/en/v2/cli/organization-management.md) | [`daytona audit`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-audit), [`daytona billing`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-billing), [`daytona invite`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-invite), [`daytona key`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-key), [`daytona member`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-member), [`daytona org`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-org), [`daytona org-key`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-org-key), [`daytona project`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-project), [`daytona registry`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-registry), [`daytona role`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-role), [`daytona secret`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-secret), [`daytona service-account`](https://www.daytona.io/docs/en/v2/cli/organization-management.md#daytona-service-account) |
| [Other](https://www.daytona.io/docs/en/v2/cli/other.md) | [`daytona completion`](https://www.daytona.io/docs/en/v2/cli/other.md#daytona-completion), [`daytona config`](https://www.daytona.io/docs/en/v2/cli/other.md#daytona-config), [`daytona docs`](https://www.daytona.io/docs/en/v2/cli/other.md#daytona-docs), [`daytona version`](https://www.daytona.io/docs/en/v2/cli/other.md#daytona-version) |

{/* End of the generated section list. */}

{/* Everything below this line is generated by tools/v2/generate-cli-docs from the daytona CLI source. Do not edit it directly; run yarn update-v2-cli-reference. */}

## daytona

Daytona — sandboxes, images, snapshots and your organization, from the terminal

daytona is the command line for the Daytona platform.

At a terminal it is interactive: tables, pickers and a confirmation before
destructive actions. When piped, redirected or run with --output json it is a
strict tool: no prompts, --yes required for destructive verbs, JSON on stdout,
diagnostics on stderr. Authorization is decided by the server; the CLI only
presents the credential you give it.

Get started:

```shell
daytona login                     browser login (or --device on a remote host)
daytona image create py312 --ref python:3.12   import a registry image once
daytona sandbox create --image py312
daytona sandbox exec <id> -- python -c 'print(1)'
daytona docs --full               the whole reference in one page
```

__Global flags__

Global flags apply to every command.

| Long | Short | Type | Default | Description |
| :--- | :---- | :--- | :------ | :---------- |
| `--api-key` |  | `string` |  | static credential sent as-is; disables the saved login for this call (env DAYTONA_API_KEY) |
| `--api-url` |  | `string` |  | API base URL (env DAYTONA_API_URL) |
| `--debug` |  | `bool` |  | log every request to stderr |
| `--file` | `-f` | `string` |  | JSON request body from a file (or - for stdin); explicit flags override its fields |
| `--no-wait` |  | `bool` |  | return once the server accepts the operation instead of waiting for it to finish |
| `--org` |  | `string` |  | organization id or name for this call (env DAYTONA_ORG) |
| `--output` | `-o` | `string` | `table` | output format: table\|json\|yaml |
| `--profile` |  | `string` |  | config profile to use (env DAYTONA_PROFILE) |
| `--project` |  | `string` |  | project id or name for this call (env DAYTONA_PROJECT) |
| `--quiet` | `-q` | `bool` |  | suppress progress and informational output on stderr |
| `--region` |  | `string` |  | region slug; filters lists and places creates (env DAYTONA_REGION) |
| `--timeout` |  | `string` | `10m` | how long to wait for an operation to finish |
| `--yes` | `-y` | `bool` |  | skip confirmation prompts (env DAYTONA_YES=1) |