HeadlinesBriefing favicon HeadlinesBriefing.com

treedocs CLI flags stale docs in Swift repos

Hacker News •
×

Developer Dandy Lyons released treedocs, a Swift CLI that draws a repository’s file tree as a readable diagram and highlights stale entries in red. Running treedocs show displays the structure, while treedocs explore offers progressive disclosure for quick navigation. Current files appear green; missing paths turn red, making drift obvious at a glance. The tool generates a version‑controlled treedocs.yaml map that mirrors the filesystem, allowing teams to audit documentation health without leaving the terminal. It works for any Swift package, making onboarding new contributors faster.

Swift developers on macOS 13+ can install treedocs via Homebrew, Mint or the experimental MISE Swift Package Manager backend. Version 0.2.0 ships as source‑only, so builds pull the tagged GitHub commit and compile with Xcode 16 or a Swift 6‑compatible toolchain. No pre‑built binaries are distributed yet. Installation scripts handle dependency resolution automatically, simplifying setup for CI pipelines.

The CLI offers commands such as treedocs init, sync, check and explore. Sync updates treedocs.yaml, adding new paths and pruning ghosts; check validates the file against a canonical JSON schema that editors, CI tools, and AI agents can parse. A Git pre‑commit hook can block commits that introduce undocumented changes, keeping docs in lockstep for teams.

By coupling a human‑readable YAML map with automated drift detection, treedocs reduces the time developers spend searching for missing documentation. Its source‑only distribution encourages reproducible builds, while the pre‑commit safeguard ensures that documentation stays current as code evolves. The tool provides an immediate, version‑controlled view of repository health. It works across any Swift project structure without additional configuration.