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

# Clone

Write a deployment's config files onto the local file system.

To clone the config files of a device's current deployment, use [`miru device clone`](/references/cli/device-clone).

### API key scopes

If cloning from a [CI pipeline](/developers/ci/overview), the following API key scopes are required:

* `devices:read`
* `deployments:read`
* `config_instances:read`
* `releases:read`

### Usage

<Tabs>
  <Tab title="Current directory">
    By default, cloning a deployment writes the config files to the current directory.

    ```bash theme={null}
    miru deployment clone {deployment-id}
    ```
  </Tab>

  <Tab title="Custom root">
    Use the `--root` flag to write the config files to a custom root directory.

    ```bash theme={null}
    miru deployment clone {deployment-id} --root ./robot-42-fs
    ```
  </Tab>

  <Tab title="Device paths">
    Use `--root /` to write config files to the exact location they are written to on production devices.

    ```bash theme={null}
    miru deployment clone {deployment-id} --root /
    ```
  </Tab>
</Tabs>

<Tip>
  Use `sudo miru ...` to write config files to restricted paths.
</Tip>

**Arguments**

<ParamField path="deployment-id" type="string" required>
  Full deployment id (`dpl_…`). The dashboard short id (`DPL-7xKqW`) is not accepted.

  Examples: `dpl_7xKqW1mZ3nBvTgL5cRs9dYuP`
</ParamField>

**Flags**

<ParamField path="--root" type="string">
  Directory to write the cloned config files under. Defaults to the current directory.

  Each file is written at its device path relative to this directory, so `/srv/miru/configs/mobility.json` lands at `{--root}/srv/miru/configs/mobility.json`. Pass `/` to write at the computer's root.

  Examples: `./robot-42-fs`, `/`
</ParamField>

<ParamField path="--force" type="boolean">
  Overwrite files that already exist at the destination. Without `--force`, an existing file throws an error and is left untouched.
</ParamField>

### Examples

```bash theme={null}
$ miru deployment clone dpl_7xKqW1mZ3nBvTgL5cRs9dYuP

◐ Cloning deployment DPL-7xKqW

  /home/you
  └── srv/miru/configs
      ├── mobility.json  Mobility
      └── planning.json  Planning

✓ Clone successful
  Deployment  DPL-7xKqW · archived
  Device      robot-42
  Release     v1.1.0
  Files       2
```
