yui
結 — target-as-truth dotfiles manager
yui is a dotfiles manager that flips the chezmoi flow on its head: edit
your live configs (the target), and the source repo updates
automatically. Built to fix three chezmoi pain points:
- having to edit the source first and
applyafterwards is a constant tax - apps overwrite the target directly, so source and target drift
- new files apps create aren't tracked, and you can't even notice them
How it works
The actual files live in your dotfiles repo, and the targets are hardlinks / junctions / symlinks pointing at them. When an app writes to the target, the link routes the write straight through to source — no copy step, no drift.
| Platform | files | directories |
|---|---|---|
| Linux / macOS | symlink | symlink |
| Windows (default) | hardlink | junction |
| Windows (opt-in) | symlink | symlink (requires Developer Mode / admin) |
Drop a .yuilink marker file inside any directory in your source tree
to make yui link that whole directory as a single unit — files an
app creates inside it land directly in your source repo.
When an editor's atomic-save breaks a hardlink, yui looks at mtimes,
content, and git status to decide between auto-absorb (target →
source, with backup), relink only (contents identical), or ask
(anomaly).
Install
Binary lives at ~/.cargo/bin/yui. Make sure that's on your PATH.
Quick start
# Initialize a fresh source repo at $DOTFILES (and install git hooks).
# Edit $DOTFILES/config.toml to declare your mounts, then:
Minimal $DOTFILES/config.toml:
[]
= "you@example.com"
[[]]
= "home"
# `~` expands to $HOME on Unix and $USERPROFILE on Windows — use it freely.
= "~"
[[]]
= "appdata"
= "{{ env(name='APPDATA') }}"
= "yui.os == 'windows'"
config.local.toml (gitignored) is for machine-local overrides:
[]
= "you@work.example"
Built-in variables exposed to Tera: yui.os, yui.host, yui.user,
yui.arch, yui.source. Environment variables are read with
{{ env(name='HOME') }}. Path values (in dst, --source, YUI_SOURCE,
.yuilink [[link]] dst, etc.) accept a leading ~ / ~/... which
expands to $HOME (or $USERPROFILE on Windows) at apply time —
dst = "~/.config/foo" Just Works™ across platforms.
Status
Pre-release. MVP design complete; implementation in progress.
License
MIT