Overview
Vale’s package system allows you to distribute and share complete style configurations, including:- Style rules
- Configuration files
- Vocabularies and dictionaries
- Custom templates and scripts
The Sync Command
Thevale sync command downloads and installs packages defined in your .vale.ini configuration file.
Basic Usage
- Reads the
Packagessection from your root.vale.ini - Downloads each package from its source (URL, path, or library)
- Installs styles into your
StylesPath - Merges configuration files into
.vale-config/
Configuration
Define packages in your.vale.ini file:
Package Sources
Vale supports three types of package sources:- Remote URLs
- Local Paths
- Library Names
Download packages directly from URLs:Vale automatically:
- Downloads the ZIP archive
- Extracts it to a temporary directory
- Installs the contents to your
StylesPath
Only HTTP(S) protocols are supported. SSH or other protocols will return an error.
Package Structure
A Vale package can contain the following structure:Package Installation Process
When Vale installs a package, it follows this process (seecmd/vale/sync.go:88-142):
Step 1: Download and Extract
Step 1: Download and Extract
For remote packages:Vale creates a temporary directory and downloads the package.
Step 2: Install Styles
Step 2: Install Styles
The All style rules are made available immediately.
styles/ directory is copied to your StylesPath:Step 3: Merge Configuration
Step 3: Merge Configuration
The This preserves your existing configuration while adding package assets.
config/ directories (vocabularies, templates, etc.) are merged:Step 4: Process Nested Packages
Step 4: Process Nested Packages
If the package includes a Vale recursively installs nested dependencies, creating a complete style pipeline.
.vale.ini with its own Packages section:Configuration Pipeline
Vale stores package configurations in a special.vale-config/ directory within your StylesPath. This pipeline allows packages to:
- Define their own configuration
- Override base settings
- Include additional packages
Pipeline Structure
Initialization Process
Before syncing, Vale initializes theStylesPath (see cmd/vale/sync.go:15-33):
Example Workflows
- Team Setup
- Multi-Style Project
- Development Workflow
Share a common configuration across your team:
-
Create a repository with your style package:
- Host it on GitHub and create a release
-
Team members add to their
.vale.ini: -
Run
vale syncto install
Error Handling
Vale provides detailed error messages for common issues:Invalid URL or Path
Invalid URL or Path
- URL is accessible
- Path exists
- You have read permissions
Unsupported Protocol
Unsupported Protocol
Missing Package
Missing Package
If a library name isn’t found:
- Check spelling
- Verify the package exists in the library
- Use the full URL as a fallback
Best Practices
Version Control
Pin package versions using specific release URLs rather than
latest for reproducible builds.Local Development
Use local paths during development, then switch to URLs for production.
Sync Regularly
Run
vale sync when:- Pulling changes that modify
.vale.ini - Updating to new package versions
- Joining a new project
Package Organization
Structure packages with clear directories and include a README explaining the rules.
Related Commands
vale ls-config- View the current configuration including loaded packagesvale ls-dirs- Check yourStylesPathlocation