Skip to content

Repository files navigation

Dalil

Dalil (Arabic for “guide”) is a local codebase reference engine for humans and coding agents. It finds the files, symbols, relationships, tests, and history that are most useful for the task at hand.

Dalil HTML repository briefing shown in a browser

Dalil supports Rust, JavaScript, JSX, TypeScript, TSX, Python, Ruby, Java, C#, Go, Lua, and Zig. It reads local files and Git objects without running project code, hooks, filters, repository programs, or network transports.

Install

Install the published crate:

cargo install --locked dalil

To build a source checkout instead:

cargo build --locked --release

Quick start

Run Dalil from the Git worktree you want to understand:

dalil
dalil context --task 'fix parser cache invalidation' --changed-path src/map/cache.rs
dalil impact --revision-range 'HEAD~1..HEAD'
dalil search parser
dalil search invalidation --language rust --test exclude --json
dalil relationships definitions MapReport --json
dalil relationships callers parse
dalil traverse neighbors src/map.rs --depth 2
dalil traverse path src/cli.rs src/report.rs --direction outgoing
dalil traverse reverse-dependencies src/map.rs --depth 3
dalil explain src/map.rs

PATH defaults to the current directory. Dalil discovers the enclosing Git repository and keeps analysis inside it.

The main workflows are:

  • dalil or dalil orient returns a short repository briefing and reading plan.
  • dalil map inventories source, symbols, lexical relationships, project roots, entry points, tests, and other landmarks.
  • dalil context selects one task-shaped evidence bundle.
  • dalil impact seeds the shared relationship graph from local changes, files, or symbols and ranks direct and downstream inspection targets, projects, and tests.
  • dalil search finds source content, paths, and symbols. Use --language, --project, --symbol-kind, --test, or --changed-path to narrow it; --json includes typed matches, totals, omissions, and continuation state. dalil explain shows the evidence behind one recommendation.
  • dalil relationships queries definitions, references, imports, dependencies, reverse dependencies, related tests, callers, and callees. Results include stable node and relationship IDs plus lexical confidence and limitations.
  • dalil traverse walks bounded neighbors, shortest paths, and incoming file dependencies. Use --depth, --work-limit, --limit, and --budget to control traversal and output size; JSON reports the work and omissions.
  • dalil history reports churn, contributor, bug-cluster, activity, and firefighting signals.

Pass --json for typed output or --html for a standalone browser report:

dalil map --profile evidence --json > map.json
dalil --html > dalil-report.html
dalil --html --open

Reports go to stdout and diagnostics go to stderr, so redirection writes a clean report file.

Repository evidence bundles

dalil export writes a persistent evidence map under .dalil/. Use dalil export --task 'describe the work' to append the supplied task and its orientation, or dalil export --review for a compact snapshot intended for Git review:

.dalil/
├── map.json
├── map.md
├── review.md
└── tasks/
    └── <timestamp>-<task-slug>-<id>.md

map.json is the complete portable evidence map, and map.md is its shorter human-readable view. Each task record preserves its original input, repository state, and task-specific orientation. Task records may contain sensitive input; treat them as repository files and choose deliberately whether to ignore or commit them. review.md contains only public surface and architectural facts, so its diff is suitable for review. Run dalil export --review --check in CI to fail when the committed review snapshot is missing or stale.

See repository evidence bundles for refresh, freshness, sharing, and Git guidance.

Integrations

The CLI calls typed operations in dalil-core. Native adapters can use the core API, coding agents can install the Dalil skill, and MCP clients can run the separate dalil-mcp adapter.

Documentation

Inspiration

About

a codebase astrolabe

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Sponsor this project

Contributors

Languages