Skip to content

Dev Tools

Tools available in development mode to accelerate module development.

Enabling Dev Mode

In shiva.config.lua:

lua
Shiva.devMode = true

Or via ConVar:

ini
set SHIVA_DEV "true"

Hot Reload

With dev mode enabled, changes to Lua files trigger an automatic resource restart:

bash
shiva watch my-module     # watch and reload on change

The Dev Panel

Access the in-game dev panel with F7 (default keybind):

  • View all loaded modules and their status
  • Inspect the container's bound contracts
  • View live event bus traffic
  • Trigger events manually
  • View the current player's state (job, inventory, accounts)

Console Commands (Dev Mode Only)

/shiva modules          -- list all modules and their status
/shiva contracts        -- list all bound contracts
/shiva events           -- dump recent event bus activity
/shiva reload <module>  -- hot-reload a specific module
/shiva state            -- dump current player state

Log Levels

In dev mode, Log outputs at all levels. In production, only warn and error are shown by default.

lua
Log.debug('This only shows in dev mode')
Log.info('General info')
Log.warn('Something unexpected but recoverable')
Log.error('Something went wrong', { context = data })

Change the log level in config:

lua
Config.logLevel = 'debug'  -- 'debug' | 'info' | 'warn' | 'error'

shiva-test Watch Mode

Run tests in watch mode while developing:

bash
shiva test --watch

Tests re-run automatically when you save a file.

See Also

Released under the MIT License.