Lipi is a Domain-Specific Language (DSL) designed to simplify system administration scripting on UNIX/Linux systems. It provides concise, readable functions for common tasks like package installation, file management, and user input, with built-in package management via ~/.config/lipi/packages.edn.
Repository: https://github.com/biutthapa/lipi
To install Lipi on your system:
- Run the installation script:
curl -sL https://raw.githubusercontent.com/biutthapa/lipi/main/install-lipi.sh | bash - Source your
~/.bashrcto update the PATH:source ~/.bashrc
This installs Babashka and sets up the lipi command.
Write scripts with the .lipi extension and run them with:
lipi script.lipiScripts must start with:
#!/usr/bin/env lipi
(require '[lipi.core :as lipi])See examples/setup.lipi for a complete example.
Lipi tracks installed packages in ~/.config/lipi/packages.edn, an EDN map where each key is a package name (keyword), and the value is a map with :method and :version.
Example:
{:stow {:method :apt :version "2.3.1"}
:emacs-next {:method :guix :version "1.6"}}Lipi provides a CLI for managing packages:
lipi install <method> <package>: Install a package using the specified method (e.g.,apt,guix,brew,snap).lipi install apt stowlipi remove <package>: Remove a managed package.lipi remove stowlipi upgrade <package>: Upgrade a managed package.lipi upgrade emacs-next
Note: remove and upgrade work only on packages listed in ~/.config/lipi/packages.edn.
(lipi/lipi-install method-kw package-str): Install and track a package.(lipi/lipi-remove package-str): Remove a tracked package.(lipi/lipi-upgrade package-str): Upgrade a tracked package.(lipi/sh & args): Run a shell command.(lipi/read-with-timeout seconds default): Read input with a timeout.
Check src/lipi/core.clj for all functions.
#!/usr/bin/env lipi
(require '[lipi.core :as lipi])
(lipi/lipi-install :apt "stow")
(lipi/sh "stow .files")Fork this repo, make changes, and submit a pull request. Issues and suggestions are welcome!
MIT License. See LICENSE (to be added).