Skip to content

cachebag/unrot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unrot

CI License: MIT License: Apache 2.0

A symlink is broken when its target no longer exists. unrot finds these, reports the dead target path, and attempts to locate where it moved by fuzzy matching the target filename against the real filesystem. You decide whether to re-link, skip, or remove.

Install

cargo install unrot

Usage

# Scans current directory for broken symlinks and interactively allows you to fix them (default)
unrot

# Scans a specific directory
unrot /path/to/project

# Scan only — report broken links (link -> target)
unrot scan /path/to/project

# List broken symlink paths only, no candidates
unrot list /path/to/project

# Search for candidates in a wider directory tree
unrot ~/project -s ~/

# Preview what would happen without modifying anything
unrot /path/to/project --dry-run

# Add extra directories to skip (on top of .git, node_modules, target, etc.)
unrot /path/to/project -I vendor -I dist

Commands

Command Description
(default) Interactive fix mode — scan, show candidates, let you re-link/skip/remove
scan [PATH] Scan only, report broken links (link -> target)
fix [PATH] Interactive fix mode (explicit)
list [PATH] List broken link paths only, no candidates, exit

Interactive commands

When prompted for each broken symlink:

Input Action
1, 2, ... Re-link to the numbered candidate
c Enter a custom path to re-link to
s Skip this symlink
r Remove this symlink (asks for confirmation)

Options

Option Short Description
[PATH] Directory to scan (default: .)
--search-root <PATH> -s Search for candidates here instead of the scan path
--dry-run Preview changes without modifying the filesystem
--batch-confirm Collect all decisions, show summary, then confirm before applying
--ignore <NAME> -I Additional directory names to skip (repeatable)

License

Licensed under either of

at your option.

About

Dead symlink detector and resolver with fuzzy path recovery.

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE

Stars

Watchers

Forks

Contributors

Languages