---
title: "CLI"
description: "Use the nuxt-og-image CLI to scaffold, manage, and migrate OG image components."
canonical_url: "https://nuxtseo.com/docs/og-image/guides/cli"
last_updated: "2026-09-05T15:39:42.211Z"
---

The `nuxt-og-image` CLI provides commands for scaffolding components, switching renderers, managing templates, and migrating between versions.

```bash
npx nuxt-og-image --help
```

## `create`

Scaffold a new OG image component with a starter template.

```bash
npx nuxt-og-image create [name] [--renderer <renderer>] [--path <dir>]
```

The command auto-detects your CSS framework (Tailwind CSS, [UnoCSS](https://unocss.dev), or plain CSS) and generates an appropriate template. The renderer is inferred from existing components or installed packages when `--renderer` is omitted.

After creating the component, you'll be prompted to insert `defineOgImage()`{lang="ts"} into a page file.

### Options

| Flag                                 | Description                                               |
| ------------------------------------ | --------------------------------------------------------- |
| `--renderer <renderer>`{lang="html"} | Force a specific renderer (`satori`, `takumi`, `browser`) |
| `--path <dir>`{lang="html"}          | Custom output directory (default: `components/OgImage/`)  |

### Examples

```bash
# Interactive - prompts for name and renderer
npx nuxt-og-image create

# Create a component with inferred renderer
npx nuxt-og-image create BlogPost

# Specify renderer explicitly
npx nuxt-og-image create BlogPost --renderer satori

# Custom output path
npx nuxt-og-image create BlogPost --path components/custom
```

## `switch`

Migrate OG image components from one renderer to another. Renames file suffixes, installs the target renderer's dependencies, and removes the old renderer's dependencies when no components remain using it.

```bash
npx nuxt-og-image switch [--from <renderer>] [--to <renderer>] [--dry-run] [--yes]
```

### Options

| Flag                             | Description                           |
| -------------------------------- | ------------------------------------- |
| `--from <renderer>`{lang="html"} | Source renderer to migrate from       |
| `--to <renderer>`{lang="html"}   | Target renderer to migrate to         |
| `--dry-run`                      | Preview changes without applying them |
| `--yes`                          | Skip confirmation prompts (CI mode)   |

### Examples

```bash
# Interactive - prompts for source and target
npx nuxt-og-image switch

# Migrate all satori components to takumi
npx nuxt-og-image switch --from satori --to takumi

# Preview what would change
npx nuxt-og-image switch --from satori --to takumi --dry-run

# Non-interactive (CI)
npx nuxt-og-image switch --from satori --to takumi --yes
```

## `enable`

Install dependencies for a specific renderer.

```bash
npx nuxt-og-image enable <renderer> [--edge]
```

### Options

| Flag     | Description                                                            |
| -------- | ---------------------------------------------------------------------- |
| `--edge` | Also install Wasm variants for edge runtimes (Cloudflare, Vercel Edge) |

### Examples

```bash
# Install takumi dependencies
npx nuxt-og-image enable takumi

# Install satori dependencies for edge runtime
npx nuxt-og-image enable satori --edge
```

## `list`

List available community templates.

```bash
npx nuxt-og-image list
```

## `eject`

Copy a community template into your project for customization. Community templates are only available in development; you must eject before production builds.

```bash
npx nuxt-og-image eject <name>
```

The template is copied to `components/OgImage/` (or `app/components/OgImage/` for Nuxt v4).

### Examples

```bash
npx nuxt-og-image eject NuxtSeo
npx nuxt-og-image eject BlogPost
```

## `generate-secret`

Generate a cryptographically secure signing secret for URL tamper protection.

```bash
npx nuxt-og-image generate-secret
```

This generates a 64-character hex string that should be set as the `NUXT_OG_IMAGE_SECRET` environment variable. See the [Security Guide](/docs/og-image/guides/security#url-signing) for details.

## `migrate v6`

Automate migration from v5 to v6. See the [Migration Guide](/docs/og-image/migration-guide/v6) for details.

```bash
npx nuxt-og-image migrate v6 [--dry-run] [--yes] [--renderer <renderer>]
```

### Options

| Flag                                 | Description                                      |
| ------------------------------------ | ------------------------------------------------ |
| `--dry-run`                          | Preview changes without applying them            |
| `--yes`                              | Skip confirmation prompts                        |
| `--renderer <renderer>`{lang="html"} | Default renderer for components without a suffix |