---
url: 'https://dxpr.com/hc/documentation/learn-dxpr-builder/development/drush-commands'
title: 'Drush commands | DXPR'
author:
  name: docs-sync
  url: 'https://dxpr.com/users/docs-sync'
date: '2026-10-23T14:31:17+00:00'
copyright: 'Copyright DXPR. All rights reserved.'
type: article
summary: 'Manage pages, templates and elements from the command line'
tags:
  - Tooling
image: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
published: true
og:
  site_name: DXPR
  updated_time: '2026-10-23T14:31:17+0000'
  'image:alt': 'DXPR, powered by Drupal: AI-powered Drupal for marketers.'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      mainEntity: {  }
    -
      '@type': TechArticle
      headline: 'Drush commands'
      description: 'Manage pages, templates and elements from the command line'
      image:
        '@type': ImageObject
        url: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
        width: '1200'
        height: '630'
      datePublished: '2026-10-23T14:31:17+0000'
      dateModified: '2026-10-23T14:31:17+0000'
      author:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      mainEntityOfPage: 'https://dxpr.com/hc/documentation/learn-dxpr-builder/development/drush-commands'
      articleSection: Tooling
    -
      '@type': WebPage
      '@id': 'https://dxpr.com/hc/documentation/learn-dxpr-builder/development/drush-commands'
      description: 'Manage pages, templates and elements from the command line'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://dxpr.com/'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
      inLanguage: en
---
[Help Center](/hc)/[Documentation](/hc/documentation) /[Learn DXPR Builder](/hc/documentation/learn-dxpr-builder) /[Extend](/hc/documentation/learn-dxpr-builder/extend) /[Tooling](/hc/documentation/learn-dxpr-builder/extend/tooling) # Drush commands.

Manage pages, templates and elements from the command line

 Learn DXPR BuilderExtendTooling

   ## In this guide

DXPR Builder provides Drush commands for managing pages, templates, elements and content migrations from the command line. Every command except `dxb:migrate` prints YAML.

## Page commands

### dxb:page:create

Creates a node from a DXPR Builder page template.

```bash
drush dxb:page:create drag_and_drop_page my_template \
  --title="New Landing Page"

```

**Arguments:**

| Argument | Description |
|---|---|
| `type` | Content type machine name |
| `template_id` | Page template machine name |

**Options:**

| Option | Description |
|---|---|
| `--title` | Node title (required) |
| `--field` | Builder field name (auto-detected) |
| `--status` | Published status: 0 or 1 (default: 0) |
| `--dry-run` | Validate without creating |

Alias: `dxpr-pc`

### dxb:page:get

Gets the DXPR Builder markup from an entity.

```bash
drush dxb:page:get 42
drush dxb:page:get 5 --entity-type=block_content

```

**Arguments:**

| Argument | Description |
|---|---|
| `entity_id` | Entity ID |

**Options:**

| Option | Description |
|---|---|
| `--entity-type` | Entity type (default: node) |
| `--field` | Builder field name (auto-detected) |

Alias: `dxpr-pg`

### dxb:page:update

Updates DXPR Builder markup on an entity.

```bash
drush dxb:page:update 42 --markup="<div>new</div>"
drush dxb:page:update 42 --markup=@/tmp/page.html

```

**Arguments:**

| Argument | Description |
|---|---|
| `entity_id` | Entity ID |

**Options:**

| Option | Description |
|---|---|
| `--entity-type` | Entity type (default: node) |
| `--field` | Builder field name (auto-detected) |
| `--markup` | New HTML (string or @file path) |
| `--dry-run` | Show what would change |

Alias: `dxpr-pu`

## Template commands

### dxb:template:list

Lists available DXPR Builder page templates.

```bash
drush dxb:template:list
drush dxb:template:list --category=Landing
drush dxb:template:list --detail

```

**Options:**

| Option | Description |
|---|---|
| `--category` | Filter by template category |
| `--profile` | Filter by profile ID |
| `--detail` | Include template markup body |

Alias: `dxpr-tl`

## User template commands

### dxb:user-template:list

Lists all DXPR Builder user templates.

```bash
drush dxb:user-template:list
drush dxb:user-template:list --global
drush dxb:user-template:list --uid=1
drush dxb:user-template:list --status=disabled

```

**Options:**

| Option | Description |
|---|---|
| `--uid` | Filter by owner user ID |
| `--global` | Show only global templates |
| `--status` | Filter by status: `enabled` or `disabled` |
| `--profile` | Filter by profile ID |
| `--detail` | Include template markup body |

Each template's output includes its `status`.

Alias: `dxpr-utl`

### dxb:user-template:create

Creates a reusable DXPR Builder user template.

```bash
drush dxb:user-template:create "Hero Section" \
  --markup="<div class='container'>...</div>"
drush dxb:user-template:create "Hero" \
  --markup=@/tmp/hero.html --global

```

**Arguments:**

| Argument | Description |
|---|---|
| `label` | Template display name |

**Options:**

| Option | Description |
|---|---|
| `--markup` | HTML (string or @file path) |
| `--global` | Make available to all users |
| `--dry-run` | Validate without creating |

Alias: `dxpr-utc`

## Element commands

### dxb:element:list

Lists available DXPR Builder elements (blocks, views).

```bash
drush dxb:element:list
drush dxb:element:list --type=block
drush dxb:element:list --profile=editor

```

**Options:**

| Option | Description |
|---|---|
| `--type` | Filter by type: block, view |
| `--profile` | Filter by profile ID |

Alias: `dxpr-el`

## Setup commands

### dxb:setup-ai

Installs the AI skill for coding assistants in the Composer project root: `.claude/skills/dxb` for Claude Code and `.agents/skills/dxb`for Codex, Gemini, Copilot and Cursor. Each copy holds `SKILL.md`, `references/` (one file per element, the Views and block elements, the parser rules, A/B testing and the workflow) and `scripts/` with the markup validator. `--check` changes nothing and lists every file that is not installed or is outdated.

```bash
drush dxb:setup-ai
drush dxb:setup-ai --check
drush dxb:setup-ai --host=claude

```

**Options:**

| Option | Description |
|---|---|
| `--host` | Target: `claude`, `agents` or `all` (default: `all`) |
| `--check` | Check if installed files are up to date, without changes |

Alias: `dxpr-sa`

## Migration commands

### dxb:migrate

Runs every content migration that has pending items, or only the one you name. It logs a line per migration and exits with a non-zero code when an item fails. The same migrations are listed at **DXPR Studio &gt; DXPR Builder &gt; Content Items &gt; Migrations**.

```bash
drush dxb:migrate
drush dxb:migrate --migration=circle_counter_circliful_to_bootstrap
drush dxb:migrate --migration=counter_duplicate_ids

```

**Options:**

| Option | Description |
|---|---|
| `--migration` | Run only this migration ID, even when nothing is counted as pending |
| `--force` | Take over the lock of a run still marked as in progress, after an abandoned run |

Migration IDs: `owl_carousel_to_bootstrap`, `circle_counter_circliful_to_bootstrap`, `progress_bar_legacy_to_bootstrap_extension`, `counter_duplicate_ids`, `entity_link_enrichment` and `alias_link_enrichment`.

The `counter_duplicate_ids` migration removes inner display IDs that repeat the owning Number counter or Circle counter ID, including saved A/B variants and displays inside additional HTML wrappers. It preserves wrapper anchors, distinct custom inner IDs and nested element boundaries. DXPR Builder also repairs these duplicates when rendering existing content.

Run Drupal's database updates (`drush updb` or `update.php`) after deployment. The dedicated `counter_duplicate_ids` post-update migrates stored fields and reusable templates even on sites that already ran the earlier content updates. Use the command above for content imported afterward. Rebuild Drupal's caches after deploying the updated services.

Alias: `dxpr-migrate`