CLI
CLIOn this page
dislua runs Lua scripts, scaffolds a starter bot, reports versions, and updates the installed package.
Installation
Install with DiscordLua-Setup.exe (GUI launcher 1.1.0), then open a new terminal so dislua is on PATH. Confirm with dislua version.
Commands
Full syntax, arguments, output, and errors live on the commands page.
- dislua run <file>
- dislua init [bot.lua]
- dislua version
- dislua check-update
- dislua update
- dislua doctor
- dislua help
- dislua audit
Configuration
Environment variables the CLI and runtime read. See also the configuration page.
| Variable | Purpose |
|---|---|
DISCORD_TOKEN | Bot token for client:login and shard children. |
MYLUA_MODULE_PATH | Override on-disk module root. Disk modules win over the embedded copies. |
MYLUA_LOG | Log level (debug, info, and other native levels). |
DISCORDLUA_UPDATE_API | Override the version manifest URL. |
DISCORDLUA_SHARD_ID / DISCORDLUA_SHARD_COUNT | Identify shard fields for child processes. |
Updating
CLI 1.1.0 requires launcher 1.1.0. dislua update downloads DiscordLua-Setup.exe from the version API and opens the launcher. You do not need to open the docs site. Older command-line Setup installs are blocked until that update finishes.
dislua check-update
dislua updateThe launcher can also install, reinstall, or uninstall with determinate progress. Direct download: DiscordLua-Setup.exe.
Troubleshooting
dislua doctorprints EXE, install, and module paths.- If
require("discord")fails, setMYLUA_MODULE_PATHor re-run setup so modules are extracted next to the install root. - Updates require HTTPS (or localhost) download URLs.
- Close running bots before
dislua updatereplaces the EXE.