Lushell is a command-line shell that embeds the Lua programming language directly into the shell environment. It combines classic shell functionality with the power and flexibility of Lua scripting.
- Classic shell functionality
- Lua scripting support
- Extended Lua functions for system calls (written in C)
Lushell introduces a special file extension, .lsh, which ensures compatibility with its extended Lua functions. These functions make it easy to interact with the file system and environment directly from Lua scripts.
-
cd(path) -> boolean|nil, string|nil
Changes the current working directory to path.
Returns true on success, or nil and an error message on failure.
-
ls(path) -> table|nil
Returns a table of filenames in the directory, or
niland an error message on failure.
-
pwd() -> string
Returns the current working directory as a string.
-
mkdir(path) -> boolean
Creates a new directory at the given
path. Returnstrueon success, orfalseon failure. -
getenv(name) -> string|nil
Gets the value of an environment variable, or
nilif not set. -
setenv(name, value) -> boolean
Sets an environment variable. Returns
trueon success, orfalseon failure. -
rm(path) -> boolean|nil, string|nil
Removes a file at the given
path. Returnstrueon success, orniland an error message on failure. -
glob(pattern) -> table|nil, string|nil
Expands a wildcard pattern into a table of filenames. Returns the matches as a table, or
niland an error message if no matches are found.
Lushell is currently available only by building from source:
git clone https://github.com/BersisSe/lushell.git
cd lushell
make
make installYou can also uninstall with:
make uninstallAn installer package (like
.deb) is currently in the works.