@nextwp/cli

A CLI tool that handles typegen and more for your NextWP project.

Features

  • Typegen: Automatically generate types for your NextWP project.
  • ACF JSON: Automatically sync ACF fields between your WordPress and Next.js projects.

Installation

Make sure you have curl and unzip installed on your system, then run the following command:

curl -fsSL https://nextwp.org/cli | bash

Usage

Lists the available commands and their descriptions.

nextwp --help

Generates TS files at types/${postType}.ts for the post types and fields for your NextWP project.

nextwp typegen

Pulls ACF fields from your WordPress project and saves them to your Next.js project.

nextwp pull-acf-json

Was this page helpful?