docs
  1. Storefront Application
  2. Storefront Cli
  3. Setup Cms

setup cms

Overview

The setup cms <cms provider> command is an interactive tool that streamlines the setup of your CMS integration by generating the necessary configuration files for your Nuxt application.

The process begins by validating that you're in a valid Nuxt application directory. You can then choose to run the command interactively, where it will prompt you for the required values, or provide all the necessary information directly via command-line flags.

Once the command has all the inputs, it automatically performs three key tasks: it configures the CMS provider within your nuxt.config.ts, sets up all the essential CMS environment variables for local development, and uploads the content model to your CMS space if this feature was enabled.

Provider Commands

We have split the CMS setup into specialized subcommands to provide a more tailored experience for each provider.

Contentful

Configures the Storefront Application to use Contentful.

Usage:

Flags:

FlagRequiredDescription
-s, --space-idYesYour unique Contentful Space ID.
--access-tokenYesDelivery API token for fetching published content.
--preview-tokenYesPreview API token for draft/unpublished content.
-i, --import-content-modelYestrue or false. Best used with empty spaces.
--management-tokenYes*Required for importing the content model (-i true).

Contentstack

Configures the Storefront Application to use Contentstack.

Usage:

Flags:

FlagRequiredDescription
-k, --api-keyYesThe Stack API Key for the target stack.
-d, --delivery-tokenYesToken for fetching published content.
-p, --preview-tokenYesToken for fetching draft/preview content.
-r, --regionYesStack region (e.g., na, eu, azure-na, gcp-na).
-e, --environmentYesThe target environment (e.g., production).
-b, --branchNoBranch (Default: main).
-i, --import-content-modelYestrue or false.
-m, --management-tokenYes*Required for importing content model (-i true).

Storyblok

Configures the Storefront Application to use Storyblok.

Usage:

FlagRequiredDescription
-s, --space-idYesYour unique Storyblok Space ID.
--access-tokenYesPreview or Public token for the Delivery API.
-i, --import-content-modelYestrue or false.
-p, --personal-access-tokenYes*Management API token. Required for content import.

Global Flags

The following flags are available across all sfcli setup cms subcommands and provide control over the CLI's behavior, output format, and logging verbosity.

FlagDescriptionDefault
--jsonFormats the command output as a JSON string. Useful for CI/CD pipelines or automated scripting.false
--log-levelSpecifies the verbosity of the logs. Options: debug, warn, error, info, trace.info
--no-config-filePrevents the CLI from generating or updating a configuration file on your local machine.false
-h, --helpDisplays help information and usage instructions for the specific command.N/A
--no-headerDisables the printing of the initial header/banner when the command starts.false