Repository navigation
API Reference
Complete reference for all symlinkit 2.0 flags, options, and commands.
symlinkit [FLAGS] [SOURCE] [DESTINATION]Note: Operation flags are mandatory for CRUD operations. Inspection tools (--list, --broken, --fix-broken) do not require operation flags.
Create a new symlink.
Behavior: Fails if destination already exists.
symlinkit -c SOURCE DESTExample:
symlinkit -c ~/dotfiles/.bashrc ~/.bashrcOverwrite existing file/directory with symlink.
Behavior: Removes existing content and replaces with symlink.
--dry-run first.
symlinkit -o SOURCE DESTExample:
symlinkit --dry-run -o ~/dotfiles/.vimrc ~/.vimrc
symlinkit -o ~/dotfiles/.vimrc ~/.vimrcRecursively symlink directory contents.
Behavior: Traverses source directory and creates symlinks in destination. Prompts on conflicts.
symlinkit -m SOURCE DESTExample:
symlinkit -m ~/dotfiles/.config ~/.configDelete a symlink.
Behavior: Removes symlink without affecting target.
symlinkit -d SYMLINK_PATHExample:
symlinkit -d ~/.config/nvimEnable recursive mode for create, overwrite, or delete operations.
Can be combined with:
-
-c(create recursive = merge mode) -
-o(overwrite recursive with prompts) -
-d(delete all symlinks in directory)
Flag chaining supported:
symlinkit -cr SOURCE DEST # Equivalent to -m
symlinkit -or SOURCE DEST # Recursive overwrite with prompts
symlinkit -dr DIRECTORY # Recursively delete symlinksExamples:
# Recursive create (same as -m)
symlinkit -cr ~/dotfiles ~/.config
# Recursive overwrite
symlinkit -or ~/dotfiles ~/.config
# Recursive delete
symlinkit -dr ~/binThese flags do not require operation flags.
List all symlinks in a directory.
Syntax:
symlinkit --list [DIRECTORY]Behavior: If DIRECTORY is omitted, prompts for input.
Example:
symlinkit --list ~/
symlinkit --list # Prompts for directoryOutput:
/home/user/.bashrc -> /home/user/dotfiles/.bashrc
/home/user/.zshrc -> /home/user/dotfiles/.zshrc
Found 2 symlinks in /home/user
Find broken symlinks in a directory.
Syntax:
symlinkit --broken [DIRECTORY]Behavior: If DIRECTORY is omitted, prompts for input.
Example:
symlinkit --broken ~/
symlinkit --broken # Prompts for directoryOutput:
/home/user/.config/old -> /nonexistent/path (broken)
Found 1 broken symlink in /home/user
Interactively fix broken symlinks.
Syntax:
symlinkit --fix-broken [DIRECTORY]Behavior: For each broken symlink, prompts for action: delete, update, or skip.
Example:
symlinkit --fix-broken ~/
symlinkit --dry-run --fix-broken ~/ # Preview onlyInteractive Prompt:
/home/user/.config/old -> /nonexistent (broken)
[d]elete / [a]ll delete / [u]pdate / [s]kip >
Preview actions without making changes.
Syntax:
symlinkit --dry-run [OPERATION_FLAG] SOURCE DESTWorks with:
-c, --create-o, --overwrite-m, --merge-d, --delete--fix-broken
Example:
symlinkit --dry-run -m ~/dotfiles ~/.config
symlinkit --dry-run -o ~/source ~/dest
symlinkit --dry-run --fix-broken ~/Output Examples:
⚠️ Would create: ~/.bashrc -> ~/dotfiles/.bashrc
✅ Would link: ~/.config/nvim
⚠️ Would delete: ~/.config/old-link
Show help message.
Syntax:
symlinkit --helpOutput: Displays usage information and all available flags.
Show version and platform information.
Syntax:
symlinkit --versionOutput:
symlinkit 2.0.0 (Linux)
symlinkit 2.0.0 (Darwin)
symlinkit 2.0.0 (Linux+WSL)
Path to the source file or directory to be symlinked.
Optional if: Operation prompts for input when omitted.
Examples:
~/dotfiles/.bashrc
/home/user/configs/nvim
./local-filePath where the symlink should be created.
Optional if: Operation prompts for input when omitted.
Behavior with directories: If DEST is an existing directory, symlink is created inside it with source's basename.
Examples:
# DEST is file path
symlinkit -c ~/dotfiles/.bashrc ~/.bashrc
# DEST is directory (link created as ~/.config/nvim)
symlinkit -c ~/dotfiles/nvim ~/.config/# Dry run with any operation
symlinkit --dry-run -c SOURCE DEST
symlinkit --dry-run -o SOURCE DEST
symlinkit --dry-run -m SOURCE DEST
symlinkit --dry-run -d SYMLINK
symlinkit --dry-run --fix-broken DIR
# Recursive operations
symlinkit -cr SOURCE DEST # -c + -r
symlinkit -or SOURCE DEST # -o + -r
symlinkit -dr DIRECTORY # -d + -r
# Chained flags
symlinkit -c -r SOURCE DEST # Same as -cr# ❌ Multiple operation flags
symlinkit -c -o SOURCE DEST # ERROR
# ❌ No operation flag for CRUD operations
symlinkit SOURCE DEST # ERROR
# ❌ Operation flag with inspection tools
symlinkit -c --list ~/ # ERROR| Code | Meaning |
|---|---|
0 |
Success |
1 |
Error (invalid arguments, operation failed, user cancelled) |
When SOURCE or DEST is omitted:
Enter source directory:
Enter destination directory:
⚠️ Conflict: ~/.config/file.txt exists.
[s]kip / [o]verwrite / [a]ll overwrite / [c]ancel >
Options:
-
s- Skip this file -
o- Overwrite this file -
a- Overwrite all remaining -
c- Cancel operation
~/.local/bin/script.sh -> ~/dotfiles/scripts/script.sh
[d]elete / [a]ll delete / [s]kip / [q]uit >
Options:
-
d- Delete this symlink -
a- Delete all remaining -
s- Skip this symlink -
q- Quit
/home/user/.config/old -> /nonexistent (broken)
[d]elete / [a]ll delete / [u]pdate / [s]kip >
Options:
-
d- Delete this broken symlink -
a- Delete all remaining broken symlinks -
u- Update with new target path -
s- Skip this symlink
symlinkit auto-detects the operating system:
-
Linux: Uses
realpath -
macOS: Uses
grealpath(via Homebrew coreutils) -
WSL: Detected via
/proc/version, usesrealpath
Required:
- Bash 3.2+
-
realpath(Linux/WSL) orgrealpath(macOS)
No optional dependencies: All features work with required tools only.
# Link individual config
symlinkit -o ~/dotfiles/.zshrc ~/.zshrc
# Merge config directory
symlinkit -m ~/dotfiles/.config ~/.config# Find broken symlinks
symlinkit --broken /usr/local/bin
# Fix broken links
symlinkit --fix-broken /usr/local/bin# Link scripts directory
symlinkit -m ~/project/bin ~/bin
# Preview changes first
symlinkit --dry-run -m ~/project/bin ~/bin- Symlink Modes - Detailed explanation of each operation mode
- Inspection Tools - Using list, broken, and fix-broken
- Usage Examples - Real-world scenarios
Symlinkit Wiki Navigation
Getting Started
Features & Functionality
Development & Contributing