cspell-cli is the command-line interface for cspell, a robust spelling checker specifically designed for codebases. It provides comprehensive functionality to lint files, check spelling, trace words, and manage dictionaries directly from the terminal. The package is currently on a major version 10.0.0, released in April 2026, and follows a frequent release cadence, often updating in lockstep with new versions of the core cspell library. These updates can sometimes introduce breaking changes. Its key differentiators include extensive configuration options for various file types and languages, seamless integration with pre-commit hooks, and strong support for custom dictionaries, making it an essential tool for maintaining high code quality and consistency across diverse projects.
npm install cspell-cliVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically execute `cspell-cli` via `npx` to spell check a temporary JavaScript file, capturing its output and exit status.
Review the full `cspell` changelog for version 10.0.0 for specific API and configuration adjustments. Update existing `cspell.config.yaml` or `cspell.json` files and any automation scripts accordingly.
Ensure your development environment, CI/CD pipelines, and any runtime environments for `cspell-cli` are upgraded to Node.js 20 or a newer compatible version (e.g., using `nvm install 20 && nvm use 20`).
It is generally recommended to use `npx cspell-cli` to ensure the project-local version (defined in `package.json`) is used, promoting consistent behavior across development environments. Only install globally if you explicitly manage a system-wide `cspell` version.
Always explicitly specify the command you intend to run (e.g., `cspell-cli lint .` or `cspell-cli check file.js`) to avoid ambiguity and ensure predictable execution.
Run `npx cspell-cli <command>` to use the project-local version or download it temporarily, or install it globally with `npm install -g cspell-cli`.
Ensure the user executing `cspell-cli` has appropriate write permissions to the target directory. If necessary, adjust file permissions or run the command with elevated privileges (e.g., `sudo npx cspell-cli ...`, used with caution).
Upgrade your Node.js installation to version 20 or newer. Tools like `nvm` (Node Version Manager) can help manage multiple Node.js versions: `nvm install 20 && nvm use 20`.
Create a `cspell.config.yaml` or `cspell.json` file in your project's root directory, or explicitly specify its location using the `--config <path>` option. Ensure the filename and path are correct.