Make file paths in terminal output clickable OSC 8 hyperlinks.
Pipe git, diff or grep output through taco and every file path it recognises becomes a link that opens in your editor, at the right line when the input carries one. Single-file Python, standard library only.
π tangoman75.github.io/taco
- Wide line-shape coverage: recognises
diff --git,---/+++,Binary files,rename/copy,git log --stat(plain or--graph),git log --name-status,git status(long,--short,--porcelain=v2), hunk headers,grep path:line:textand bare paths. - Line-aware links:
grepmatches and hunk headers jump to the first changed line of the new file, not just the top of the file. - Repository-scoped resolution: relative paths resolve against the Git root and paths that escape it are left untouched.
- Presets for 11 editors: Atom, VS Code, Emacs, Nano, PhpStorm, PyCharm, PyCharm Community, Sublime Text, Vim, WebStorm and Windsurf.
- Persistent choice: one preset flag writes the template to
~/.config/TangoMan75/taco/config.jsonand every later run reuses it. - One-off templates:
--templateaccepts any URL scheme with{path}/{file}and optional{line}placeholders, without touching the config.
- Idempotent: output that already contains OSC 8 sequences is passed through, so
taco | tacois a no-op after the first pass. - Non-destructive paging: colours and hyperlinks survive
less -R; redirected output is never paged. - No crash on bad input: malformed configs, missing pagers and broken pipes are reported or ignored, never fatal.
- Diff headers:
diff --git a/x b/x,--- a/x,+++ b/x,Binary files a/x and b/x differ. - Git metadata:
rename from/rename to,copy from/copy to. - Git log:
git log --statrows (plain and--graph, including binary and rename{old => new}forms) andgit log --name-statusrows;git log --name-onlypaths are covered by the bare-path rule. - Git status: long-format rows (
modified:,new file:,deleted:,renamed:, untracked paths),--short/--porcelaincolumns (including colored columns andold -> newrenames), and--porcelain=v2rows. - Hunks:
@@ -old[,n] +new[,n] @@links to the current file at the first modified line of the new file. - Search results:
path:line: textfromgrep -nandgit grep -n. - Plain paths: a line that is nothing but a path is linked whole.
Commit messages, hunk content and unrecognised text pass through byte-for-byte. /dev/null is never linked.
-
Clone the repository:
git clone https://github.com/TangoMan75/taco.git cd taco -
Install the command:
./entrypoint.sh install
It copies
taco.pyto/usr/bin/taco, usingsudowhen needed, and skips the copy when the installed file is already identical. It does not touch your Git configuration. -
Configure Git (optional):
./entrypoint.sh config
This runs
git config --global core.pager 'taco', sogitoutput is filtered automatically from then on. Skip it to leave your global Git config unchanged. Undo it later with./entrypoint.sh unconfig. -
Verify:
taco --help
To do both steps by hand:
sudo install -m 755 taco.py /usr/bin/taco git config --global core.pager taco
-
Pipe a command through it:
git diff | taco git log -p | taco git status | taco grep -rn "TODO" . | taco
-
Pick an editor once:
taco --code # VS Code taco --vim taco --pycharmThe template persists in
~/.config/TangoMan75/taco/config.json. -
Override for a single run:
grep -rn foo . | taco --template 'vscode://file/{path}:{line}'
-
Control paging. When stdout is a terminal, output goes through a pager (
less -Rby default). Redirected stdout is written directly, sogit diff | taco > patch.diffstill works.git diff | taco --no-pager # write straight to the terminal git diff | taco --pager 'less -S' # custom pager command
The pager command comes from
--pager, then$TACO_PAGER, then$PAGER, thenless. WhenLESSis unset,lessis started withFRX: quit if the output fits on one screen, keep raw colours, do not clear the screen on exit.
| Flag | Default | Description |
|---|---|---|
--template URL |
config default_template |
URL template with {path}/{file} and optional {line} (one-off, not persisted) |
--atom |
β | Use the Atom preset (persists) |
--code |
β | Use the VS Code preset (persists) |
--emacs |
β | Use the Emacs preset (persists) |
--nano |
β | Use the Nano preset (persists) |
--phpstorm |
β | Use the PhpStorm preset (persists) |
--pycharm |
β | Use the PyCharm preset (persists) |
--pycharm-community |
β | Use the PyCharm Community preset (persists) |
--subl |
β | Use the Sublime Text preset (persists) |
--vim |
β | Use the Vim preset (persists) |
--webstorm |
β | Use the WebStorm preset (persists) |
--windsurf |
β | Use the Windsurf preset (persists) |
--root PATH |
auto-detected via git |
Repository root for resolving paths |
--pager CMD |
$TACO_PAGER, $PAGER, less |
Pager command used when stdout is a terminal |
--no-pager |
β | Write directly to stdout instead of paging |
--template and the preset flags are mutually exclusive, and so are --pager and --no-pager.
Presets write default_template to ~/.config/TangoMan75/taco/config.json:
{
"default_template": "code://open?url=file:///{file}&line={line}"
}- The file is created the first time a preset flag runs.
- With no
--templateor preset flag, runs readdefault_templateand fall back tofile:///{path}when the file is missing or the value is empty. - A malformed config prints a warning on stderr and the built-in default is used β no crash.
- Both
{path}and{file}are accepted for the file path;{path}/{file}carry the absolute path without its leading slash. If the template has no{line}, a#linefragment is appended when a line is known.
- Python 3.10+: the whole tool is a single stdlib-only script; no packages to install.
- Git (recommended): used to auto-detect the repository root. When it is unavailable, the current working directory is used unless
--rootis passed. - A pager (optional):
lessis the default; any executable named by--pager,$TACO_PAGERor$PAGERalso works. Non-terminal stdout needs none. - ruff (development only): used by CI for linting.
- Links show as plain text: the terminal must support OSC 8. Test with
printf '\e]8;;https://example.com\e\\click\e]8;;\e\\\n'; if that is not clickable, the terminal (or multiplexer) lacks support. taco: pager not found: installlessor select another pager with--pager,$TACO_PAGER,$PAGER, or bypass paging with--no-pager.- Links point at the wrong directory: pass
--rootexplicitly, or run the command inside the Git repository whose root should be used. - Nothing is linked:
tacoonly recognises the line shapes listed above, and paths outside the repository root are deliberately skipped. - Git behaves unexpectedly after
./entrypoint.sh config: the command setscore.pagerglobally. Undo with./entrypoint.sh unconfig(orgit config --global --unset core.pager). taco: ignoring malformed config ...: repair or delete~/.config/TangoMan75/taco/config.json; the built-in default takes over meanwhile.
- Standalone suite:
python3 tests/test_taco.pydrivesTransformerFactoryandLineTransformerdirectly with no pytest or third-party harness, covering diff/grep/status shapes, presets, config persistence, pager selection, broken pipes and idempotency. - Behavioural spec:
features/taco.featuredocuments the expected behaviour as Gherkin scenarios and is linted in CI. - Lint:
pip install ruff && ruff check .. - CI: GitHub Actions runs the test suite on Python 3.10, 3.11 and 3.12, plus the ruff job, for every push and pull request to
main.
β οΈ Known shapes only: prose or custom log formats are passed through unchanged; extend the handler chain intaco.pyto add new shapes.β οΈ Terminal support required: OSC 8 links need a capable terminal and are silently inert elsewhere.β οΈ Repository-root scoped: paths that resolve outside the root are never linked, and the root must be correct for links to work.β οΈ Idempotent short-circuit: any line already containing an OSC 8 sequence is skipped, so a second pass cannot retarget existing links.β οΈ configchanges Git config:./entrypoint.sh configsets the global Git pager, which affects every repository on the machine../entrypoint.sh installalone leaves Git untouched, and./entrypoint.sh unconfigreverts the pager change.
taco will not implement handling for the following terminal tools. Each one can already emit OSC 8 hyperlinks on its own, and adding a duplicate parser to taco would only drift from upstream.
ls already provides an option to output clickable terminal OSC 8 hyperlinks:
ls --hyperlinkripgrep already provides an option to output clickable terminal OSC 8 hyperlinks:
rg --hyperlink-format defaultfd already provides an option to output clickable terminal OSC 8 hyperlinks:
fd --hyperlinktaco.py reads stdin line by line and walks an ordered chain of handler classes. Each handler returns None when it does not recognise a line; the first non-None result wins. LineContext carries the PathResolver, the UrlTemplate and a per-stream StreamState, which remembers the current file so hunk headers and context lines can refer back to it. Hunk headers link to new_start (plus the three usual context lines) so a click lands on the first changed line.
The default template is file:///{path}; presets use <scheme>://open?url=file:///{file}&line={line}.
Thank you for your interest in contributing to Taco.
Please open an issue first for bugs or feature ideas, and check whether one already exists in the issue tracker.
Pull requests should keep the codebase stdlib-only, preserve the class-based handler chain, and pass both python3 tests/test_taco.py and ruff check ..
Project conventions are documented in AGENTS.md.
Copyrights (c) 2026 "Matthias Morin" mat@tangoman.io
Distributed under the MIT license.
If you like Taco please star, follow or tweet:
- Python standard library: everything from argument parsing to subprocess paging is stdlib, so there is nothing to install.
- OSC 8: the terminal hyperlink escape sequence that makes the whole idea work.
- Git and GNU less: the tools whose output
tacois built to read and page.
Clean code. Clear communication.
From first sketch to final launch, I've got your back.