domain-scan
Structural code intelligence via tree-sitter
Find every interface, service, method, trait, protocol, and type boundary in any codebase. Deterministic output across 12 languages. No LLMs in the analysis pipeline. Built for AI agents, refactoring audits, and domain architecture mapping.
macOS Apple Silicon (arm64). Also available for Linux and Windows. Run xattr -cr /Applications/domain-scan.app after install.

The problem
Large codebases have thousands of interfaces, services, and methods scattered across hundreds of files. Developers joining a project, auditing an API surface, or preparing for a refactor need answers to:
- What services exist and what methods do they expose?
- Which interfaces are implemented by which structs/classes?
- What is the full public API surface of this module?
- Where are the HTTP/gRPC/event service definitions?
- Which methods are async? Which take callbacks? Which return streams?
Today this requires grepping, manual navigation, or language-specific tooling that breaks across polyglot repos. LSP servers answer point queries but cannot produce a full structural census.
domain-scan solves this with declarative tree-sitter queries that extract everything in one pass, producing structured JSON that agents, dashboards, and humans can all consume.
What it extracts
Deterministic structural analysis. Same input, same output. No LLMs required.
12 Languages
TypeScript, Python, Rust, Go, Java, Kotlin, C#, Swift, C++, PHP, Ruby, and Scala. All from declarative .scm query files.
Full Structural Census
Extracts every interface, service, class, method, function, schema, type alias, and implementation. Complete API surface in one scan.
Cross-File Resolution
Tracks imports, exports, and trait/interface implementations across files. Knows that UserRepoImpl in file A implements UserRepo from file B.
Agent-First CLI
Structured JSON output, --fields for context window discipline, --json for raw payloads, schema introspection, and input hardening against hallucinations.
Effect.ts Deep Extraction
First-class support for Effect.ts services, layers, error channels, schemas, and pipelines. Understands Context.Tag, Layer composition, and Effect.gen.
Subsystem Matching
Map every entity to a known subsystem via manifest files. File path, import graph, and name matching. Generate LLM prompts for unmatched items.
See it in action

Interfaces with method signatures extracted from TypeScript

Service definitions with HTTP routes and method counts
CLI usage
One binary, structured JSON output, agent-ready by default.
domain-scan scan --output json -o scan.jsondomain-scan interfaces --name ".*Repository" --show-methods --output jsondomain-scan services --kind HttpController --show-routesdomain-scan validate --strictdomain-scan match --manifest system.json --fail-on-unmatcheddomain-scan prompt --agents 5 --focus authdomain-scan schema interfacesInstallation
CLI (from source)
Install the CLI via Cargo for command-line and AI agent use.
cargo install --git https://github.com/jamesaphoenix/domain-scan domain-scan-cliBuild from Source
Clone the repo and build everything yourself.
git clone https://github.com/jamesaphoenix/domain-scan
cd domain-scan
cargo build --release -p domain-scan-cliSupported languages
83 declarative .scm query files across 12 languages. Adding a new language = writing .scm files, zero Rust code.
Know your codebase
Free and open source. Scan any codebase in seconds. Structured output for humans, agents, and dashboards.