cspell
A fast, self-contained command-line spell checker built for source code and documentation.
Repository Health
Technical Analysis
cspell is a command-line tool and library for spell checking source code. Instead of matching raw text against a dictionary, it parses code into words first, splitting camelCase, snake_case, and compound identifiers apart, so it can catch typos in variable names, comments, and strings without flooding you with false positives on ordinary code constructs.
It ships with no external OS-level dependencies (no Hunspell or aspell) and bundles a large family of built-in dictionaries for languages, frameworks, and file formats — JavaScript, TypeScript, Python, PHP, C#, C++, LaTeX, Go, HTML, CSS, and more. It’s built to run as a linter in CI pipelines and pre-commit hooks, or interactively via the companion Code Spell Checker extension for Visual Studio Code.
What You Get
- A
cspellCLI withlint,trace,check,suggest,init,link, anddictionariessubcommands, driven by Commander - Camel-case, snake_case, and compound-word aware tokenization so identifiers are split into real words before checking
- Dozens of bundled, curated dictionaries for programming languages, frameworks, and common file formats
- Glob-based and gitignore-aware file selection so large repos can be checked selectively and quickly
- A worker-thread based checking pipeline for parallel processing of many files
- A
--cachemode with content or metadata cache strategies to speed up repeat CI runs - A programmatic API (
lint,trace,checkText) for embedding spell checking in other tools
Common Use Cases
- Adding a spelling lint step to CI so typos in code, comments, and docs fail the build
- Running as a pre-commit hook to catch misspelled identifiers and strings before they’re committed
- Checking documentation and README files for spelling errors alongside source code
- Powering the Code Spell Checker VS Code extension for real-time in-editor spell checking
- Auditing changed files only via
git diff --name-only | npx cspell --file-list stdinin pull requests
Under The Hood
Architecture
cspell is a pnpm-workspace monorepo where the published cspell package (packages/cspell) is a thin CLI/API layer: app.mts wires Commander-based subcommands (lint, trace, check, suggest, init, link, dictionaries) which delegate to cspell-lib for settings merging, tokenization, and dictionary lookup. Supporting workspace packages — cspell-dictionary, cspell-glob, cspell-io, cspell-gitignore, cspell-config-lib — handle globbing, gitignore-aware traversal, config-file resolution, and file IO, while cspell-worker offloads per-file checking to worker threads for parallelism, coordinated through lint/processFiles.ts and lint/processFile.ts. Because every bundled dictionary is built around a shared trie format consumed through cspell-dictionary, that abstraction is the one piece the rest of the pipeline is most tightly coupled to.
Tech Stack
The codebase is TypeScript throughout, targeting Node 22.18+, built with tsdown and tsc for dual ESM/CJS output. The CLI layer uses Commander for argument parsing and chalk/chalk-template for terminal output, with semver for engine checks and tinyglobby for globbing. A large family of @cspell/dict-* dictionary packages plus cspell-lib form the checking core. pnpm workspaces coordinate the monorepo, Vitest is the test runner, and ESLint plus Prettier enforce style, with GitHub Actions running test, lint, coverage, and CodeQL workflows.
Code Quality
Vitest test files sit alongside source throughout src/ — commands, the application layer, lint pipeline, worker, and link modules all have companion .test.ts files, several backed by __snapshots__ directories for snapshot-based CLI output testing. The codebase is fully typed TypeScript with a dedicated cspell-types package for shared type definitions, internal dependencies are consumed as workspace:* packages rather than copy-pasted, and errors are surfaced through a dedicated ApplicationError/CheckFailed module rather than swallowed. CI runs ESLint, Prettier, CodeQL, and coverage collection on every push.
What Makes It Unique cspell doesn’t wrap an existing spell-checking engine like Hunspell or aspell — it implements its own tokenizer that understands programming-language identifier conventions (camelCase, snake_case, compound words) so it can spell-check variable and function names directly, paired with an extensive, curated set of per-language and per-framework dictionaries and a suggestion engine that proposes fixes using edit-distance and compound-word splitting. The novelty is less a single clever algorithm and more a comprehensive, actively maintained domain-specific dictionary and tokenization system that few alternatives match in coverage.
Used by 10 apps in this directory
AI Engineer Coach
Developer Tools
A VS Code extension that reads your local AI coding session logs and turns them into actionable insights — anti-pattern detection across 45 rules, output tracking by model and harness, and skill discovery, with no data leaving your machine.
authentik
Authentication · Security
The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.
Authgear
Authentication
Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.
Convex Backend
Developer Tools · Databases
Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.
Fern
Developer Tools
Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.
Joplin
Note Taking
The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.
NocoDB
No Code Platforms · Databases · Low Code Platforms
Turn any SQL database into a collaborative no-code spreadsheet with automatic REST APIs and real-time views.
Spacedrive
File Storage · Collaboration
One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.
Teleport
Security · Authentication
Zero-trust infrastructure access platform that replaces credentials and VPNs with short-lived certificates, SSO, and identity-aware proxies for SSH, Kubernetes, databases, RDP, and AI agents.