# WP-CLI commands

<!-- Generated by `pnpm docs:reference`. Do not edit this file; change the code it is read from. -->

SleekPixel registers these WP-CLI commands. Each is documented by the WP-CLI docblock where it is declared; `wp help <command>` prints the same text on a site.

## `wp sleek pixel`

Renders SleekPixel image designs.

## `wp sleek pixel cache`

Warms and flushes the rendered image cache.

## `wp sleek pixel cache flush`

Deletes cached renders.

```bash
wp sleek pixel cache flush [--image=<image-id>] [--yes]
```

| Argument | Description |
| --- | --- |
| `[--image=<image-id>]` | Only delete the files rendered from this image design. Without it every rendered file is deleted. |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek pixel cache flush --yes
```

## `wp sleek pixel cache warm`

Pre-generates cached renders for posts.

Renders every image design (or one, with --image) for every
published post of a post type (or of all public post types, with
--all), so page views do not pay the ImageMagick cost. Each post gets
the renders its own page asks for: the outputs among --tags whose
conditions hold there, Open Graph and Twitter Card as one render and
the featured image as another.

```bash
wp sleek pixel cache warm [--image=<image-id>] [--post-type=<post-type>] [--all] [--tags=<tags>]
```

| Argument | Description |
| --- | --- |
| `[--image=<image-id>]` | Only warm this image design. |
| `[--post-type=<post-type>]` | Warm posts of this post type. |
| `[--all]` | Warm published posts of every public post type. |
| `[--tags=<tags>]` | Comma-separated outputs to warm: openGraph, twitterCard and featuredImage. Default openGraph,twitterCard. |

**Examples**

```bash
wp sleek pixel cache warm --post-type=post
wp sleek pixel cache warm --image=123 --all
```

## `wp sleek pixel font`

Manages the custom fonts.

## `wp sleek pixel font delete`

Deletes a custom font and its attachment.

```bash
wp sleek pixel font delete <font-id> [--yes]
```

| Argument | Description |
| --- | --- |
| `<font-id>` | The font id. |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek pixel font delete 123 --yes
```

## `wp sleek pixel font import`

Imports a font file as a custom font.

The file is copied into the uploads directory and registered as an
attachment, like an upload through the app.

```bash
wp sleek pixel font import <file> [--name=<name>] [--porcelain]
```

| Argument | Description |
| --- | --- |
| `<file>` | Path to the font file, like a .ttf, .otf, .woff or .woff2. |
| `[--name=<name>]` | A display name. Defaults to the file name. |
| `[--porcelain]` | Output just the new font id. |

**Examples**

```bash
wp sleek pixel font import ./Inter-Regular.ttf --name=Inter
```

## `wp sleek pixel font list`

Lists every custom font.

```bash
wp sleek pixel font list [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--format=<format>]` | Output format. Supports table and json. |

**Examples**

```bash
wp sleek pixel font list --format=json
```

## `wp sleek pixel gf-key`

Manages the Google Fonts API key.

## `wp sleek pixel gf-key check`

Checks a Google Fonts API key against the Google Fonts API.

```bash
wp sleek pixel gf-key check <key>
```

| Argument | Description |
| --- | --- |
| `<key>` | The Google Fonts API key to check. |

**Examples**

```bash
wp sleek pixel gf-key check abc123
```

## `wp sleek pixel gf-key delete`

Deletes the stored Google Fonts API key.

```bash
wp sleek pixel gf-key delete [--yes]
```

| Argument | Description |
| --- | --- |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek pixel gf-key delete --yes
```

## `wp sleek pixel gf-key set`

Saves the Google Fonts API key.

The key is stored encrypted, like a key saved through the app. Run
`wp sleek pixel gf-key check` first to verify it.

```bash
wp sleek pixel gf-key set <key>
```

| Argument | Description |
| --- | --- |
| `<key>` | The Google Fonts API key. |

**Examples**

```bash
wp sleek pixel gf-key set abc123
```

## `wp sleek pixel image`

Manages the image designs.

## `wp sleek pixel image delete`

Deletes an image design.

```bash
wp sleek pixel image delete <image-id> [--yes]
```

| Argument | Description |
| --- | --- |
| `<image-id>` | The image design id. |
| `[--yes]` | Skip the confirmation prompt. |

**Examples**

```bash
wp sleek pixel image delete 123 --yes
```

## `wp sleek pixel image get`

Shows one image design.

```bash
wp sleek pixel image get <image-id> [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `<image-id>` | The image design id. |
| `[--format=<format>]` | Output format. Supports table and json. The json output carries the full design with its elements, settings and locations. |

**Examples**

```bash
wp sleek pixel image get 123 --format=json
```

## `wp sleek pixel image list`

Lists every image design.

```bash
wp sleek pixel image list [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--format=<format>]` | Output format. Supports table, json and ids. The json output carries the full designs with their elements, settings and locations. |

**Examples**

```bash
wp sleek pixel image list --format=json
```

## `wp sleek pixel render`

Renders an image design.

Without --out or --base64 the image is rendered into the plugin
cache, exactly like the front end does, and its URL is printed.

```bash
wp sleek pixel render <image-id> [--post=<post-id>] [--tags=<tags>] [--out=<path>] [--base64]
```

| Argument | Description |
| --- | --- |
| `<image-id>` | The image design id (see `wp sleek pixel image list`). |
| `[--post=<post-id>]` | The post whose data fills dynamic fields in the design. |
| `[--tags=<tags>]` | Comma-separated cache tags for the cache entry, matching the front end tags openGraph, twitterCard, featuredImage and blockEditorSidebar. Default openGraph,twitterCard. Ignored when the image is written to a file or printed as base64. |
| `[--out=<path>]` | Write the image to this file instead of the cache and print the path. |
| `[--base64]` | Print the rendered image as base64 instead of writing a file. |

**Examples**

```bash
wp sleek pixel render 123 --post=1
wp sleek pixel render 123 --out=/tmp/og.png
```

## `wp sleek pixel settings`

Manages the plugin settings.

## `wp sleek pixel settings get`

Shows the plugin settings.

```bash
wp sleek pixel settings get [--format=<format>]
```

| Argument | Description |
| --- | --- |
| `[--format=<format>]` | Output format. Supports table and json. |

**Examples**

```bash
wp sleek pixel settings get --format=json
```

## `wp sleek pixel settings set`

Updates plugin settings.

```bash
wp sleek pixel settings set [--<field>=<value>]
```

| Argument | Description |
| --- | --- |
| `[--<field>=<value>]` | One or more settings to update. The settings Pixel reads are fileFormat (png, jpeg or webp) and imageProcessing (sync or async). |

**Examples**

```bash
wp sleek pixel settings set --fileFormat=jpeg
wp sleek pixel settings set --imageProcessing=async
```
