LUA VERSION MANAGER — SHELL

QLuV
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
- 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`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`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`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`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()`.
- 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()`.
CONCEPTS
CONFIGURATION
| Option | Default | What it does |
|---|---|---|
__qluv_VERSION | 1.0.0 | QLuV's own version string, printed by `qluv version` |
__qluv_QLUV_DIR | ${HOME}/.qluv | Root directory for all qluv-managed installs and state |
__qluv_LUA_DIR | ${HOME}/.qluv/lua | Install prefix root for Lua versions |
__qluv_LUAJIT_DIR | ${HOME}/.qluv/luajit | Install prefix root for LuaJIT versions |
__qluv_LUAROCKS_DIR | ${HOME}/.qluv/luarocks | Install prefix root for LuaRocks versions |
__qluv_LUA_DEFAULT_FILE | ${HOME}/.qluv/DEFAULT_LUA | File whose contents name the default Lua version applied at init |
__qluv_LUAJIT_DEFAULT_FILE | ${HOME}/.qluv/DEFAULT_LUAJIT | File whose contents name the default LuaJIT version applied at init |
__qluv_LUAROCKS_DEFAULT_FILE | ${HOME}/.qluv/DEFAULT_LUAROCKS | File whose contents name the default LuaRocks version applied at init |
CONTROLS
| Action | Control |
|---|---|
| Show usage | qluv help |
| Install Lua | qluv install <version> |
| Switch Lua | qluv use <version> |
| Set / unset default Lua | qluv set-default <version>` / `qluv unset-default |
| Uninstall Lua | qluv uninstall <version> |
| List Lua versions (`-r` = remote) | qluv list [-r] |
| Install LuaJIT | qluv install-luajit <version> |
| Switch LuaJIT | qluv use-luajit <version> |
| Set / unset default LuaJIT | qluv set-default-luajit <version>` / `qluv unset-default-luajit |
| Uninstall LuaJIT | qluv uninstall-luajit <version> |
| List LuaJIT versions | qluv list-luajit [-r] |
| Install LuaRocks | qluv install-luarocks <version> |
| Switch LuaRocks | qluv use-luarocks <version> |
| Set / unset default LuaRocks | qluv set-default-luarocks <version>` / `qluv unset-default-luarocks |
| Uninstall LuaRocks | qluv uninstall-luarocks <version> |
| List LuaRocks versions | qluv list-luarocks [-r] |
| Show versions in use | qluv current |
| Show QLuV version | qluv 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
- Lua — the Lua project's homeThe source tarballs QLuV downloads, compiles and installs per version under ~/.qluv/lua.
- LuaJIT — the LuaJIT project's homeThe second toolchain QLuV installs and switches alongside Lua, under ~/.qluv/luajit.
- LuaRocks — the Lua package managerThe third toolchain QLuV manages, under ~/.qluv/luarocks, configured against the current Lua (switching it also evaluates luarocks path).