---
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-05-06T18:43:53.529Z"
---

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()` into a page file.

### Options

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code className="language-html shiki shiki-themes github-light github-light material-theme-palenight" language="html" style="">
        <span class="sqjlB">
          --renderer
        </span>
        
        <span class="sx-uw">
          <
        </span>
        
        <span class="sFfpx">
          renderer
        </span>
        
        <span class="sx-uw">
          >
        </span>
      </code>
    </td>
    
    <td>
      Force a specific renderer (<code>
        satori
      </code>
      
      , <code>
        takumi
      </code>
      
      , <code>
        browser
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code className="language-html shiki shiki-themes github-light github-light material-theme-palenight" language="html" style="">
        <span class="sqjlB">
          --path
        </span>
        
        <span class="sx-uw">
          <
        </span>
        
        <span class="sFfpx">
          dir
        </span>
        
        <span class="sx-uw">
          >
        </span>
      </code>
    </td>
    
    <td>
      Custom output directory (default: <code>
        components/OgImage/
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

### 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

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code className="language-html shiki shiki-themes github-light github-light material-theme-palenight" language="html" style="">
        <span class="sqjlB">
          --from
        </span>
        
        <span class="sx-uw">
          <
        </span>
        
        <span class="sFfpx">
          renderer
        </span>
        
        <span class="sx-uw">
          >
        </span>
      </code>
    </td>
    
    <td>
      Source renderer to migrate from
    </td>
  </tr>
  
  <tr>
    <td>
      <code className="language-html shiki shiki-themes github-light github-light material-theme-palenight" language="html" style="">
        <span class="sqjlB">
          --to
        </span>
        
        <span class="sx-uw">
          <
        </span>
        
        <span class="sFfpx">
          renderer
        </span>
        
        <span class="sx-uw">
          >
        </span>
      </code>
    </td>
    
    <td>
      Target renderer to migrate to
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --dry-run
      </code>
    </td>
    
    <td>
      Preview changes without applying them
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --yes
      </code>
    </td>
    
    <td>
      Skip confirmation prompts (CI mode)
    </td>
  </tr>
</tbody>
</table>

### 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

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --edge
      </code>
    </td>
    
    <td>
      Also install Wasm variants for edge runtimes (Cloudflare, Vercel Edge)
    </td>
  </tr>
</tbody>
</table>

### 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

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --dry-run
      </code>
    </td>
    
    <td>
      Preview changes without applying them
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --yes
      </code>
    </td>
    
    <td>
      Skip confirmation prompts
    </td>
  </tr>
  
  <tr>
    <td>
      <code className="language-html shiki shiki-themes github-light github-light material-theme-palenight" language="html" style="">
        <span class="sqjlB">
          --renderer
        </span>
        
        <span class="sx-uw">
          <
        </span>
        
        <span class="sFfpx">
          renderer
        </span>
        
        <span class="sx-uw">
          >
        </span>
      </code>
    </td>
    
    <td>
      Default renderer for components without a suffix
    </td>
  </tr>
</tbody>
</table>
