⚙️ Installation
The preferred way of installing Lune is using Aftman.
This will add lune to an aftman.toml file in the current directory, or create one if it does not exist:
You can also download pre-built binaries for most systems directly from the GitHub Releases page.
✏️ Writing Lune Scripts
Check out the examples on how to write a script in the .lune folder ! A great starting point and walkthrough of Lune can be found in the Hello, Lune example.
type console =
type fs =
type net =
type process =
type task =
#!/bin/bash
VALID=true
COUNT=1
while [
do
if [;
then
break
fi
done
With Lune & Luau:
local valid = true
local count = 1
while valid
Lune puts developer experience first, and as such provides type definitions and configurations for several tools out of the box.
- Use
lune --download-luau-typesto download Luau types (luneTypes.d.luau) to the current directory - Set your definition files setting to include
luneTypes.d.luau - Set the require mode setting to
relativeToFile
An example of these settings can be found in the .vscode folder in this repository
- Use
lune --download-selene-typesto download Selene types (lune.yml) to the current directory - Use either
std = "luau+lune", orstd = "roblox+lune"if your project also contains Roblox-specific code, in yourselene.tomlconfiguration file
NOTE: It is highly recommended to add any type definition files to your .gitignore and to only download them using these commands, since this guarantees that you have type definitions compatible with your installed version of Lune.
🏃 Running Lune Scripts
After you've written a script file, for example script-name.luau, you can run it:
This will look for the file script-name.luau in a few locations:
- The current directory
- The folder
lunein the current directory, if it exists - The folder
.lunein the current directory, if it exists
If you don't want Lune to look in sub-directories you can provide a full file path with the file extension included, instead of only the file name.
💭 Additional Commands
Lists all scripts found in lune or .lune directories, including any top-level description comments.
Lune description comments are always written at the top of a file and start with a lua-style comment arrow (-->).
NOTE: Lune also supports files with the .lua extension but using the .luau extension is highly recommended.