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

# cvms init-scripts

> Show or change the platform init scripts a CVM runs

> [!NOTE]
>
> This command is marked as unstable and may change in future releases.

## Command: `phala cvms init-scripts`

### Syntax

```
phala cvms init-scripts [options] [<cvm_id>] [<slug>] [<state>]
```

### Description

Show or change the platform init scripts a CVM runs. With only a CVM, it lists the scripts. With a script name and `on` or `off`, it turns that script on or off and keeps the others as they are.

Turning a script on or off changes the CVM's compose, so the CVM restarts. See [Init scripts](https://docs.phala.com/phala-cloud/cvm/advanced-settings.md#init-scripts).

### Arguments

| Argument | Description |
| - | - |
| `<cvm_id>?` | CVM identifier (UUID, app\_id, instance\_id, or name) |
| `<slug>?` | Platform init script (`docker_cleanup`) |
| `<state>?` | `on` or `off` |

Pass both `<slug>` and `<state>`, or neither.

### Options

| Option | Description |
| - | - |
| `--confirm-data-wipe` | Confirm turning on `docker_cleanup`, which erases container stores on every boot |

### Advanced Options

| Option | Description |
| - | - |
| `--prepare-only` | Prepare the update and print the compose hash. Skips on-chain operations. |
| `--compose-hash <value>` | Compose hash from a prepare-only update |
| `--transaction-hash <value>` | Transaction hash proving on-chain compose hash registration. Pass `already-registered` to skip the proof and rely on state-only verification. |
| `--private-key <value>` | Private key for signing on-chain transactions (or set PRIVATE\_KEY env var) |
| `--rpc-url <value>` | RPC URL for on-chain KMS transactions (or set ETH\_RPC\_URL env var) |

### Global Options

| Option | Description |
| - | - |
| `-h, --help` | Show help information for the current command |
| `-v, --version` | Show CLI version |
| `--api-token TOKEN, --api-key TOKEN` | API token for authenticating with Phala Cloud |
| `-j, --json, --no-json` | Output in JSON format |
| `-i, --interactive` | Enable interactive mode |
| `--cvm-id <value>` | CVM identifier (UUID, app\_id, instance\_id, or name) |
| `--profile PROFILE` | Temporarily use a different auth profile for this command |
| `--api-version <value>` | API version to use (e.g. 2026-01-21, 2026-05-22, 2026-06-23) |
| `--timeout SECONDS` | Request timeout in seconds (default 60) |

### Output

Without a script name, the command prints one row per script with the columns `SLUG`, `SELECTED`, `SELECTABLE`, and `REASON`. `SELECTED` says whether the CVM runs the script. `SELECTABLE` says whether you can turn it on for this CVM, and `REASON` says why not.

If the script is already in the state you asked for, the command says so and changes nothing.

### Examples

* List init scripts

```bash theme={"system"}
phala cvms init-scripts app_123
```

* Turn docker\_cleanup on

```bash theme={"system"}
phala cvms init-scripts app_123 docker_cleanup on --confirm-data-wipe
```

* Turn docker\_cleanup off

```bash theme={"system"}
phala cvms init-scripts app_123 docker_cleanup off
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.