Repository navigation
v1.0.0
macls.py v1.0.0
First public release of macls.py — a dependency-free, single-file Python 3 script that's a drop-in colorized replacement for macOS's ls.
Highlights
- Modification-time gradient — a name's foreground color fades along a recency gradient (5 min / 30 min / 1 hour / 2 hours / 1 day / 1 week / 1 month / older), so the file you're mid-edit on jumps out at a glance.
- Finder tags as background color — tag a file in Finder, see it colored in the terminal (
--tag=bg/dot/str). - Compact columns that don't collapse —
--columns=compact(the default) lets one long filename span multiple column slots instead of stretching every column. - Striped columns —
--stripetints alternating columns (or rows, in-l/-1) for easier scanning. - Inline image thumbnails —
-Ishows a thumbnail next to image files using iTerm2's inline image protocol. - Clickable filenames — every name is an OSC 8 hyperlink to its
file://URL. - Suffix coloring —
--suffix-color=typecolors-F's/ @ * = |indicators by file type. - Quoting —
--quotewraps names with spaces/shell metacharacters in shell-safe quotes. - GNU-style option/path ordering: options and paths can be freely mixed, e.g.
macls.py file.txt -l. - Falls straight back to the real
/bin/lsfor any option it doesn't support.
Requirements
- Python 3.9+ (macOS's built-in
/usr/bin/python3works) - macOS (Finder tags and
-Ithumbnails are macOS/iTerm2-only; basic listing and coloring also work on Linux, including WSL2) - iTerm2 recommended, for
-Ithumbnails and clickable filenames
Install
chmod +x macls.pyPut it on your PATH, or alias it in your shell config:
alias ls='/path/to/macls.py -BF --stripe --suffix-color=type --fg-mode=date --tag=bg --quote'Full option and color reference: macls.md.
License
MIT — see LICENSE.