> For the complete documentation index, see [llms.txt](https://dirkscripts.gitbook.io/dirkscripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dirkscripts.gitbook.io/dirkscripts-documentation/resources/dirk-lib.md).

# Library

`dirk_lib` is the shared foundation for all DirkScripts resources. It automatically detects your framework, inventory, targeting, and other resources, then provides a single consistent API that works across all of them.

***

## Why dirk\_lib?

* **Zero config** — Auto-detects ESX, QBCore, QBX, and 60+ other resources on startup.
* **One API** — Write `lib.inventory.addItem(...)` and it works with ox\_inventory, qb-inventory, dirk\_inventory, and more.
* **Lazy-loaded modules** — Only loads what you use. No bloat.
* **Built-in UI** — Notifications, context menus, progress bars, dialogs, input prompts, text UI, and more.
* **In-game config** — JSON Schema-based settings system with database persistence, change history, and NUI admin panels.
* **Developer tools** — Polygon creator, entity placer, position grabber, model viewer — all via `/devtools`.
* **Cache system** — Auto-tracks player ped, vehicle, weapon, job, gang, and more with change listeners.
* **ox\_lib compatible** — Drop-in replacement for ox\_lib exports. Scripts using ox\_lib work without changes.

***

## Supported Resources

`dirk_lib` bridges across **14 systems** with support for **60+ resources** including:

| System        | Examples                                                                                                                          |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **Framework** | es\_extended, qbx\_core, qb-core, pork\_core                                                                                      |
| **Inventory** | dirk\_inventory, ox\_inventory, qb-inventory, qs-inventory, codem-inventory, core\_inventory, tgiann-inventory, origen\_inventory |
| **Target**    | ox\_target, qb-target, qtarget                                                                                                    |
| **Interact**  | sleepless\_interact                                                                                                               |
| **Keys**      | qb-vehiclekeys, wasabi\_carlock, Renewed-Vehiclekeys, and 10+ more                                                                |
| **Fuel**      | LegacyFuel, ox\_fuel, cdn-fuel, and 8+ more                                                                                       |

[**Full list of supported resources →**](https://github.com/DirkDigglerz/dirk_lib/blob/main/src/autodetect.lua)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dirkscripts.gitbook.io/dirkscripts-documentation/resources/dirk-lib.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
