# Azion CLI clone

The Azion CLI `clone` command copies a resource under a new name. Its one subcommand, `application`, creates an [Application](/en/documentation/platform/applications/) with the configuration of an existing one, its [Rules Engine](/en/documentation/platform/applications/rules-engine/) rules included. The options every command accepts, such as `--format`, `--out`, and `-y`, are on [Global options](/en/documentation/devtools/cli/globals/).

---

## Usage

`azion clone` takes the type of the resource to copy as its subcommand:

```bash
azion clone <subcommand> [flags]
```

The command takes no flags of its own. `-h` or `--help` prints the help of the command. The only subcommand is `application`.

---

## Application

`azion clone application` creates an application from the configuration of the application whose ID you pass:

```bash
azion clone application [flags]
```

| Flag               | Short | Type   | Default | Description                                                                           |
| ------------------ | ----- | ------ | ------- | ------------------------------------------------------------------------------------- |
| `--application-id` | —     | int    | —       | ID of the application to copy.                                                        |
| `--name`           | —     | string | —       | **Required**. Name of the new application. Without it, the command asks for the name. |

The command prints the name of the new application, not its ID. To find the ID, run `azion list application`. Your account needs permission to clone applications.

---

## Examples

Each example shows the command and the output it prints.

### Clone an application

This command copies the application with ID `1234567892` into a new application named `my-site-clone`:

```bash
azion clone application --application-id 1234567892 --name my-site-clone
```

The command confirms the copy:

```text
Application my-site-clone cloned successfully
```

### Find the ID of the clone

This command lists the applications whose name contains `my-site`:

```bash
azion list application | grep -E 'ID|my-site'
```

The clone appears with an ID of its own, next to the application it was copied from:

```text
ID          NAME             ACTIVE
1234567892  my-site          true
1234567895  my-site-clone    true
```

### Check the rules of the clone

This command lists the rules of the clone in the request phase:

```bash
azion list rules-engine --application-id 1234567895 --phase request
```

The clone holds the rules of the application it was copied from:

```text
ID      NAME
123465  Deliver Static Assets and Set Cache Policy
123463  Redirect to index.html
123464  Redirect to index.html for Subpaths
```

---

## Related resources

- [Global options](/en/documentation/devtools/cli/globals.md): The options every command accepts, such as `--format`, `--out`, and `-y`.
- [Azion CLI application](/en/documentation/devtools/cli/resources/application.md): The commands that list, describe, update, and delete the clone after you create it.
- [Azion CLI rules-engine](/en/documentation/devtools/cli/resources/rules-engine.md): The commands that change the rules the clone copied from its source.
- [Applications](/en/documentation/platform/applications.md): The resource this command copies, and the delivery settings it holds.
