dirdocs
dirdocs is a Rust-powered CLI that provides file level documentation by leveraging an LLM.
It walks a directory (respecting .gitignore and extra ignores), hashes files, and for each new or changed file, it queries an LLM using the Awful Jade configuration + prompt templates.
The result is stored in a .dirdocs.nu file at the project root — a Nuon-compatible JSON tree of files, each annotated with descriptions, joy metrics, and personality emojis.
.`.
.`~.-:
.`- . -`
.`- . -`
.`- . -`
.`- . -`
.`- . -`
`- . -`
.`- . -`
;- . -`
.- . -`
;. . -`
;. . -`
::._.-`
(.-`
.Y(.
((()))
_)==(_
| .--. |
| '--' |
'------' LGB(plus at least two more letters)
🚀 How it works
- Scan — Uses
ignore::WalkBuilderto walk the project, applying.gitignore, global gitignore, excludes, and hidden rules. - Cache merge — Loads previous
.dirdocs.nuand any subdirectory caches so unchanged files are skipped. - Hash — Uses content hashing to detect dirty vs clean files.
- Template render — Builds a YAML-based LLM prompt from
dir_docs.yamlin yourawful_jadeconfig directory. - LLM call — Uses
awful_aj::askwith exponential backoff to request descriptions. - Merge + write — Updates
.dirdocs.nuin place with new/changed entries, preserving older cached docs. - Works extremely well with the Qwen 3 4B model I Finetuned for Systems Programming related queries.
💡 Use with the included
dlsanddtreebinaries or replace Github commit messages with the Chrome Extension.
📦 Installation
👷🏽♀️ Setup (steps will vary according to your operating system)
- Install conda python version manager.
- Create Python 3.11 virtual environment named aj and activate it.
- Install pytorch 2.4.0
- Add the following to your shell initialization.
# Or wherever Conda installed libtorch on your OS
⚙️ Usage
Initialize the template and configuration
Generate file level documentation
Flags
-d, --directory <PATH>— Root directory to scan (default.).-i, --ignore <NAMES>— Extra directories to ignore (comma-separated or repeatable).-f, --force— Force regeneration for all files, even if unchanged.
Examples
# Document the current project
# Document another directory
# Ignore build artifacts
# Regenerate everything
📄 Output: .dirdocs.nu
Example snippet:
- Fully Nuon-compatible (readable in Nushell).
- Is used by
dlsanddtreeto produce colorized tree listings with inline docs.

🔧 Configuration
- Reads
Awful Jadeconfig from~/.config/com.awful-sec.aj/config.yaml. - Uses a Handlebars template:
~/.config/com.awful-sec.aj/templates/dir_docs.yaml
(You can customize the YAML to change prompt formatting.)
🧩 Included Binaries
dls—ls-style directory listings with.dirdocs.nudocs attached.dtree— tree-style visualization with emoji 🌿 or ASCII connectors.
Together with dirdocs, they form a documentation-aware tree + ls.
🛠 Roadmap
- Implement a Bionic Font algorithm to make walls of text easier to read.
- Richer JSON schema with symbol lists and token counts.
- Integration with
rust_ast.nufor Rust-specific symbol trees.
🤝 Contributing
PRs welcome!
- Improve template logic.
- Expand test coverage.
📜 License
This project is licensed under CC0 1.0 Universal (Public Domain Dedication).
You can copy, modify, distribute, and perform the work, even for commercial purposes, all without asking permission.