@vtex/cli-plugin-content
v1.0.6
Published
vtex plugin content
Maintainers
Keywords
Readme
Content VTEX CLI Plugin
This is a CLI plugin for VTEX CLI that enables you to manage a store's content, via Content Platform.
Usage
$ npm install -g @vtex/cli-plugin-content
$ vtex COMMAND
running command...
$ vtex (-v|--version|version)
@vtex/cli-plugin-content/1.0.6 linux-x64 node-v20.19.5
$ vtex --help [COMMAND]
USAGE
$ vtex COMMAND
...Commands
vtex content:generate-schema [COMPONENT_SCHEMAS_PATH] [CONTENT_TYPES_PATH]vtex content:initvtex content:split-componentsvtex content:split-content-typesvtex content:upload-schema [SCHEMA_PATH]
vtex content:generate-schema [COMPONENT_SCHEMAS_PATH] [CONTENT_TYPES_PATH]
Generate a single schema file for CMS
USAGE
$ vtex content:generate-schema [COMPONENT_SCHEMAS_PATH] [CONTENT_TYPES_PATH]
ARGUMENTS
COMPONENT_SCHEMAS_PATH [default: cms/faststore/components] Path to a directory containing all custom component
schemas.
CONTENT_TYPES_PATH [default: cms/faststore/pages] Path to a directory containing all custom content-type
definitions.
OPTIONS
-b, --beta Use the beta registry instead of the stable one when fetching the default base
schema
-h, --help show CLI help
-l, --local=path-to-schema-file Use a local schema as the base schema instead of the latest FastStore schema from
remote.
-o, --out=path-to-output-file Path to the output file where the generated schema will be saved.
-r, --remote=path-to-schema-file Use a custom remote schema as the base schema.
-v, --verbose Show debug level logs
--trace Ensure all requests to VTEX IO are tracedSee code: build/commands/content/generate-schema.ts
vtex content:init
Initialize CMS folder structure with example files.
USAGE
$ vtex content:init
OPTIONS
-h, --help show CLI help
-v, --verbose Show debug level logs
--trace Ensure all requests to VTEX IO are tracedSee code: build/commands/content/init.ts
vtex content:split-components
Split CMS component files from sections.json
USAGE
$ vtex content:split-components
OPTIONS
-h, --help show CLI help
-i, --input=path-to-sections-file [default: cms/faststore/sections.json] Path to the sections.json file
-o, --output=path-to-output-directory [default: cms/faststore/components] Path to the output directory for component
files
-v, --verbose Show debug level logs
--trace Ensure all requests to VTEX IO are tracedSee code: build/commands/content/split-components.ts
vtex content:split-content-types
Split CMS content-type files from content-types.json
USAGE
$ vtex content:split-content-types
OPTIONS
-h, --help show CLI help
-i, --input=path-to-content-types-file [default: cms/faststore/content-types.json] Path to the content-types.json
file
-o, --output=path-to-output-directory [default: cms/faststore/pages] Path to the output directory for content-type
files
-s, --sections=path-to-sections-file [default: cms/faststore/sections.json] Path to the sections.json file used to
filter components by requiredScopes
-v, --verbose Show debug level logs
--trace Ensure all requests to VTEX IO are tracedSee code: build/commands/content/split-content-types.ts
vtex content:upload-schema [SCHEMA_PATH]
Upload a local schema to Schema Registry.
USAGE
$ vtex content:upload-schema [SCHEMA_PATH]
ARGUMENTS
SCHEMA_PATH [default: schema.json] Path to the schema file to upload.
OPTIONS
-b, --beta Use the beta registry instead of the stable one
-h, --help show CLI help
-v, --verbose Show debug level logs
--trace Ensure all requests to VTEX IO are tracedSee code: build/commands/content/upload-schema.ts
Development
./bin/run content -h