uit renders line-numbered contents from Git-tracked files and can optionally
include their directory tree. It is useful when collecting repository context
for code reviews, issues, documentation, or AI-assisted development.
- Optionally renders a deterministic tree of Git-tracked files
- Renders text files with line numbers
- Omits binary file contents
- Limits output per file and marks truncated output
- Filters files with repeatable include and exclude globs or a regular expression
- Focuses output on changed, staged, or reference-relative files
- Automatically uses
fzffor interactive multi-selection when safe - Copies the complete output to the clipboard
Download a prebuilt archive from the Releases page.
Alternatively, install from source with Go:
go install github.com/mnishiguchi/uit/cmd/uit@latestuit [options] [path]When path is omitted, uit uses the current directory.
# Render the current repository
uit
# Render one directory
uit internal/cli
# Include the repository tree
uit --tree
# Render only the repository tree
uit --tree-only
# Include Go and Markdown files, excluding tests
uit --include '*.go' --include '*.md' --exclude '*_test.go'
# Apply an advanced regular-expression filter
uit --filter '^internal/.*\.go$'
# Render staged and unstaged changes to tracked files
uit --changed
# Render only staged files
uit --staged
# Render committed and local differences from the main branch
uit --since origin/main
# Render at most 200 lines per file and copy the result
uit --max-lines 200 --copy
# Force interactive file selection
uit --select always
# Render one file without a tree
uit README.mdUse uit --help for the complete option list.
- Git must be available in
PATH. - Building from source requires Go 1.26.5 or newer.
- Automatic interactive selection uses
fzfwhen it is available inPATH. --select alwaysand its--fzfalias requirefzf.- On Linux,
--copyrequiresxcliporxsel.
- A directory path must be inside a Git repository; its output includes only Git-tracked files.
- File input is rendered directly, even when the file is untracked or outside a Git repository.
- File contents are rendered without a tree by default.
--treeadds the full tree, and--tree-onlyomits file contents. --includeand--excludeaccept repeatable, case-sensitive globs. Patterns without/match basenames at any depth,**crosses directories, and a trailing/matches all descendants.- Multiple include patterns are combined with OR, while any matching exclude
pattern removes the file.
--filteradds a regular-expression constraint. --changedincludes staged and unstaged changes to tracked files;--stagedincludes only staged files; and--since REFincludes committed and local differences fromREF. These scopes are mutually exclusive.- Deleted and untracked files are omitted from Git file scopes because
uitrenders existing Git-tracked file contents. - The default limit is 1,000 lines per file;
--max-lines 0disables it. - Interactive selection defaults to
auto: it runs only for directory input whenfzfis installed, all standard streams are terminals, andCIis not set. Use--select alwaysto require it or--select neverto disable it. - Git file scopes, path filters, and interactive selection limit file contents; a requested tree remains complete.
- File input does not include a tree.
Run all local checks:
make checkBuild release binaries:
make buildCreate release archives:
make packageSee RELEASE.md for the release procedure.
MIT. See LICENSE.