https://github.com/contentstack/cli-cm-regex-validate
A Contentstack CLI plugin that searches for invalid regexes within the content types and global fields of the stack
https://github.com/contentstack/cli-cm-regex-validate
cli contentstack-cli contentstack-cli-plugin redos regex
Last synced: 29 days ago
JSON representation
A Contentstack CLI plugin that searches for invalid regexes within the content types and global fields of the stack
- Host: GitHub
- URL: https://github.com/contentstack/cli-cm-regex-validate
- Owner: contentstack
- License: mit
- Created: 2021-09-06T12:27:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-04-08T06:35:29.000Z (about 1 month ago)
- Last Synced: 2026-04-08T08:26:59.292Z (about 1 month ago)
- Topics: cli, contentstack-cli, contentstack-cli-plugin, redos, regex
- Language: TypeScript
- Homepage:
- Size: 1.84 MB
- Stars: 1
- Watchers: 8
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Regex Validation CLI Plugin
The “Regex Validation” plugin in Contentstack CLI allows users to search for invalid regexes within the content types and global fields of their stack.
Using the CLI “Regex Validation” plugin, you can find the invalid regexes within your stack
and rectify them.
[](https://oclif.io)
[](https://npmjs.org/package/cli-cm-regex-validate)
[](https://npmjs.org/package/cli-cm-regex-validate)
[](https://github.com/contentstack/cli-cm-regex-validate/blob/master/package.json)
- [Regex Validation CLI Plugin](#regex-validation-cli-plugin)
- [Usage](#usage)
- [Commands](#commands)
# Usage
#### Step 1:
```sh-session
$ npm install -g @contentstack/cli
$ csdx plugins:install https://github.com/contentstack/cli-cm-regex-validate/releases/download/v1.2.1/contentstack-cli-cm-regex-validate-1.2.1.tgz
$ csdx plugins
running command...
@contentstack/cli-cm-regex-validate/1.2.1 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
...
```
#### Step 2:
[Set the region](https://www.contentstack.com/docs/developers/cli/configure-regions-in-the-cli#set-region)
#### Step 3:
[Configured management token alias](https://www.contentstack.com/docs/developers/cli/cli-authentication#add-management-token)
# Commands
- [`csdx cm:stacks:validate-regex`](#csdx-cmstacksvalidate-regex)
## `csdx cm:stacks:validate-regex`
This command is used to find all the invalid regexes present in the content types and global fields of your stack.
```
USAGE
$ csdx cm:stacks:validate-regex [-h] [-a ] [-c] [-g] [-f ]
FLAGS
-a, --alias= Alias (name) assigned to the management token
-c, --contentType To find invalid regexes within the content types
-f, --filePath= [optional] The path or the location in your file system where the CSV output file should be
stored.
-g, --globalField To find invalid regexes within the global fields
-h, --help To show the flags that can be used with this CLI command
DESCRIPTION
This command is used to find all the invalid regexes present in the content types and global fields of your stack.
EXAMPLES
$ csdx cm:stacks:validate-regex
$ csdx cm:stacks:validate-regex -a
$ csdx cm:stacks:validate-regex -c
$ csdx cm:stacks:validate-regex -g
$ csdx cm:stacks:validate-regex -f
$ csdx cm:stacks:validate-regex -a -c -g
$ csdx cm:stacks:validate-regex -a -c -g -f
```
_See code: [src/commands/cm/stacks/validate-regex.ts](https://github.com/contentstack/cli-cm-regex-validate/blob/v1.2.1/src/commands/cm/stacks/validate-regex.ts)_