LUAP(1)

πŸ“¦
version 0.10 Β· 2 versions
, in nixpkgs unstable

πŸ’… LUAP(1) β€” hi bestie, this is the luap page

okay so real quick: this is a User Commands manual page for luap, and we're gonna get into it because honestly? it ate. ✨


🌸 NAME

luap β€” a Lua prompt with pretty-printing and autocompletion 🫢


✨ SYNOPSIS

luap [ -e STMT ] [ -l NAME ] [ -p ] [ -v ] [ -i ] [ -h ] [ <SCRIPT> ]
...

πŸ’– DESCRIPTION

okay so luaprompt is two things at once and both of them are iconic:

  1. an interactive Lua prompt you can use instead of the official interpreter, and
  2. a module that gives you a Lua command prompt you can embed in a host application πŸ‘‘

as a standalone interpreter it's got a whole bunch of conveniences the official Lua interpreter simply does not have (sorry to it). and as an embedded prompt, it's for apps that use Lua as a configuration or interface language β€” those apps can lowkey benefit from an interactive prompt for debugging or just regular use. fr fr.

luaprompt features (get ready, this is the good part):

  • Readline-based input with history and completion β€” specifically, all keywords, global variables and table accesses (with string or integer keys) can be completed on top of Readline's standard file completion. module names get completed too, for modules installed in the standard directories, and completed modules can optionally be loaded. the way that works is so satisfying ngl.
  • Persistent command history (retained across sessions πŸŽ€) plus recording of command results for future reference.
  • Proper value pretty-printing for interactive use β€” when you enter an expression at the prompt, all returned values are printed (no, you do not need to prepend an equal sign, we're not animals). values get printed in a descriptive way that tries to be as readable as possible. the formatting tries to mimic Lua code (this is done to minimize ambiguities and no guarantees are made that it is valid code β€” important, don't come for me). additionally, each value is stored in a table for future reference πŸ’œ.
  • Color highlighting of error messages and variable printouts 🌈.

luap tries to mimic the standard Lua interpreter as much as possible (currently only the -E flag is not supported 😭) while giving you the extra feature set above. all option arguments start with a single hyphen, followed by a letter. multiple consecutive options can be specified by their respective letters following a single hyphen.

anything that does not follow that format is interpreted as either:

  • a script file, which is to be executed (if it's the first non-option argument), or
  • an argument that gets passed to the script (for subsequent non-option arguments).

a single hyphen is interpreted as a request to execute the standard input. and if no options are passed, luap enters interactive mode, as if the -i option had been specified. main character energy honestly.

πŸŽ€ config vibes: a file with custom configuration, or startup actions, can be placed either at ~/.luaprc.lua, or alternatively at ~/.config/luaprc.lua. the first of these to be found is loaded and executed at startup.

πŸ”₯ OPTIONS

luap accepts the following options:

  • -e STMT β€” execute string STMT.
  • -l NAME β€” require library NAME.
  • -p β€” force plain, uncolored output (if you hate fun, or your terminal is being weird πŸ’€).
  • -v β€” print version information.
  • -i β€” enter interactive mode.
  • -h β€” show this help message and exit.
  • -- β€” stop processing arguments. the rest of the line is interpreted as a script file to execute, optionally followed by arguments that should be passed to the script.

πŸ¦‹ LuaJIT extras

when luap is used with LuaJIT, the following additional arguments are also understood:

  • -j CMD β€” perform LuaJIT control command.
  • -O OPT β€” control LuaJIT optimizations.

🧚 CONFIGURATION

luaprompt's β€” and subsequently luap's β€” functionality can be customized at build-time. see the documentation accompanying the source code for more details πŸ‘€.

additionally, you can customize luap's command line interface, since it's based on GNU Readline. that includes the ability to change behavior (like how completion is performed), define additional keybindings or redefine existing ones, define custom macros, and other possibilities. so it's highly recommended you consult readline(3) for more info β€” like, genuinely, go read it πŸ“–.

πŸ’‘ note that luaprompt sets its application name, so you can have custom Readline configuration that'll be effective for luaprompt only β€” thus not affecting every other Readline-enabled application on your system. you get that with $if ... $endif conditional constructs inside Readline's initialization file. again: see readline(3) πŸ’….

⭐ SEE ALSO

lua(1), luac(1), readline(3)


πŸ‘‘ AUTHOR

Dimitris Papavasileiou (dpapavas@protonmail.ch), Boris Nagaev β€” absolute legends, we stan 🫢


πŸ™ˆ REPORTING BUGS

please report bugs at the luaprompt home page at https://github.com/dpapavas/luaprompt β€” they'd love that, no cap πŸ›πŸ’–


okay that's the whole page!! this was luap 0.10, from 2 Aug 2026, and the original file signs off as LUAP(1) β€” mwah, slay, periodt βœ¨πŸŽ€πŸ’