addi -- add indentation to ls output
addi is a command-line tool that reformats the output of ls -lR by removing total lines and indenting subdirectories recursively. It reads from stdin and writes to stdout, fitting naturally into Unix pipelines.
go install github.com/tksh/addi@latestOr build from source:
git clone https://github.com/tksh/addi.git
cd addi
go build -o addi .ls -lR | addi
ls -lR | addi -s
ls -lR | addi --simple| Flag | Description |
|---|---|
-s |
Simple mode: show only file type character and filename |
--simple |
Alias for -s |
-h |
Print help message |
--help |
Alias for -h |
For side-by-side comparisons of ls output with and without addi, see EXAMPLES.md.
Basic usage:
ls -lR | addiSimple mode (file type + name only):
ls -lR | addi -saddi requires ls -lR output as input. The -l (long listing) and -R (recursive) flags are essential for the tool to function.
Additional flags are optional but recommended:
| Flag | Description |
|---|---|
-h |
Human-readable sizes |
-A |
Show hidden files (except . and ..) |
-I |
Ignore files matching PATTERN (e.g., .git) |
totallines are removed- Empty lines between directory sections are preserved
- Subdirectories are indented with 8 spaces per nesting level
- Root directory path is displayed in faint text (dimmed) for readability
- In simple mode (
-s), file metadata is stripped to show only the file type character and filename - Set
NO_COLORenvironment variable to disable ANSI color codes
- Linux
- Go 1.26.5 or later
Mozilla Public License Version 2.0