Skip to main content
The ls-dirs command displays the default directories Vale uses for configuration, styles, and native messaging, along with whether each location exists.

Usage

vale ls-dirs
By default, the command outputs a formatted table. Use --output=JSON for machine-readable output.

Default Output

The command displays a table with three locations:
Asset         Default Location                           Found
StylesPath    /home/user/.local/share/vale/styles        ✓
.vale.ini     /home/user/.config/vale/.vale.ini          ✗
vale-native   /home/user/.local/share/vale/vale-native   ✗
A green checkmark (✓) indicates the path exists. A red X (✗) means it doesn’t.

Directory Locations

StylesPath
string
Default styles directoryThe global location where Vale looks for style packages when no project-specific StylesPath is configured.Platform-specific defaults:
  • Linux: ~/.local/share/vale/styles
  • macOS: ~/Library/Application Support/vale/styles
  • Windows: %LOCALAPPDATA%\vale\styles
You can override this with the VALE_STYLES_PATH environment variable.
.vale.ini
string
Global configuration fileThe default location for a user-wide Vale configuration.Platform-specific defaults:
  • Linux: ~/.config/vale/.vale.ini
  • macOS: ~/Library/Application Support/vale/.vale.ini
  • Windows: %APPDATA%\vale\.vale.ini
Vale loads this configuration for all projects unless:
  • A project-specific .vale.ini exists
  • You use --config to specify a different file
  • You use --no-global to skip global configuration
You can override this with the VALE_CONFIG_PATH environment variable.
vale-native
string
Native messaging host executableThe location of the Vale native messaging host for browser extensions.Platform-specific defaults:
  • Linux: ~/.local/share/vale/vale-native
  • macOS: ~/Library/Application Support/vale/vale-native
  • Windows: %LOCALAPPDATA%\vale\vale-native.exe
This is only relevant if you’re using Vale’s browser integration features.

JSON Output

For programmatic access, use JSON output:
vale --output=JSON ls-dirs
Output:
{
  "StylesPath": "/home/user/.local/share/vale/styles",
  ".vale.ini": "/home/user/.config/vale/.vale.ini",
  "vale-native": "/home/user/.local/share/vale/vale-native"
}
JSON output includes the paths but not the existence status. You’ll need to check file existence separately.

Use Cases

Verify Installation

Check if Vale’s default directories are set up:
vale ls-dirs
If StylesPath shows ✗, create it and sync packages:
mkdir -p "$(vale --output=JSON ls-dirs | jq -r '.StylesPath')"
vale sync

Find Global Configuration

Locate your global .vale.ini file:
vale --output=JSON ls-dirs | jq -r '.".vale.ini"'
Output:
/home/user/.config/vale/.vale.ini

Set Up Global Configuration

Create a global configuration file:
# Get the config path
CONFIG_PATH=$(vale --output=JSON ls-dirs | jq -r '.".vale.ini"')

# Create directory
mkdir -p "$(dirname "$CONFIG_PATH")"

# Create configuration
cat > "$CONFIG_PATH" << EOF
StylesPath = $(vale --output=JSON ls-dirs | jq -r '.StylesPath')
MinAlertLevel = suggestion

Packages = https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip

[*]
BasedOnStyles = Vale, Microsoft
EOF

# Sync packages
vale sync

Check in Scripts

Verify Vale directories exist before running operations:
#!/bin/bash
STYLES_PATH=$(vale --output=JSON ls-dirs | jq -r '.StylesPath')

if [ ! -d "$STYLES_PATH" ]; then
  echo "Error: Styles directory not found. Run 'vale sync' first."
  exit 1
fi

vale .

Examples

vale ls-dirs

Environment Variables

You can override default directory locations with environment variables:
Override the default styles directory:
export VALE_STYLES_PATH=/custom/styles/path
vale ls-dirs
The StylesPath entry will show your custom path.

Platform Differences

Default paths follow platform conventions:
vale ls-dirs
Asset         Default Location                           Found
StylesPath    /home/user/.local/share/vale/styles        ✓
.vale.ini     /home/user/.config/vale/.vale.ini          ✓
vale-native   /home/user/.local/share/vale/vale-native   ✗
Follows XDG Base Directory specification.

Directory Structure

A typical Vale installation with both global and project configurations:
# Global directories
~/.config/vale/
└── .vale.ini                    # Global configuration

~/.local/share/vale/
└── styles/                      # Global styles
    ├── Microsoft/
    ├── Google/
    └── Vale/

# Project directories
/project/
├── .vale.ini                    # Project configuration
└── styles/                      # Project styles
    └── CompanyStyle/
Project-specific configurations take precedence over global configuration, allowing you to customize Vale per project while maintaining global defaults.

Troubleshooting

Styles Not Found

If Vale can’t find styles:
  1. Check the styles directory exists:
    vale ls-dirs
    
  2. Verify styles are installed:
    ls "$(vale --output=JSON ls-dirs | jq -r '.StylesPath')"
    
  3. Run sync if needed:
    vale sync
    

Configuration Not Loaded

If global configuration isn’t being used:
  1. Check if the file exists:
    vale ls-dirs
    
  2. View the actual path:
    vale --output=JSON ls-dirs | jq -r '.".vale.ini"'
    
  3. Create it if missing:
    CONFIG=$(vale --output=JSON ls-dirs | jq -r '.".vale.ini"')
    mkdir -p "$(dirname "$CONFIG")"
    touch "$CONFIG"
    
  • ls-vars - View environment variables that affect directories
  • ls-config - View loaded configuration
  • sync - Install packages to styles directory

Build docs developers (and LLMs) love