Skip to main content
The default Vale command lints files, directories, or text input against your configured style rules. This is Vale’s primary operation.

Usage

vale [options] [input...]
The lint command is the default operation—you don’t need to specify a command name. Just run vale followed by your input.

Input Methods

Vale accepts three types of input, automatically detecting which method you’re using:

Files and Directories

Provide one or more file or directory paths:
vale README.md
vale docs/guide.md docs/api.md
vale content/
When linting directories, Vale recursively processes all files matching your configuration’s format settings.

String Arguments

If the argument doesn’t match an existing file or directory path, Vale treats it as literal text to lint:
vale "This is some text to check for errors."
The text is linted as if it were a .txt file (or use --ext to specify a different format).

Standard Input

Pipe content to Vale via stdin:
cat myfile.md | vale
echo "Some text" | vale --ext=.md
git diff | vale --ext=.txt
When using stdin, use the --ext flag to specify the file format so Vale applies the correct syntax processing. Use --path to match configuration scope patterns.

Output Formats

Control output format with the --output flag:
Human-readable terminal output with color and formatting:
vale myfile.md
myfile.md
 1:10  error  Use 'web' instead of 'internet'.  Style.Terms
 3:5   warning  Consider removing 'very'.        Vale.Adverbs

✖ 1 error, 1 warning

Common Options

--config
string
Specify a custom configuration file path.
vale --config=/path/to/.vale.ini myfile.md
By default, Vale searches for .vale.ini in the current directory and parent directories.
--minAlertLevel
string
Set the minimum alert severity to display. Valid values: suggestion, warning, error.
vale --minAlertLevel=error myfile.md
Only alerts at or above this level will be shown in output and affect the exit code.
--glob
string
default:"*"
Filter files using a glob pattern when linting directories.
vale --glob='*.{md,mdx}' docs/
--filter
string
Apply only rules matching the filter expression.
# Only check spelling rules
vale --filter='*.Spelling' myfile.md

# Only check rules from the Microsoft style
vale --filter='Microsoft.*' myfile.md
--ignore-syntax
boolean
default:"false"
Disable syntax-aware processing and lint files line-by-line as plain text.
vale --ignore-syntax myfile.md
This can be faster but loses context from markup structure.
--no-exit
boolean
default:"false"
Always exit with code 0, even when errors are found.
vale --no-exit myfile.md
Useful in CI when you want to see results but not fail the build.
--ext
string
default:".txt"
Specify the file extension for stdin input.
echo "# Heading" | vale --ext=.md
--path
string
Associate a file path with stdin for configuration matching.
cat content.md | vale --path=docs/guide.md
The path helps Vale determine which configuration scope to apply based on your .vale.ini patterns.

Examples

vale README.md

How Vale Processes Files

1

Configuration loading

Vale searches for .vale.ini starting in the current directory and moving up the directory tree. It then loads styles and rules based on your configuration.
2

File discovery

For directory inputs, Vale recursively finds files matching your format associations and glob patterns.
3

Syntax processing

Vale parses each file using a markup-aware processor based on the file extension (Markdown, AsciiDoc, HTML, etc.).
4

Scope matching

Vale applies rules to specific parts of the document based on scope configuration (e.g., only headings, or skip code blocks).
5

Rule execution

Each enabled rule is tested against the scoped text, generating alerts for matches.
6

Output generation

Alerts are formatted according to the output format and filtered by minimum alert level.

Exit Codes

CodeCondition
0No errors found, or --no-exit was used
1One or more lint errors at or above minAlertLevel
2Runtime error (invalid config, file not found, permission denied)
Use --no-exit in CI pipelines when you want to collect lint results without failing the build.

Configuration Matching

Vale applies different configurations based on file paths using glob patterns in your .vale.ini:
.vale.ini
[*.md]
BasedOnStyles = Vale, MyStyle

[docs/*.md]
BasedOnStyles = Vale, MyStyle, APIStyle
When linting, Vale determines which configuration section matches each file and applies those rules.
The --path option lets you specify a virtual path for stdin input, allowing Vale to match the correct configuration section.

Performance Tips

  • Use --glob to limit which files are processed
  • Use --filter to check only specific rules when debugging
  • Use --ignore-syntax for faster processing of large plain text files
  • Configure .vale.ini to exclude directories with IgnorePaths

Build docs developers (and LLMs) love