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:
| Flag | Required | Description |
|---|---|---|
-s, --space-id | Yes | Your unique Contentful Space ID. |
--access-token | Yes | Delivery API token for fetching published content. |
--preview-token | Yes | Preview API token for draft/unpublished content. |
-i, --import-content-model | Yes | true or false. Best used with empty spaces. |
--management-token | Yes* | Required for importing the content model (-i true). |
Contentstack
Configures the Storefront Application to use Contentstack.
Usage:
Flags:
| Flag | Required | Description |
|---|---|---|
-k, --api-key | Yes | The Stack API Key for the target stack. |
-d, --delivery-token | Yes | Token for fetching published content. |
-p, --preview-token | Yes | Token for fetching draft/preview content. |
-r, --region | Yes | Stack region (e.g., na, eu, azure-na, gcp-na). |
-e, --environment | Yes | The target environment (e.g., production). |
-b, --branch | No | Branch (Default: main). |
-i, --import-content-model | Yes | true or false. |
-m, --management-token | Yes* | Required for importing content model (-i true). |
Storyblok
Configures the Storefront Application to use Storyblok.
Usage:
| Flag | Required | Description |
|---|---|---|
-s, --space-id | Yes | Your unique Storyblok Space ID. |
--access-token | Yes | Preview or Public token for the Delivery API. |
-i, --import-content-model | Yes | true or false. |
-p, --personal-access-token | Yes* | 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.
| Flag | Description | Default |
|---|---|---|
--json | Formats the command output as a JSON string. Useful for CI/CD pipelines or automated scripting. | false |
--log-level | Specifies the verbosity of the logs. Options: debug, warn, error, info, trace. | info |
--no-config-file | Prevents the CLI from generating or updating a configuration file on your local machine. | false |
-h, --help | Displays help information and usage instructions for the specific command. | N/A |
--no-header | Disables the printing of the initial header/banner when the command starts. | false |