CLI commands
CLIOn this page
The installer places dislua and discordlua on PATH. Both names invoke the same CLI.
dislua run <file>
Start a bot script on the embedded Lua 5.4 runtime.
Syntax
dislua run <file>Arguments
| Argument | Description |
|---|---|
file | Path to a Lua script, relative to the working directory. |
Example
dislua run bot.luaOutput
The process stays running while the Gateway session is open. Logs print to stdout.
Errors
Exits 1 if the file is missing, Lua raises, or login/network fails without being handled.
dislua init [bot.lua]
Write a starter bot.lua in the current directory.
Syntax
dislua init [bot.lua]Arguments
| Argument | Description |
|---|---|
bot.lua | Optional output path. Defaults to bot.lua in the current folder. |
Example
dislua initOutput
Creates the file and prints its path.
Errors
Exits 1 if the target already exists or the directory is not writable.
dislua version
Print runtime, CLI, and module versions.
Syntax
dislua versionArguments
No arguments.
Example
dislua versionOutput
Version lines for runtime, CLI, installer, and Discord module.
Errors
Exits 0 on success.
dislua check-update
Compare the installed package to the published version manifest.
Syntax
dislua check-updateArguments
No arguments.
Example
dislua check-updateOutput
Reports whether an update is available and the published version.
Errors
Exits 1 if the manifest URL cannot be fetched.
dislua update
Download DiscordLua-Setup.exe and open the launcher, or replace the runtime when the launcher is already current.
Syntax
dislua updateArguments
No arguments.
Example
dislua updateOutput
If the launcher is below 1.1.0, downloads Setup and opens the GUI. Otherwise downloads the runtime when a newer package is published.
Errors
Exits 1 if the checksum mismatches, HTTPS is unavailable, or Setup cannot be started. Close bots first.
dislua doctor
Print install paths and check Lua, JSON, network, and crypto.
Syntax
dislua doctorArguments
No arguments.
Example
dislua doctorOutput
EXE path, install root, module path, and a pass/fail line for each check.
Errors
Exits 1 if a required check fails.
dislua help
Show CLI usage.
Syntax
dislua helpArguments
No arguments.
Example
dislua helpOutput
Command list and short descriptions. discordlua is an alias of dislua.
Errors
Exits 0.
dislua audit
Run the in-tree compatibility audit script. Source checkout only.
Syntax
dislua auditArguments
No arguments.
Example
dislua auditOutput
Audit results for the DiscordLua module surface.
Errors
Exits 1 if the audit script is not present (installed packages) or the audit fails.
Exit codes
0 success. 1 runtime, config, or network failure. Errors print a structured message with module and function.