About oxlib
oxlib is a skill for using the shared ox_lib library in FiveM resources. It guides Lua implementation of UI, callbacks, commands and zones, with explicit client/server placement and setup requirements.
Key features
- 01Notifications, dialogs and menus
- 02Progress UI and TextUI
- 03Client-server callbacks
- 04Typed server commands
- 05Client-side zones and keybinds
- 06Setup and module-loading guidance
Use cases
- 01Add notifications or input dialogs to a resource
- 02Request data between client and server
- 03Create permission-restricted commands
- 04Trigger behavior when a player enters or leaves an area
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ germanfndez/ fiveai-skills --skill oxlibAfter installing, type/oxlibin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
rules/addCommand.mdcallback.mdinit.mdinterface.mdzones.mdDetails
From the project READMEox_lib
Shared FiveM library: UI (notify, dialogs, menus, progress), client/server callbacks, commands and zones via the global lib.
Activation Contract
Load this skill when the user needs notifications, alert or input dialogs, menus, progress bars, TextUI, a client-server request/response, a typed server command, zones ("player enters/leaves area"), keybinds, or any resource that depends on ox_lib.
Hard Rules
- Add
shared_scripts { '@ox_lib/init.lua' }tofxmanifest.luaand ensureox_libstarts before the resource; without itlibis nil. - Prefer
lib.callback/lib.callback.awaitover paired events or framework-specific callbacks for data across the network. lib.callback.register(name, function(source, ...))on the server receivessourcefirst; validate arguments there.- Callback names must be unique (
resourcename:action). - UI functions (
lib.notify,lib.alertDialog,lib.inputDialog,lib.progress,lib.context,lib.menu,lib.showTextUI) render on the CLIENT; from the server trigger the client to call them. - Icons are Font Awesome 6, default style
solid; brand icons use{'fab', 'name'}. lib.addCommandis SERVER-side; userestrictedfor permissions and typedparams(number,playerId,string,longString).- Zones:
onEnter,onExitandinsidedo not work on the server; create zones on the client. Keep the returned zone to callzone:remove(). - Modules load on first use or via
ox_libs { ... }/lib.require.
Decision Gates
| Need | Call |
|---|---|
| Toast message | lib.notify({ title, description, type }) |
| Confirm / OK dialog | lib.alertDialog({ header, content, centered, cancel }) |
| Form input | lib.inputDialog(title, rows) |
| Client asks server | lib.callback.await(name, false, ...) + server lib.callback.register |
| Server asks client | lib.callback.await(name, source, ...) + client lib.callback.register |
| Chat command with args | lib.addCommand(name, { help, params, restricted }, cb) |
| Area trigger | lib.zones.poly / lib.zones.box / lib.zones.sphere |
Execution Steps
- Add the manifest line and start order (read rules/init.md).
- Pick the call from Decision Gates; read the matching rules file for the option table.
- Put request handling on the server callback; put UI on the client.
- Name callbacks and commands with the resource prefix.
- Store zone handles for removal.
Output Contract
Return runnable Lua using the global lib, with the manifest line when the resource is new and the client/server side explicit.
References
- rules/init.md — fxmanifest, shared_script, ox_libs, lib.require.
- rules/callback.md — lib.callback, await, register on both sides.
- rules/interface.md — notify, alertDialog, inputDialog, other UI modules, icons.
- rules/addCommand.md — server commands with help, params, restricted.
- rules/zones.md — poly, box, sphere zones, methods and utilities.
Upstream docs: https://overextended.dev/ox_lib