# CLI

Rendering is the expensive part of Pixel, which is what the terminal is good
at. The `wp sleek pixel` commands render images, warm and flush the cache, and
manage designs, fonts, settings and the Google Fonts key, so deploy scripts,
cron jobs and coding agents can drive Pixel without the admin. Every command,
with its arguments and examples, is in the
[CLI reference](/docs/pixel/reference/cli.md).

## Rendering

`wp sleek pixel render` renders one design, optionally for a post. By default
it renders into Pixel's cache, exactly as a page would, and prints the file's
URL; it can instead write the image to a file of your choice or print it as
base64. It always renders immediately, whatever the
[image processing](/docs/pixel/settings/options.md#image-processing) setting.
Rendering needs the Imagick extension.

## The cache

`wp sleek pixel cache warm` renders every design, or one, ahead of time for
the published posts of a post type, or of all post types, so the first visitor
never waits; run it after a deploy or a content import. Each post gets the
files its own page asks for: the outputs whose conditions hold there, with
Open Graph and Twitter Card in one file and the featured image in another. By
default it renders the Open Graph and Twitter Card file, and its tags option
adds `featuredImage` or narrows to one output.

`wp sleek pixel cache flush` deletes rendered files, every one or those of one
design, which Pixel then renders again when they are next needed.

## Designs and fonts

Designs are made in the editor; the CLI lists, shows and deletes them with
`wp sleek pixel image list`, `wp sleek pixel image get` and
`wp sleek pixel image delete`. The JSON output carries the full design with
its elements, settings and conditions.

`wp sleek pixel font list`, `wp sleek pixel font import` and
`wp sleek pixel font delete` manage the [custom fonts](/docs/pixel/settings/custom-fonts.md);
an imported file is added to the media library like an upload.

## Settings and the Google Fonts key

`wp sleek pixel settings get` and `wp sleek pixel settings set` read and change
the [Output settings](/docs/pixel/settings/options.md#output); `set` refuses any
setting but `fileFormat` and `imageProcessing`.

`wp sleek pixel gf-key check` asks Google whether a key works,
`wp sleek pixel gf-key set` stores it encrypted, and
`wp sleek pixel gf-key delete` removes it.

## From the assistant

The workspace [assistant](/docs/pixel/ai/chat.md) can run the image, font, cache,
render and settings commands for you. The commands that delete something ask
for your confirmation first. The `gf-key` commands are not offered to it.
