plugins/file/commands/diff architecture

Implements the file diff command for previewing workspace-relative git diffs, handling single-file and timeline/commit variants with repository resolution, truncation limits, and CLI/web rendering.

Architectural role

Read-only inspection leaf within the git-operations family of the plugins/file/commands aggregation. Positioned beneath the centralized file dispatcher (plugins/file/adapter.ts/handleFile) and registration (init.ts) seam alongside commit/history/restore/init, it provides non-mutating preview complementary to those mutating peers. Follows the shared validate-containment/repository-resolution → execute → adapt pattern via shared/ helpers, fans out internally across single-file/timeline/commit variants, and delegates all web presentation to renderers/ while keeping CLI output in the adapter layer.

Source map

Integration details