A fast, interactive CLI tool for managing symlinks with a beautiful Terminal UI.
Manage your configuration files, systemd services, or nginx sites with ease. lnka provides an intuitive multi-select interface to enable/disable files by creating or removing symlinks.
lnka (pronounced "link-a") simplifies symlink management between directories. Think of it as a universal tool for the pattern used by nginx (sites-available β sites-enabled) and systemd (/lib/systemd/system β /etc/systemd/system).
Perfect for:
- π§ Managing nginx/apache site configurations
- βοΈ Enabling/disabling systemd services
- π Organizing dotfiles and config files
- π Any workflow involving symlinks between directories
Key Features:
- β¨ Beautiful interactive Terminal UI powered by Bubble Tea
- β‘ Fast async file loading
- π Built-in fuzzy search/filter
- π― Pre-selects currently enabled files
- π§Ή Automatic detection and cleanup of broken symlinks
- π Smart relative symlinks when possible
- β¨οΈ Vim-style keyboard navigation
# Install directly
brew install marco-arnold/lnka/lnka
# Or tap first, then install
brew tap marco-arnold/lnka
brew install lnkago install github.com/marco-arnold/lnka@latestDownload the latest release for your platform from the releases page.
git clone https://github.com/marco-arnold/lnka.git
cd lnka
go build -o lnkalnka <source-dir> <target-dir>Example: Managing nginx sites
lnka /etc/nginx/sites-available /etc/nginx/sites-enabledExample: Managing systemd services
lnka /lib/systemd/system /etc/systemd/system --title "System Services"Example: Dotfiles
lnka ~/dotfiles ~/.config# With custom title
lnka /path/to/source /path/to/target --title "My Configs"
lnka /path/to/source /path/to/target -t "My Configs"
# With debug logging
lnka /path/to/source /path/to/target --debug debug.log
# Show version
lnka --versionexport LNKA_TITLE="My Services"
lnka /path/to/source /path/to/target- Launch - Run lnka with your source and target directories
- Auto-detect - Broken symlinks? You'll be prompted to clean them
- Select - Interactive UI shows all files, with currently enabled files pre-selected
- Navigate - Use keyboard shortcuts to browse, filter, and select files
- Apply - Press Enter to create/remove symlinks based on your selection
- Done - Exit silently on success
| Key | Action |
|---|---|
Space |
Select/deselect item at cursor |
Enter |
Confirm selection and apply changes |
β/k β/j |
Navigate up/down (Vim-style) |
/ |
Enter filter mode (fuzzy search) |
h |
Toggle hide mode (show only linked items) |
? |
Toggle help (short/full) |
Ctrl+C |
Abort without changes |
| Key | Action |
|---|---|
g / G |
Jump to top/bottom |
PgUp/PgDn |
Page up/down |
Ctrl+B / Ctrl+F |
Page up/down (Vim-style) |
Ctrl+A |
Select all visible items |
Ctrl+D |
Deselect all items |
| Key | Action |
|---|---|
Type... |
Filter list (fuzzy search) |
Backspace |
Remove filter characters |
Enter |
Exit filter mode |
Esc |
Clear filter and exit filter mode |
lnka <source-dir> <target-dir>Both directories must exist. The tool will:
- Read available files from
<source-dir> - Create/remove symlinks in
<target-dir>
| Flag | Short | Description | Default |
|---|---|---|---|
--title |
-t |
Title displayed in UI | (empty) |
--debug |
-d |
Enable debug logging to file | (disabled) |
--version |
-v |
Show version information | - |
| Variable | Description |
|---|---|
LNKA_TITLE |
Default title for UI |
Enable/disable nginx virtual hosts:
# Interactive selection
sudo lnka /etc/nginx/sites-available /etc/nginx/sites-enabled -t "nginx Sites"
# Reload nginx after changes
sudo nginx -s reloadEnable/disable systemd services:
# System services
sudo lnka /lib/systemd/system /etc/systemd/system -t "Services"
# User services
lnka ~/.local/share/systemd/user ~/.config/systemd/user -t "User Services"
# Reload systemd after changes
sudo systemctl daemon-reloadOrganize your dotfiles:
# Create directory structure
mkdir -p ~/dotfiles/{bash,vim,git}
mv ~/.bashrc ~/dotfiles/bash/
mv ~/.vimrc ~/dotfiles/vim/
mv ~/.gitconfig ~/dotfiles/git/
# Manage symlinks
lnka ~/dotfiles/bash ~/
lnka ~/dotfiles/vim ~/
lnka ~/dotfiles/git ~/Similar to nginx:
sudo lnka /etc/apache2/sites-available /etc/apache2/sites-enabled -t "Apache Sites"
sudo systemctl reload apache2If you get permission errors when creating symlinks in system directories:
# Run with sudo
sudo lnka /etc/nginx/sites-available /etc/nginx/sites-enabledlnka automatically detects broken symlinks and offers to clean them:
$ lnka source target
Found 2 orphaned symlinks: old-site.conf, deprecated.conf
Clean orphaned symlinks? (Y/n): y
β Cleaned 2 orphaned symlinksEnable debug logging to troubleshoot issues:
lnka source target --debug debug.log
tail -f debug.log # View logs in real-time- Bubble Tea - Modern TUI framework
- Bubbles - TUI components
- Lipgloss - Terminal styling
- Cobra - CLI framework
- Async Loading: Files load asynchronously for instant startup
- Smart Symlinks: Creates relative paths when beneficial, absolute when necessary
- Safe Operations: Refuses to delete regular files, only removes symlinks
- Idempotent: Safe to run multiple times, won't duplicate or break existing setups
- Cross-Platform: Works on Linux, macOS, and Windows (with symlink support)
Contributions are welcome! Here's how you can help:
- π Report bugs via GitHub Issues
- π‘ Suggest features or improvements
- π Improve documentation
- π§ͺ Write tests
- π§ Submit pull requests
For development setup and guidelines, see CLAUDE.md.
Q: Can I use this with version-controlled config files? A: Absolutely! lnka works great with git-managed dotfiles or configs.
Q: What happens if I abort (Ctrl+C)? A: No changes are made. Your symlinks remain exactly as they were.
Q: Can I manage subdirectories? A: Currently, lnka only manages files in the top level of the source directory.
Q: Does it work on Windows? A: Yes, but you need Windows 10+ with Developer Mode enabled for symlink support.
Q: How do I update to the latest version?
A: If installed via Homebrew: brew upgrade lnka. Via Go: go install github.com/marco-arnold/lnka@latest
MIT License - see LICENSE for details
Made with β€οΈ using Bubble Tea
