Skip to main content
Every lua command that fails prints one typed line on stderr and exits with a code that names the class of failure. Start with lua status --json for the environment, credential source, project, and sync state; rerun the failing command with LUA_DEBUG=1 to print the stack trace; read runtime failures of deployed code with lua logs. Verified against lua-cli 3.33.0.

Error format

The line is βœ– <class>: <message>. A πŸ’‘ hint follows when the CLI knows the remedy, and a server validation refusal adds one indented β€’ line per issue between the two.
Output
Errors the option parser catches before the command runs, such as an unknown flag or a missing argument, print the parser’s own line instead, for example error: unknown option '--bogus', and exit 2. With LUA_DEBUG=1, or --debug anywhere on the line, the stack trace follows after a blank line:
Output
LUA_NO_HINTS=1 silences the ✨ Tip: lines after a successful command and the πŸ’‘ Diagnose: follow-ups under an error. The hint that explains the error itself is always printed.

Exit codes

Codes 4–8 are run outcomes and exist only on lua workflows and lua test workflow; every other command skips them, so a script never mistakes an expired key (9) for a canceled run (5). lua --help prints the same table.

Known exceptions

These commands depart from the table; a script that branches on the exit code needs the message as well.

JSON error envelope

The commands that accept --json and opt into the envelope (lua workflows, lua auth sessions, lua marketplace) print a failure on stdout as JSON instead of the typed line, so a script parses one shape whether the call succeeded or not:
code is the server’s discriminator when it sent one, otherwise the CLI class. statusCode and issues appear only when known. Other commands, including lua test --json, keep the typed line on stderr. The stack trace still goes to stderr when debug is on.

Common errors

Project and usage

Authentication

Compile, test, push, and deploy

Network and provider

Still stuck

Send [email protected] the command you ran, the full stderr output including the βœ– line, and the output of lua status --json --ci, which reports LUA_API_KEY only as set or not set. For failures inside deployed code that do not surface as CLI errors, see Troubleshooting.

See also