feat: add link restore

This commit is contained in:
2026-09-08 09:32:30 +00:00
parent ef3ad1a410
commit 260ef24174
4 changed files with 135 additions and 4 deletions

View File

@@ -116,10 +116,16 @@ dangling symlink instead of the contents, while the host resolves it as before.
```bash
ahab link add .env secrets/ # move out, leave symlinks behind
ahab link restore .env # move it back into the repository
ahab link restore --all # everything this repo has in the store
ahab link check # what a sandbox can still read
ahab link check --porcelain # `<code> <path>`, for scripts
```
`restore` is the inverse of `add`: the file moves out of the store and back to
where it was, and the store keeps nothing. A second checkout linking the same
path is left with a dangling symlink, since there is only ever one stored copy.
The store lives under
`${XDG_DATA_HOME:-$HOME/.local/share}/ahab/<host>/<owner>/<repo>/`, derived
from the git `origin` remote.