LUA VERSION MANAGER — SHELL

QLuV

QLuV

Version 1.00Source on GitHub

OVERVIEW

QLuV is the Qompass Lua Version Manager: a shell script (with `qluv.fish` and `qluv.plugin.zsh` companions in the repo root) that installs, switches, defaults and uninstalls Lua, LuaJIT and LuaRocks versions side by side under `~/.qluv`.

HOW IT WORKS

  1. 1On load, `__qluv_init` creates the `~/.qluv` tree (`src`, `lua`, `luajit`, `luarocks`) if missing, then applies any saved defaults by reading the `DEFAULT_LUA`, `DEFAULT_LUAJIT` and `DEFAULT_LUAROCKS` files and switching to those versions. Source: GitHub qluv `qluv` script, `__qluv_init()`.
  2. 2`qluv install <version>` downloads the Lua tarball, unpacks it under the source directory, compiles it and installs it with `PREFIX` under `~/.qluv/lua/<version>`, then offers to switch to it; LuaJIT and LuaRocks installs follow the same download → compile → prefix-install pattern (`install-luajit` from luajit.org, `install-luarocks` from luarocks.org, configured against the current Lua). Source: GitHub qluv `qluv` script, `__qluv_install_lua()` / `__qluv_install_luajit()` / `__qluv_install_luarocks()`.
  3. 3`qluv use <version>` switches versions by removing previous `~/.qluv/.../bin` entries from `PATH` and prepending the selected version's `bin` directory; LuaRocks switching additionally evaluates `luarocks path`. Source: GitHub qluv `qluv` script, `__qluv_use_lua()` / `__qluv_use_luarocks()` / `__qluv_remove_previous_paths()` / `__qluv_append_path()`.
  4. 4`qluv set-default <version>` persists a choice by writing the version into the matching `DEFAULT_*` file, so `__qluv_init` re-applies it on the next shell load; `unset-default` removes that file. Source: GitHub qluv `qluv` script, `__qluv_set_default_*()` / `__qluv_unset_default_*()`.
  5. 5`qluv list [-r]` lists installed versions from the `~/.qluv` directories, or with `-r` fetches the remote release list (lua.org FTP for Lua, luarocks releases JSON for LuaRocks). Source: GitHub qluv `qluv` script, `__qluv_list_lua()` / `__qluv_list_luarocks()`.
  6. 6Downloads use `wget` if present, else `curl`, and fail with "'wget' or 'curl' must be installed" if neither exists; unpacking requires `tar`. Source: GitHub qluv `qluv` script, `__qluv_download()` / `__qluv_unpack()`.
How it works, step by step — each step as the project's own documentation states it.

CONCEPTS

SIDE-BY-SIDE VERSIONS UNDER ~/.qluv~/.qluvlua/ — one directory per versionluajit/ — one directory per versionluarocks/ — one directory per versionsrc/ — downloaded tarballsDEFAULT_LUA · DEFAULT_LUAJITDEFAULT_LUAROCKS — saved defaultsqluv use <version>switch the active versionPATH IS REWRITTENprevious ~/.qluv bin entries removed,selected version's bin/ prependedlua RESOLVES TO THE SELECTED INSTALLwhichever bin/ sits first on PATHinstall: download → compile → PREFIX-install under ~/.qluv/lua/<version> (likewise luajit/ and luarocks/)set-default writes the DEFAULT_* file — __qluv_init re-applies it on the next shell loadEVERY VERSION STAYS INSTALLED — SWITCHING ONLY REORDERS PATH
QLuV's version store and selection mechanism, from the qluv script itself: Lua, LuaJIT and LuaRocks versions install side by side under ~/.qluv, use switches the active version by rewriting PATH to put the selected version's bin directory first, and set-default persists the choice in a DEFAULT_* file that init re-applies on shell load. There is no shim — selection is PATH order.

CONFIGURATION

OptionDefaultWhat it does
__qluv_VERSION1.0.0QLuV's own version string, printed by `qluv version`
__qluv_QLUV_DIR${HOME}/.qluvRoot directory for all qluv-managed installs and state
__qluv_LUA_DIR${HOME}/.qluv/luaInstall prefix root for Lua versions
__qluv_LUAJIT_DIR${HOME}/.qluv/luajitInstall prefix root for LuaJIT versions
__qluv_LUAROCKS_DIR${HOME}/.qluv/luarocksInstall prefix root for LuaRocks versions
__qluv_LUA_DEFAULT_FILE${HOME}/.qluv/DEFAULT_LUAFile whose contents name the default Lua version applied at init
__qluv_LUAJIT_DEFAULT_FILE${HOME}/.qluv/DEFAULT_LUAJITFile whose contents name the default LuaJIT version applied at init
__qluv_LUAROCKS_DEFAULT_FILE${HOME}/.qluv/DEFAULT_LUAROCKSFile whose contents name the default LuaRocks version applied at init

CONTROLS

ActionControl
Show usageqluv help
Install Luaqluv install <version>
Switch Luaqluv use <version>
Set / unset default Luaqluv set-default <version>` / `qluv unset-default
Uninstall Luaqluv uninstall <version>
List Lua versions (`-r` = remote)qluv list [-r]
Install LuaJITqluv install-luajit <version>
Switch LuaJITqluv use-luajit <version>
Set / unset default LuaJITqluv set-default-luajit <version>` / `qluv unset-default-luajit
Uninstall LuaJITqluv uninstall-luajit <version>
List LuaJIT versionsqluv list-luajit [-r]
Install LuaRocksqluv install-luarocks <version>
Switch LuaRocksqluv use-luarocks <version>
Set / unset default LuaRocksqluv set-default-luarocks <version>` / `qluv unset-default-luarocks
Uninstall LuaRocksqluv uninstall-luarocks <version>
List LuaRocks versionsqluv list-luarocks [-r]
Show versions in useqluv current
Show QLuV versionqluv version

NOT COVERED

- The GitHub README contains no QLuV-specific installation, usage or configuration documentation at all: after the title/badges, its only functional section is the shared Qompass Quick Start, which is the dotfiles repo's script, not QLuV's. Every HOW/CONFIG/CONTROLS row above is sourced from the `qluv` script itself (its header, constants, usage text and function bodies), not from the README. - No user-facing configuration file, environment variable or option is documented or defined in the sources read; the CONFIG rows are the script's internal `__qluv_*` constants and state-file paths, which a user changes only via the `set-default` commands. - Shell integration specifics (how `qluv`, `qluv.fish` and `qluv.plugin.zsh` are sourced/installed — an `install.sh` exists in the repo root) were not sourced in detail; no install command for QLuV itself is claimed here. - One remote-list source in the script (`__qluv_list_luajit` fetching `https://luajits.org/download.html`) is transcribed as written in the code; its correctness was not verified.

REFERENCES

  1. Lua — the Lua project's homeThe source tarballs QLuV downloads, compiles and installs per version under ~/.qluv/lua.
  2. LuaJIT — the LuaJIT project's homeThe second toolchain QLuV installs and switches alongside Lua, under ~/.qluv/luajit.
  3. LuaRocks — the Lua package managerThe third toolchain QLuV manages, under ~/.qluv/luarocks, configured against the current Lua (switching it also evaluates luarocks path).