Lux (package manager)

Jul 1, 2023    m. Apr 15, 2025

Lux is a modern package manger for lua offering many improvement over stagnant luarocks.

Install

Can only be installed through cargo at the moment

cargo install lux-cli --locked

Managing projects

lx new my-lua-project           # Initialize a project in a direcotry
lx add argparse@0.7             # Add dependency

Put some code in src/main.lua:

 1local argparse = require("argparse")
 2
 3-- Create an argument parser
 4local parser = argparse("script", "An example.")
 5parser:argument("input", "Input file.")
 6
 7local args = parser:parse()
 8
 9-- Directly print out the "input" argument
10print(args.input)

And run it:

lx run "Hi!"
Hi!

Goodies

You can enter lua REPL with project packages available with lx lua, lint project with lx check and format with lx fmt. More in the docs.



Next: Embedding