A standalone, cross-platform package manager for LSP and DAP servers, linters, and formatters. It installs from the Mason registry without depending on Neovim or any specific editor.
Version: Beta 1.0.
A long time ago I primarily used Neovim for coding, and I used Mason for installing the tools I needed.
Now, I use Helix, and now I am unable to use Mason again for installing those tools.
From this pain, lspctl was born, with the goal of providing a single and standardized way for installing
LSP and DAP servers, linters and formatters for any editor, by exposing a single binary for each
installed tool to be used by your editor.
lspctl was chosen to mirror the name of systemd's command systemctl,
which controls the running services, but it's for controlling the installation of
LSP and DAP servers, linters, and formatters.
lspctl is under active development, with core operations such as install, remove, list and search
working reliably, with them having been tested across several packages from the registry, across many different situations.
Most of the packages are already supported; see the table below for the current state of the implementation:
- CLI
- TUI
- GUI
- Install packages
- Remove packages
- List packages
- Search packages
- Info about packages
- Delete data
- Registry version manipulation
- Synchronize packages to registry
- npm
- Go
- Cargo
- NuGet
- Gem
- PyPI
- LuaRocks
- Composer
- Opam
- GitHub Assets
- Download
- Build
# install one or more packages
lspctl install gopls rust-analyzer
lspctl i gopls rust-analyzer # short alias
# remove one or more packages
lspctl remove gopls
lspctl remove --all # remove everything installed
# list packages
lspctl list # everything in the registry
lspctl list --installed # only what's installed
lspctl list --verbose # multi-line detail per package
# search by name (regex)
lspctl search '^rust'
lspctl search debug --installed
# skip confirmation prompts
lspctl install gopls --yesFor more information, run lspctl --help.
The source of truth for lspctl is the Mason registry.
Everything it does is described there.
A quick summary of the steps:
- The registry is fetched from the GitHub Releases, and cached locally as a JSON file;
- The package definitions use a small DSL for templating, so
lspctlhas an embedded parser for them. It lexes, parses and evaluates the expressions to generate a ready-to-use registry to be used to install your packages; lspctlscans all the entries of the packages you want to install and selects the most specific one that matches your system;- All steps are done atomically. Installation is done in a temporary folder first, and then moved atomically to its final location. When removing packages it also performs the action atomically. This is done to prevent half states.
- Some packages need shims, which are small wrapper scripts that run the installed tool for you, in case it doesn't have an executable file ready to be used;
lspctlkeeps a file lock to prevent two or more instances from running at the same time.
Requires a recent Rust toolchain (1.89+).
git clone https://github.com/JuniorBecari10/lspctl
cd lspctl
cargo build --releaseLinux (or any Unix-like OS), macOS and Windows. It does platform-specific behavior for each one of them, so that the installed tool runs flawlessly. All of them should be supported, though all the testing so far has been done on Linux.
Contributions are welcome. You can do so by doing Pull Requests and opening Issues.
If you notice any undesirable behavior, please don't hesitate and open an Issue about it.
By doing so, you will help making lspctl better for everyone.
See LICENSE.