Repository navigation
API Reference
Complete reference for all symlinkit flags, options, and commands.
symlinkit [FLAGS] [SOURCE] [DESTINATION]Required for creation and deletion operations.
Replace target with a single symlink.
Syntax:
symlinkit -o SOURCE DESTINATIONBehavior:
- Removes existing target (file or directory)
- 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 TARGETBehavior:
- Validates TARGET is a symlink
- Shows symlink target
- Removes symlink only (not target)
- Errors if not a symlink
Example:
symlinkit -d ~/.vimrc
# Output: ❌ Deleted: /home/user/.vimrc → /home/user/dotfiles/.vimrcSee: Symlink Modes#Delete Mode
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 targets).
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 target -
[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
Show 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.6.0 (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
-oand-mmodes - Optional for
-dmode (interactive if omitted)
Examples:
~/dotfiles/.vimrc
/etc/configs
./relative/pathDestination directory for symlink creation.
Type: Directory path (absolute or relative)
Usage:
- Required for
-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
-
-o(overwrite) -
-m(merge) -
-d(delete)
--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
-
-h/--help -
-v/--version
symlinkit --dry-run -o SOURCE DEST
symlinkit --dry-run -m SOURCE DESTsymlinkit -o SOURCE DEST --treesymlinkit --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 -o, -m, or -d
# Wrong
symlinkit source dest
# Correct
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 target is a symlink
ls -la TARGET # Check if it's a symlink| Flag | Args | Description | Requires Operation |
|---|---|---|---|
-o |
src dest | Overwrite mode | - |
-m |
src dest | Merge mode | - |
-d |
target | Delete mode | - |
--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 |
- 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