For the complete documentation index, see llms.txt. This page is also available as Markdown.

CLI

Learn about the Vale command-line interface.

The Vale CLI is a powerful tool for linting your content in a variety of formats. To get started, try running with no arguments:

Running vale with no arguments prints a short usage summary and an example configuration file.

Environment variables

The following list of environment variables are supported by the vale command-line interface:

Variable
Description

VALE_CONFIG_PATH

Override the default search process by specifying a .vale.ini file.

VALE_STYLES_PATH

Specify the location of the default StylesPath.

You can inspect the current environment variables by running:

The exact steps for setting environment variables depend on your operating system, but here are some useful links for Windows and macOS.

CLI options

Name
Description

sync

Download and install packages. See Packages for more information. $ vale sync

ls-config

Print the current configuration options as JSON. $ vale ls-config

ls-metrics

Print the computed metrics for the given file. See metric for more information. $ vale ls-metrics path/to/file

ls-dirs

Print the location of default configuration directories. $ vale ls-dirs

ls-vars

Print the supported environment variables. $ vale ls-vars

--config

Override the default configuration search process. $ vale --config='path/to/.vale.ini' README.md

--ext

Assign a file extension to stdin. $ echo "This is Markdown" | vale --ext=.md

--filter

An expression to filter rules by. See Filters for more information. $ vale --filter='"heading" in .Scope' test.md

--glob

A glob pattern to match files against. See Globbing for more information. $ vale --glob='*.md' some-dir

--ignore-syntax

Treat all input as plain text. $ vale --ignore-syntax README.md

--minAlertLevel

Set the minimum alert level to display. $ vale --minAlertLevel=error README.md

--no-exit

Do not return a non-zero exit code if there are errors. $ vale --no-exit README.md

--no-wrap

Do not wrap output. $ vale --no-wrap README.md

--no-global

Do not load the global configuration. $ vale --no-global README.md

--output

Change the output format. See Templates for more information. $ vale --output=JSON README.md

--path

Associate a file path with stdin, so that configuration sections and format detection apply. $ cat draft.md | vale --path=docs/draft.md

--plain-progress

Log each step instead of drawing a progress bar. Useful for CI logs, which otherwise record only redrawn frames. $ vale sync --plain-progress

--version

Print the version of Vale. $ vale --version

Return codes

The vale CLI returns the following exit codes:

Code
Description

0

No error(s) were found.

1

Linting error(s) were found. Useful for failing CI builds; can be disabled with --no-exit.

2

Runtime error(s) occurred.

It will try to respect the value of --output when printing to stderr. For example:

Vale reporting an E201 configuration error, showing the offending line of the rule file and the accepted values.

Last updated