Can You Fork Automattic/harper? License Terms and Complete Setup Guide
Yes, you can freely fork Automattic/harper under the Apache-2.0 license, which explicitly grants rights to copy, modify, and redistribute the entire grammar-checking ecosystem provided you maintain the copyright notice and license file.
Automattic/harper is an open-source grammar-checking engine built primarily in Rust with WebAssembly bindings for JavaScript environments. Because the repository is released under the permissive Apache-2.0 license found in the root LICENSE file, you can fork the project to customize linting rules, create private distributions, or integrate the engine into commercial applications.
Understanding Your Rights Under the Apache-2.0 License
The LICENSE file at the repository root establishes the legal framework for forking. This permissive open-source license allows you to:
- Copy and redistribute the source code or compiled binaries
- Modify any component, including the core engine in
harper-core/or the language server inharper-ls/ - Sublicense your modifications under the same Apache-2.0 terms
- Use commercially without releasing your proprietary source code
You must preserve the original copyright notice and include a copy of the Apache-2.0 license in any distribution. The license also provides an express grant of patent rights from contributors, which protects you from patent litigation regarding the codebase.
Repository Architecture Overview
Before forking, understand the multi-crate structure that comprises the Harper ecosystem:
- harper-core: The Rust grammar engine containing rule definitions and dictionaries. Located in
harper-core/, documented inharper-core/README.md. - harper-ls: Language Server Protocol implementation for IDE integration (Neovim, VS Code, etc.). Located in
harper-ls/. - harper-js: WebAssembly wrapper exposing the core engine to browsers and Node.js. Located in
packages/harper.js/, documented inpackages/harper.js/README.md. - harper-desktop: Standalone Tauri-based application with overlay highlighter. Located in
harper-desktop/, documented inharper-desktop/README.md. - Integration plugins: Browser extensions and editor plugins found in
packages/(VS Code, Chrome, Firefox, Obsidian).
How to Fork and Set Up Automattic/harper
Creating Your Fork on GitHub
Click the Fork button on the GitHub repository page to create a personal copy under your account, or clone the repository directly:
git clone https://github.com/Automattic/harper.git
cd harper
Push this to your own remote to maintain a separate fork.
Development Environment Setup
Install the required toolchains to build from source:
- Rust toolchain via rustup (required for
harper-core,harper-ls, andharper-desktop) - Node.js and pnpm for JavaScript packages and WebAssembly compilation
- just task runner for standardized build commands
Refer to CONTRIBUTING.md for exact version requirements and platform-specific setup instructions.
Customization Examples for Your Fork
Using harper.js in Node.js
After building the WebAssembly bindings from your fork, you can import the linter in Node.js applications:
import { LocalLinter } from "harper.js";
const linter = new LocalLinter();
const text = "This are a typo.";
const result = await linter.lint(text);
console.log(result.lints.map(l => l.message));
// → [ '“are” should be “is”' ]
Source code for this API is documented in packages/harper.js/README.md.
Adding a Custom Grammar Rule in harper-core
Extend the engine by implementing the Rule trait in your forked harper-core/src/:
use harper_core::linting::Rule;
use harper_core::document::Document;
pub struct MyRule;
impl Rule for MyRule {
fn name(&self) -> &'static str { "my_rule" }
fn check(&self, doc: &Document) -> Vec<Lint> {
doc.tokens()
.filter(|t| t.text == "foobar")
.map(|t| Lint::new(t.range, "Avoid the word “foobar”."))
.collect()
}
}
The contributor documentation at packages/web/src/routes/docs/contributors/author-a-rule/+page.md explains the rule architecture and Lint construction patterns.
Running the Desktop Highlighter
Test your modifications using the Tauri-based desktop application:
just dev-desktop
This command launches the overlay highlighter as defined in harper-desktop/README.md, hot-reloading changes to the underlying Rust code.
Essential Files to Review in Your Fork
After forking, examine these key files to understand the codebase:
LICENSE: Apache-2.0 license text and copyright noticeCONTRIBUTING.md: Build instructions, testing commands (just test-rust), and PR guidelinesharper-core/README.md: Core engine architecture and dictionary managementharper-ls/README.md: LSP implementation details and editor configurationpackages/harper.js/README.md: WebAssembly bindings and JavaScript API
Summary
- Automattic/harper is licensed under Apache-2.0, permitting unrestricted forking for personal or commercial use
- The repository contains Rust crates and JavaScript packages requiring both Rust and Node.js toolchains to build
- You can customize grammar rules by implementing the
Ruletrait inharper-core/src/linting/ - All redistributions must preserve copyright notices and include the original
LICENSEfile - Use
just dev-desktopto test changes in the standalone Tauri application
Frequently Asked Questions
Can I fork Automattic/harper for commercial use?
Yes. The Apache-2.0 license explicitly permits commercial use, including incorporating the grammar engine into proprietary products or selling modified versions. You must include the original copyright notice and license file, but you are not required to open-source your proprietary modifications or pay royalties.
What attribution is required when redistributing a fork?
You must retain all copyright notices, patent grants, and the disclaimer of warranty found in the root LICENSE file. Include a copy of the Apache-2.0 license in any source or binary distribution, and document any significant changes you make to the codebase in a NOTICE file or similar prominent location.
How do I submit improvements back to the upstream repository?
After forking and making changes, push your branch to your GitHub remote and open a Pull Request against Automattic/harper. Follow the guidelines in CONTRIBUTING.md, which specifies the use of the just task runner for testing (e.g., just test-rust) and code formatting requirements using the project's standard Rustfmt configuration.
Which components can I modify without breaking the ecosystem?
You can safely modify individual components if you maintain their public APIs. Custom rules in harper-core/src/linting/ are safe to add without affecting downstream crates. UI changes in harper-desktop/ and plugin packages (packages/vscode-plugin/, etc.) can be modified independently. However, breaking changes to harper-core public APIs will require corresponding updates in harper-js and harper-ls to maintain compatibility across the ecosystem.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →