Repository navigation
API Reference
Complete reference for all symlinkit flags, options, and commands.
symlinkit [FLAGS] [SOURCE] [DESTINATION]Required for creation and deletion operations.
Create a new symlink safely (fails if destination path exists).
Syntax:
symlinkit -c SOURCE DESTINATIONBehavior:
- Checks if destination path already exists
- Fails with helpful error if destination exists
- Creates symlink only if destination path is free
- Suggests
-oor-mfor existing destinations
Example:
symlinkit -c ~/dotfiles/.vimrc ~/.vimrc
# Result: ~/.vimrc → ~/dotfiles/.vimrcError case:
symlinkit -c ~/dotfiles/.vimrc ~/.vimrc
# If ~/.vimrc exists:
# ❌ Target already exists: /home/user/.vimrc
# Use -o to overwrite or -m to merge into existing targetSee: Symlink Modes#Create Mode
Replace existing file or directory at destination path with a symlink.
Syntax:
symlinkit -o SOURCE DESTINATIONBehavior:
- Removes existing file/directory at destination path
- Creates symlink:
DESTINATION/basename(SOURCE) → SOURCE - Single symlink result
Example:
symlinkit -o ~/dotfiles/.vimrc ~/.vimrc
# Result: ~/.vimrc → ~/dotfiles/.vimrcSee: Symlink Modes#Overwrite Mode
Recursively symlink directory contents.
Syntax:
symlinkit -m SOURCE DESTINATIONBehavior:
- Creates destination directory if needed
- Symlinks each file individually
- Preserves directory structure
- Prompts on conflicts
Example:
symlinkit -m ~/dotfiles/scripts ~/bin
# Result: ~/bin/scripts/* → ~/dotfiles/scripts/*Remove a symlink safely.
Syntax:
symlinkit -d SYMLINK_PATHBehavior:
- Validates SYMLINK_PATH is a symlink
- Shows what the symlink points to
- Removes symlink only (not what it points to)
- Errors if not a symlink
Example:
symlinkit -d ~/.vimrc
# Output: ❌ Deleted: /home/user/.vimrc → /home/user/dotfiles/.vimrcSee: Symlink Modes#Delete Mode
Combine with operation flags for recursive operations.
Syntax:
symlinkit -r [OPERATION] SOURCE DESTINATION
symlinkit -[c|o|d]r SOURCE DESTINATION # Flag chainingCan combine with:
-
-c→ Create recursive (equivalent to-mmerge mode) -
-o→ Overwrite recursive with interactive prompts -
-d→ Delete recursive (interactively delete all symlinks in directory)
Example:
# Traditional merge mode
symlinkit -m ~/dotfiles/config ~/.config
# Equivalent using recursive flag
symlinkit -c -r ~/dotfiles/config ~/.config
symlinkit -cr ~/dotfiles/config ~/.config # Flag chaining
# Overwrite recursive
symlinkit -or ~/dotfiles/scripts ~/bin
# Delete recursive
symlinkit -dr ~/.configSee: Symlink Modes#Recursive Operations
Combine operation flags with recursive mode using intuitive shortcuts.
Equivalent to merge mode (-m).
Syntax:
symlinkit -cr SOURCE DESTINATION
symlinkit -rc SOURCE DESTINATION # Both orders workBehavior:
- Links directory contents recursively
- Prompts on conflicts:
[s]kip / [o]verwrite / [a]ll overwrite / [c]ancel - Identical to
symlinkit -m SOURCE DESTINATION
Example:
symlinkit -cr ~/dotfiles/config ~/.configRecursively create symlinks with interactive conflict handling.
Syntax:
symlinkit -or SOURCE DESTINATION
symlinkit -ro SOURCE DESTINATION # Both orders workBehavior:
- Creates symlinks recursively
- For each conflict, prompts:
[s]kip / [o]verwrite / [a]ll overwrite / [c]ancel - Press
[a]to overwrite all remaining conflicts
Example:
symlinkit -or ~/dotfiles/scripts ~/binInteractively delete all symlinks in a directory.
Syntax:
symlinkit -dr DIRECTORY
symlinkit -rd DIRECTORY # Both orders workBehavior:
- Finds all symlinks in directory
- For each symlink, prompts:
[d]elete / [a]ll delete / [s]kip / [q]uit - Press
[a]to delete all remaining symlinks - Only removes symlinks, never what they point to
- Shows summary: deleted/skipped counts
Example:
symlinkit -dr ~/.config
# Output:
# Found 3 symlink(s) in /home/user/.config
# /home/user/.config/nvim → /home/user/dotfiles/nvim
# [d]elete / [a]ll delete / [s]kip / [q]uit >With dry-run:
symlinkit --dry-run -dr ~/test-links
# Shows "Would delete (all)" without removing linksSee: Symlink Modes#Recursive Operations
Preview operations without applying changes.
Syntax:
symlinkit --dry-run [OPERATION] SOURCE DESTINATIONBehavior:
- Shows what would happen
- Conflicts default to "skip"
- No filesystem changes
- Displays summary
Example:
symlinkit --dry-run -m ~/dotfiles ~/.config
# Shows: Would link X, Would skip Y, Would overwrite ZCompatible with: All operations
Preview with conflicts defaulting to overwrite.
Syntax:
symlinkit --dry-run-overwrite -m SOURCE DESTINATIONBehavior:
- Same as
--dry-run - Conflicts default to "overwrite" instead of "skip"
Example:
symlinkit --dry-run-overwrite -m ~/dotfiles ~/.configCompatible with: Merge mode
No operation flag required.
List all symlinks in directory.
Syntax:
symlinkit --list [DIRECTORY]Parameters:
-
DIRECTORY(optional) - Directory to scan. If omitted, uses interactive selection.
Output:
📊 Found 3 symlinks in /home/user/.config
/home/user/.config/nvim → /home/user/dotfiles/nvim
/home/user/.config/tmux → /home/user/dotfiles/tmux
Example:
symlinkit --list ~/.config
symlinkit --list # InteractiveSee: Inspection Tools#List Mode
List symlinks with detailed information (ls -l style).
Syntax:
symlinkit --list-verbose [DIRECTORY]Output:
lrwxrwxrwx 1 user user 29 Dec 10 10:30 /home/user/.config/nvim → ...
Example:
symlinkit --list-verbose ~/.configFind broken symlinks (pointing to non-existent paths).
Syntax:
symlinkit --broken [DIRECTORY]Output:
📊 Found 2 broken symlinks in /home/user/.config
/home/user/.config/old → /home/user/removed/file
Example:
symlinkit --broken ~
symlinkit --broken /usr/local/binSee: Inspection Tools#Broken Symlinks
Interactively repair broken symlinks.
Syntax:
symlinkit --fix-broken [DIRECTORY]Interactive prompts:
-
[d]elete- Remove broken symlink -
[u]pdate- Point to new path -
[s]kip- Leave unchanged
Example:
symlinkit --fix-broken ~/.configSee: Inspection Tools#Fix Broken Links
Show only symlink count.
Syntax:
symlinkit --count-only [DIRECTORY]Output:
🔢 5 symlinks in /home/user/.config
Example:
symlinkit --count-only ~/.configSee: Inspection Tools#Count Only
Minimal tree view (symlinks only).
Syntax:
symlinkit --tree [DIRECTORY]Requires: tree utility
Example:
symlinkit --tree ~/.configSee: Inspection Tools#Tree View
Tree view with permissions and details.
Syntax:
symlinkit --tree-verbose [DIRECTORY]Example:
symlinkit --tree-verbose ~/.configLimit search/tree depth.
Syntax:
symlinkit --depth N [COMMAND]Parameters:
-
N- Integer depth level (default: 3)
Affects:
-
--tree/--tree-verbose --fix-broken- All inspection commands
Example:
symlinkit --depth 5 --list ~/.config
symlinkit --depth 2 --tree /usr/localSee: Advanced Features#Depth Control
Sort results by path or target.
Syntax:
symlinkit --sort [path|target] [COMMAND]Parameters:
-
path- Sort by symlink path (default) -
target- Sort by symlink target
Example:
symlinkit --sort path --list ~/.config
symlinkit --sort target --list ~/.configSee: Advanced Features#Sorting Output
Output in JSON format.
Syntax:
symlinkit --json [COMMAND]Compatible with:
--list--broken--count-only
Output format:
[
{"path": "/home/user/.config/nvim", "target": "/home/user/dotfiles/nvim"}
]Example:
symlinkit --json --list ~/.config
symlinkit --json --broken ~Note: Works with or without jq installed.
See: Inspection Tools#JSON Output
Force fzf usage (error if not installed).
Syntax:
symlinkit --fzf [COMMAND]Behavior:
- Requires fzf to be installed
- Errors if fzf not found
- Use in scripts requiring consistent UX
Example:
symlinkit --fzf --listSee: Interactive Selection#Force fzf Usage
Disable fzf, use manual prompts only.
Syntax:
symlinkit --no-fzf [COMMAND]Behavior:
- Forces text input prompts
- Works even if fzf installed
- Use for automation or minimal environments
Example:
symlinkit --no-fzf --listSee: Interactive Selection#Force Manual Prompts
Check dependencies and show diagnostic report.
Syntax:
symlinkit --doctorBehavior:
- Shows version and OS information
- Checks for required utilities (realpath, find)
- Checks for optional utilities (jq, fzf, tree)
- Reports what functionality is guaranteed vs. best-effort
- Provides installation instructions for missing dependencies
Output:
🩺 symlinkit doctor report
Version: 1.8.4
OS: Linux+WSL
Core utilities:
✅ realpath found — path resolution working
✅ find found — file discovery working
Optional utilities:
✅ jq found — JSON output is guaranteed valid
✅ fzf found — interactive selection enabled
⚠️ tree not found — falling back to flat symlink list
Summary:
⚠️ 1 optional dependencies missing — core functionality works, some features degraded
Use Cases:
- Verify installation
- Debug issues
- Check which features are available
- Get installation instructions for missing tools
Example:
symlinkit --doctorShow help message.
Syntax:
symlinkit --help
symlinkit -hOutput: Complete flag reference and usage examples.
Show version and platform information.
Syntax:
symlinkit --version
symlinkit -vOutput:
symlinkit 1.8.3 (Linux+WSL)
Powerful combinations for advanced workflows.
symlinkit --dry-run -m ~/dotfiles ~/.config --treesymlinkit --json --sort target --list ~/.configsymlinkit --depth 2 --count-only /usrsymlinkit --json --sort path --depth 5 --list ~/.config > report.jsonSource file or directory to symlink from.
Type: File path (absolute or relative)
Usage:
- Required for
-c,-oand-mmodes - Not used in
-dmode
Examples:
~/dotfiles/.vimrc
/etc/configs
./relative/pathDestination directory for symlink creation.
Type: Directory path (absolute or relative)
Usage:
- Required for
-c,-oand-mmodes - Not used in
-dmode
Examples:
~/.config
/opt/app
.Directory to inspect (for inspection commands).
Type: Directory path (absolute or relative)
Usage:
- Optional for all inspection commands
- If omitted, uses interactive selection
Examples:
symlinkit --list ~/.config
symlinkit --broken /usr/local/bin
symlinkit --tree # Interactive| Code | Meaning |
|---|---|
0 |
Success |
1 |
Error (invalid arguments, operation failed, user cancelled) |
Example usage:
if symlinkit -o ~/dotfiles/.vimrc ~/.vimrc; then
echo "Success"
else
echo "Failed"
fiCustomize fzf behavior globally.
Example:
export FZF_DEFAULT_OPTS="--height 40% --reverse --border"Affects symlinkit's fzf usage.
Standard behavior, all features available.
- Requires GNU utilities:
grealpath,gfind - Automatically detected and used
- Install via:
brew install coreutils findutils
- Automatic WSL detection
- Windows path conversion via
wslpath - Works with
/mnt/c/paths
-
-c(create) -
-o(overwrite) -
-m(merge) -
-d(delete) -
-r/--recursive(recursive modifier)
-
-cr/-rc(create recursive) -
-or/-ro(overwrite recursive) -
-dr/-rd(delete recursive)
--dry-run--dry-run-overwrite
-
--list/--list-verbose --broken--fix-broken--count-only-
--tree/--tree-verbose
--depth N--sort [path|target]--json
--fzf--no-fzf
--doctor-
-h/--help -
-v/--version
symlinkit --dry-run -c SOURCE DEST
symlinkit --dry-run -o SOURCE DEST
symlinkit --dry-run -m SOURCE DEST
symlinkit --dry-run -dr DIR # Preview recursive deletesymlinkit -cr SOURCE DEST # Create recursive
symlinkit -or SOURCE DEST # Overwrite recursive
symlinkit -dr DIR # Delete recursivesymlinkit -o SOURCE DEST --tree
symlinkit -cr SOURCE DEST --tree # With flag chainingsymlinkit --json --list DIR > report.json
symlinkit --json --broken DIR > broken.jsonsymlinkit --count-only DIRsymlinkit --depth 10 --sort target --list DIRCause: No operation flag provided
Solution: Add -c, -o, -m, or -d
# Wrong
symlinkit source dest
# Correct (create safely)
symlinkit -c source dest
# Correct (overwrite existing)
symlinkit -o source destCause: Used --fzf flag but fzf not installed
Solutions:
- Install fzf
- Remove
--fzfflag - Use
--no-fzf
Cause: Tried to delete non-symlink with -d
Solution: Verify path is a symlink
ls -la PATH # Check if it's a symlink| Flag | Args | Description | Requires Operation |
|---|---|---|---|
-c |
src dest | Create mode (safe) | - |
-o |
src dest | Overwrite mode | - |
-m |
src dest | Merge mode | - |
-d |
symlink | Delete mode | - |
-r / --recursive
|
- | Recursive flag (combine with -c, -o, -d) | - |
-cr / -rc
|
src dest | Create recursive (same as -m) | - |
-or / -ro
|
src dest | Overwrite recursive with prompts | - |
-dr / -rd
|
dir | Delete recursive (interactive) | - |
--dry-run |
- | Preview changes | No |
--list |
[dir] | List symlinks | No |
--broken |
[dir] | Find broken links | No |
--fix-broken |
[dir] | Repair broken | No |
--tree |
[dir] | Tree view | No |
--count-only |
[dir] | Count symlinks | No |
--depth |
N | Set depth limit | No |
--sort |
mode | Sort output | No |
--json |
- | JSON output | No |
--fzf |
- | Force fzf | No |
--no-fzf |
- | Disable fzf | No |
--doctor |
- | Check dependencies | No |
- Quick Start - Get started with practical examples
- Usage Examples - See API in action
- Advanced Features - Master complex workflows
# Built-in help
symlinkit --help
# Manual page
man symlinkit
# Online documentation
https://github.com/ctrl-alt-adrian/symlinkit/wikiReport issues: GitHub Issues
Symlinkit Wiki Navigation
Getting Started
Features & Functionality
Development & Contributing