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

# devbox image optimize

> Optimize a Devbox base image for a site.

Optimize a registered Linux base image for a Namespace site. Without `--name` or `--site`, the CLI prompts you to select the missing values.

## Usage

```bash theme={null}
devbox image optimize [flags]
```

## Examples

### Optimize an image for a site

```bash theme={null}
devbox image optimize --name my-team/golang --site iad
```

## Options

<ResponseField name="--all_images" type="boolean" default="false">
  Include every image version in the interactive picker instead of only the latest version in each repository.
</ResponseField>

<ResponseField name="--name" type="string">
  Optimize an image repository directly and skip interactive image selection. If multiple versions exist, the newest matching image is selected.
</ResponseField>

<ResponseField name="--site" type="string">
  Set the target site, such as `ord`, `iad`, or `zrh`, and skip interactive site selection.
</ResponseField>

## Related topics

<Columns cols={3}>
  <Card title="devbox image list" icon="list" href="/docs/reference/devbox-cli/image-list">
    Find available image names.
  </Card>

  <Card title="devbox image build" icon="hammer" href="/docs/reference/devbox-cli/image-build">
    Build and optimize an image in one command.
  </Card>

  <Card title="Custom images" icon="hard-drive" href="/docs/devbox/images">
    Learn how image optimization fits the image workflow.
  </Card>
</Columns>
