# Arc XP CLI: Themes Package

Source: https://dev.arcxp.com/themes/how-to-guides/themes-cli-package/

Utility scripts for managing site settings and migrating from Themes Settings to PageBuilder Deployer.

The Arc XP CLI [Themes Package](https://www.npmjs.com/package/@arcxp/cli#arcxp-themes) offers a set of tools for managing and manipulating `blocks.json` site settings, deploying theme bundles, and customizing themes across environments. These utilities empower developers and site managers to:

- View, export, and convert configuration properties in a structured, reproducible format
- Deploy bundles to various environments
- Create forks of existing themes for customization
- Support migration from Themes Settings to PageBuilder Deployer workflows

## Block management

Allows developers to quickly copy blocks to their local project to use as is or for customization.

### `arcxp themes fork-block`

Fork a block from the themes repository into your local codebase

**Usage:**

Terminal window

```bash
arcxp themes fork-block [options]
```

**Options:**

- `-b, --block <block>`Block name to copy (e.g., ‘headline-block’)
- `-v, --themes-version <version>`Themes version to use (defaults to latest)
- `-n, --name <n>`Custom name for the copied block (defaults to `{blockName}-copy`)
- `-e, --eject`Remove the block from `blocks.json` after copying (for customized blocks)

## Managing site settings

The `arcxp themes site-properties` group of subcommands is used to interact with **Themes Settings**, such as viewing current site configurations, exporting them to local files, and converting between different file formats.

## Subcommands

### `arcxp themes site-properties print`

Outputs the current site properties (including global and site-specific settings) directly to the terminal.

**Usage:**

Terminal window

```bash
arcxp themes site-properties print
```

**Example Output:**

```json
{
  "global": {
    "property1": "value1",
    "property2": "value2"
  },
  "site": {
    "site-id-1": {
      "propertyA": "valueA"
    },
    "site-id-2": {
      "propertyB": "valueB"
    }
  }
}
```

### `arcxp themes site-properties write-local-settings-file`

Exports site properties from the current Arc XP environment and saves them as a `.json` file on your local machine. This is useful for version control, auditing, or making bulk edits offline.

**Usage:**

Terminal window

```bash
arcxp themes site-properties write-local-settings-file [options]
```

**Options:**

- `-o, --outputPath <outputPath>`Specify a full path and filename for the output JSON file. If not provided, the file will default to a name like:  
```
blocks-YYYY-MM-DD-HHmmss.json
```

**Example:**

Terminal window

```bash
arcxp themes site-properties write-local-settings-file -o ./site-settings.json
```

### `arcxp themes site-properties convert-properties`

Converts between `.json` and `.xlsx` formats for site properties. This is particularly useful for non-developers who prefer working in spreadsheet tools, or for bulk edits across multiple sites.

- When converting to `.xlsx`:

  - Global settings are stored in a dedicated sheet.
  - Each site gets its own individual sheet for properties.
- When converting to `.json`:

  - An `.xlsx` file is parsed and merged into a valid JSON structure.

**Usage:**

Terminal window

```bash
arcxp themes site-properties convert-properties
```

**Note:**This command operates in **interactive mode only**. You will be prompted to choose the source file and target format during execution.

**Example Workflow:**

1. Export a `.json` with `write-local-settings-file`.
2. Run `convert-properties` to transform the `.json` into a human-readable `.xlsx`.
3. Edit in Excel.
4. Convert the `.xlsx` back to `.json`.
5. Push changes using Arc XP tools or through the CMS.
