Crates.io | slot-cli |
lib.rs | slot-cli |
version | 0.1.0 |
source | src |
created_at | 2024-09-13 22:41:56.174702 |
updated_at | 2024-09-14 17:50:57.342373 |
description | slot - A symbolic link organizer with toml. |
homepage | |
repository | https://github.com/cristianoliveira/slot |
max_upload_size | |
id | 1374208 |
size | 44,367 |
slot is a lightweight command-line tool for managing symbolic links in your filesystem inspired by stow
.
Because GNU stow does almost what I wanted, but not quite. I wanted a simpler tool that could manage symlinks for multiple packages independent of the source file structure, using a flat configuration. I also need to be able to toogle links on demand to apply different configs.
Create the slot.toml
in the current directory
[packages]
nvim = { source = "./examples/source/nvim", target = "./examples/target/nvim" }
zsh = { source = "./examples/source/zshrc", target = "./examples/target/.zshrc" }
And run
slot link
Linking packages
nvim: ./examples/target/nvim (new link)
zsh: ./examples/target/.zshrc (new link)
ls -la examples/target [1:00:35]
total 0
drwxr-xr-x 4 cris 128 Sep 14 01:00 .
drwxr-xr-x 5 cris 160 Sep 14 01:00 ..
lrwxr-xr-x 1 cris 58 Sep 14 01:00 .zshrc -> /home/cris/slot/./examples/source/zshrc
lrwxr-xr-x 1 cris 57 Sep 14 01:00 nvim -> /home/cris/slot/./examples/source/nvim
cr
You can install Slot using Cargo:
cargo install slot-cli
The Slot CLI allows you to install, remove, and check symlinks based on a TOML configuration file.
link
: Create symbolic links for the specified packages.unlink
: Remove symbolic links for the specified packages.status
: Check the status of symbolic links.list
: Display all available packages from the TOML configuration.-c --config <file>
: Specify a custom TOML configuration file (default: ./slot.toml
).--help
: Display help information.To create symlinks for all packages defined in slot.toml
:
slot link
To link symlinks for specific packages:
slot link package1 package2
To remove symlinks for all packages:
slot unlink
To unlink specific packages:
slot unlink package1
To check the status of all symlinks:
slot status
# OR
slot status package1 package2
To list all available packages from the TOML configuration:
slot list
For more detailed command usage, run:
slot --help
The configuration is defined in a slot.toml
file. It specifies the source directories for your packages and where the symlinks should be created.
slot.toml
:[packages.package1]
source = "path/to/package1"
target = "/usr/local/bin"
[packages.package2]
source = "path/to/package2"
target = "/home/user/.config"
[packages.package3]
source = "path/to/package3"
target = "/opt/tools"
To build the project from source, you will need to have Rust installed on your system. You can then clone the repository and build the project using Cargo:
cargo build --release
To run the test suite, you can use the following command:
cargo test
The project uses rustfmt
for code formatting. You can run the following command to format the code:
cargo fmt
Slot is licensed under the MIT License.