Scripts2026年5月23日·1 分钟阅读

Harper — Offline Privacy-First Grammar Checker

Fast open-source grammar checker written in Rust that runs entirely offline. Available as a CLI, language server, browser extension, and library.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Harper Overview
通用 CLI 安装命令
npx tokrepo install e1b295c8-56e5-11f1-9bc6-00163e2b0d79

Introduction

Harper is an open-source English grammar checker built in Rust that runs entirely on the local machine. Unlike cloud-based tools, Harper never sends text over the network, making it suitable for confidential documents, air-gapped environments, and privacy-conscious workflows. Maintained by Automattic, it ships as a CLI, a Language Server Protocol (LSP) implementation, a WebAssembly module, and browser extensions.

What Harper Does

  • Detects grammar, spelling, and style issues in English prose
  • Runs as an LSP server for real-time feedback in any editor that supports LSP
  • Ships browser extensions for Chrome and Firefox to check text in web forms
  • Provides a Rust library crate for embedding in other applications
  • Operates entirely offline with no telemetry or cloud dependency

Architecture Overview

Harper parses text into a token stream, then applies a pipeline of lint rules written in Rust. Each rule receives a token window and emits diagnostics with suggested corrections. The LSP server wraps this pipeline behind the standard Language Server Protocol, serving diagnostics and code actions to editors. The WebAssembly build compiles the same Rust core for the browser extension, ensuring identical behavior across platforms.

Self-Hosting & Configuration

  • Install via Cargo: cargo install harper-cli harper-ls
  • Configure your editor to use harper-ls as the language server for plaintext and Markdown
  • Add custom words to a local dictionary file at ~/.config/harper/dictionary.txt
  • Disable specific rules in the LSP settings if they conflict with your style
  • Use the WASM build in CI pipelines for prose linting without Rust on the host

Key Features

  • Sub-millisecond linting speed even on long documents
  • No internet connection required at any point
  • Single binary with no runtime dependencies
  • Integrates with VS Code, Neovim, Helix, Zed, and any LSP-capable editor
  • Fully open source under the Apache-2.0 license

Comparison with Similar Tools

  • Grammarly — cloud-based with a freemium model; Harper is offline and open source
  • LanguageTool — Java-based with optional server; Harper is a single Rust binary
  • Vale — YAML-configured prose linter focused on style guides; Harper focuses on grammar
  • textlint — JavaScript plugin ecosystem; Harper is faster but less extensible
  • proselint — Python-based style checker; Harper covers grammar in addition to style

FAQ

Q: Does Harper support languages other than English? A: Currently Harper supports English only. Contributions for other languages are welcome.

Q: How do I use Harper in VS Code? A: Install the Harper extension from the VS Code marketplace. It bundles the LSP server.

Q: Can I add domain-specific terminology? A: Yes. Add words to the user dictionary file and Harper will stop flagging them.

Q: Is Harper suitable for Markdown and code comments? A: Yes. Harper understands Markdown syntax and skips code blocks when linting.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产