The Core Problem
A common debugging mistake is deploying five times to fix the same bug, when a single log line plus one deployment would have shown you the root cause immediately. If you’re patching against test failures rather than the actual return shape, stop and add aconsole.log first — then deploy once.
The 5-Step Debug Loop
Add a console.log to the suspicious spot
Log the actual value — not a guess, the real thing:Log the entire object so you see the actual shape, not what you assumed it would be.
Push to sandbox (not production)
lua chat compiles and uses your local code directly. Use this for rapid iteration before committing to a push.Send ONE test message
Check logs immediately
console.log output appears in the log message body. Look for the 🔍 DEBUG or ℹ️ INFO entries — they contain your logged values.Example output:Suppressing CLI hints
All post-action hints can be silenced with:LUA_NO_HINTS=true (or yes) in your shell profile or CI environment to disable hints globally. This is useful in CI/CD pipelines that capture only command output.
Reading lua logs Output
Log entry anatomy
| Field | Meaning |
|---|---|
| Icon + timestamp | When the log was created |
| Log type | ERROR, WARN, DEBUG, INFO, START, COMPLETE |
| Skill/Tool Name | Which component ran |
| Duration | Execution time in ms |
| Message | The actual log content (your console.log output) |
Log types
| Type | Color | Means |
|---|---|---|
| ❌ ERROR | Red | Tool threw an exception — check the stack trace |
| ⚠️ WARN | Yellow | Non-fatal issue, tool continued |
| 🔍 DEBUG | Blue | console.log output from your tool code |
| ℹ️ INFO | Cyan | Operational status messages |
| ▶️ START | Green | Tool execution began |
| ✅ COMPLETE | Green | Tool execution finished successfully |
Filter by component type
When to Use lua test vs lua chat vs lua logs
| Goal | Use |
|---|---|
| Test a tool with exact input before touching the server | lua test |
| Test a conversational flow, verify the AI calls the right tools | lua chat (sandbox) |
| See what actually ran in production | lua logs --type skill |
| Debug why an API call returned unexpected data | console.log + push + lua logs |
| Check if a job actually ran and what it returned | lua logs --type job --name my-job |
| Verify a webhook received and processed correctly | lua logs --type webhook |
console.log Debugging Patterns
Log a full API return value
Log individual entries
Log before and after transformation
Common Bugs and How to Spot Them
Bug: results.data is undefined (Data.search)
results.data would be undefined — there is no .data wrapper on the array. Use results[0].data.title for the entry payload, or results[0].title via the Proxy shortcut.
Bug: entry.title is undefined (Data.get)
entry.title would be undefined — Data.get entries are raw, not proxied. Use entry.data.title.
Bug: products.data is undefined (Products.search)
results.data doesn’t exist on ProductSearchInstance. Use results.products or results.map(p => p.name).
Removing Debug Logs Before Production
Once the bug is fixed, clean up your logs. Production logs are visible to your whole team and consume log storage.Related
lua logs Command
Full reference for the logs command and all filter options
lua test Command
Test tools locally before pushing
Data API
Data API return shapes reference
Troubleshooting
Common errors and solutions

