A multi-language toolkit for compiling and validating AdGuard-syntax ad-blocking filter rules. Four independent rules compilers (TypeScript, C#/.NET, Python, Rust), bash/zsh shell scripts, a PowerShell toolkit, a Rust validation library, and a Gatsby documentation site all live here and share one configuration schema.
π Active development β multi-language support, a Docker development environment, and CI/CD coverage across every component.
- Rules compilers for TypeScript/Deno, C#/.NET, Python, and Rust, plus bash/zsh shell scripts β all reading the same JSON/JSONC configuration schema and producing identical output.
@bloqr/compiler-core(src/adblock-compiler-core/) β the canonical, dependency-free compilation engine, published on JSR. The .NET, Python, and Rust compilers shell out to it via Deno rather than reimplementing compilation logic.- RulesCompiler PowerShell toolkit (
src/rules-compiler-powershell/) β class-based modules (Common,RulesCompiler,AdGuardWebhook) with Pester test suites. rules-validator(src/rules-validator/) β a Rust validation library and CLI for filter/config validation (hash verification, URL security, syntax linting).- Documentation website (
src/website/) β a Gatsby 5 site that builds guides, API reference, and security docs fromdocs/and this README.
What moved out: the compiled filter lists (and their input/archive files) now live in BloqrAI/bloqr-blocklists, and the AdGuard DNS API clients (.NET, TypeScript, Rust, PowerShell) plus the Linear import tool now live in BloqrAI/bloqr-apiclients. Neither is part of this repo anymore β see Related repositories below.
| Requirement | Version | Needed for |
|---|---|---|
| Deno | 2.0+ | TypeScript compiler; also shelled out to by .NET/Python/Rust |
| .NET SDK | 10.0+ | .NET compiler |
| Python | 3.9+ | Python compiler |
| Rust | 1.85+ | Rust compiler, rules-validator |
| PowerShell | 7+ | PowerShell toolkit |
| Docker | 24.0+ | Containerized dev environment (optional) |
git clone https://github.com/BloqrAI/bloqr-core.git
cd bloqr-core
# Optional: check out the filter-list repo as a sibling directory so the
# sample configs' relative paths (../bloqr-blocklists/...) resolve as-is
git clone https://github.com/BloqrAI/bloqr-blocklists.git ../bloqr-blocklistsThen pick a compiler:
cd src/adblock-compiler-core
deno task compile # compile with the default config
deno task interactive # menu-driven interactive mode
deno task test # run testscd src/rules-compiler-dotnet
dotnet restore RulesCompiler.slnx
dotnet run --project src/RulesCompiler.Console -- --config config.json
dotnet test RulesCompiler.slnxcd src/rules-compiler-python
pip install -e ".[dev]"
rules-compiler -c config.json
pytestcd src/rules-compiler-rust
cargo build --release
cargo run -- -c config.json
cargo test./src/rules-compiler-shell/bash/compile-rules.sh -c config.json -r
./src/rules-compiler-shell/zsh/compile-rules.zsh -c config.json -rImport-Module ./src/rules-compiler-powershell/RulesCompiler/RulesCompiler.psd1
Invoke-RulesCompilerEvery compiler supports JSON configuration (the .NET compiler and Dashboard also read JSONC), the full transformation set (Deduplicate, Validate, RemoveComments, Compress, and more β see Configuration Reference), and per-source inclusions/exclusions/transformations. YAML and TOML remain supported for backward compatibility but are no longer documented β see Configuration Reference.
A pre-baked image with all toolchains installed:
docker build -f Dockerfile.warp -t ad-blocking-dev .
docker run -it -v $(pwd):/workspace ad-blocking-devOr with Docker Compose:
docker compose up -d dev # start the dev environment
docker compose exec dev bash # shell into it
docker compose --profile compile up # run every compiler once
docker compose --profile test run --rm test # run all testsbloqr-core/
βββ src/
β βββ adblock-compiler-core/ # TypeScript/Deno β canonical @bloqr/compiler-core (JSR)
β βββ rules-compiler-dotnet/ # C#/.NET 10 β library + Spectre.Console CLI
β βββ rules-compiler-python/ # Python 3.9+ β pip-installable package + CLI
β βββ rules-compiler-rust/ # Rust β single-binary CLI, zero runtime deps
β βββ rules-compiler-shell/ # bash + zsh scripts
β βββ rules-compiler-powershell/# PowerShell modules + Pester tests
β βββ rules-validator/ # Rust validation library + CLI
β βββ website/ # Gatsby 5 documentation site
βββ docs/ # Guides, reference docs, security docs
βββ schemas/ # Shared configuration schema
The TypeScript compiler is the only one that implements compilation logic directly β it is @bloqr/compiler-core. The .NET, Python, and Rust compilers are thin wrappers that shell out to it via Deno, so behavior and output stay identical across languages; the shell scripts and PowerShell toolkit call whichever compiler is available. rules-validator provides the shared hash-verification and syntax-validation layer that all of them rely on for security.
@bloqr/compiler-core is deliberately separate from Bloqr's commercial @bloqr/compiler product (BloqrAI/bloqr-compiler), which layers AST tooling, linting, plugins, and Cloudflare Workers deployment on top of this open-source engine β see src/adblock-compiler-core/README.md for the full relationship.
| Repository | What it holds |
|---|---|
BloqrAI/bloqr-blocklists |
Compiled filter lists and their input/output/archive files (output/adguard_dns_filter.txt, etc.) β no longer part of this repo |
BloqrAI/bloqr-apiclients |
AdGuard DNS API clients (.NET, TypeScript, Rust, PowerShell) and the Linear import tool β no longer part of this repo |
BloqrAI/bloqr-compiler |
Bloqr's commercial compiler, built on top of @bloqr/compiler-core |
docs/README.mdβ full documentation indexdocs/getting-started.mdβ installation and first compilationdocs/WHY_VALIDATION_MATTERS.mdβ why security validation is mandatory, start heredocs/configuration-reference.mdβ full configuration schemadocs/compiler-comparison.mdβ feature comparison across all compilersdocs/docker-guide.mdβ Docker development environmentdocs/release-guide.mdβ creating releases with automatic binary buildsCLAUDE.md/.github/copilot-instructions.mdβ AI agent instructions for working in this reposrc/website/β the Gatsby site that publishes the above as a browsable documentation site (npm install && npm run developto preview locally)
cd src/adblock-compiler-core && deno task test
cd src/rules-compiler-dotnet && dotnet test RulesCompiler.slnx
cd src/rules-compiler-python && pytest
cd src/rules-compiler-rust && cargo test
cargo test --workspace # rules-compiler-rust + rules-validator
Invoke-Pester -Path ./src/rules-compiler-powershell -RecurseSee docs/guides/testing-guide.md for coverage tooling, CI examples, and troubleshooting.
GitHub Actions validates every component on push and pull request: .github/workflows/dotnet.yml, typescript.yml, python.yml, rust-clippy.yml, powershell.yml, gatsby.yml, plus consolidated security.yml (CodeQL, DevSkim, PSScriptAnalyzer) and validation-compliance.yml (runs the Rust validator against fixtures). See CI/CD Alignment in CLAUDE.md for the full list.
See CONTRIBUTING.md for the development workflow, coding standards, and pull request process. Report security issues per SECURITY.md rather than filing a public issue.
See LICENSE.