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

# Libs & require()

`require("name")` works in any script, but resolves the module in three different places, in this order:

1. **Cloud libs** — installed/enabled in the overlay's **Libs** tab. The code never touches disk: it's loaded straight from RAM by a custom `package.searchers` entry (see [libs](/0x29a-docs/data-and-platform/libs.md)).
2. **Local scripts** — `basedir/scripts/*.lua`.
3. **Local libs you wrote yourself** — `basedir/libs/local/*.lua`.

```lua
local mylib = require("aim_math")   -- resolves as a cloud lib, if installed
```

## Checking a cloud lib's state

```lua
if libs.is_enabled("aim_math") then
    local m = require("aim_math")
end
```

If the lib exists but is **disabled**, `require` raises a clear error (`"lib 'x' esta desligada (ative na aba Libs)"`) instead of silently failing — wrap it in `pcall` if your script should degrade gracefully.

## Local libs vs. cloud libs

Local libs (`basedir/libs/local/*.lua`) are plain files on disk — `libs.list_local()` and `libs.local_dir()` only exist to inspect them, they are already resolved by Lua's default searchers via `package.path` (set up automatically by the bootstrap). They have no enable/disable concept like cloud libs do.

See the full reference in [libs](/0x29a-docs/data-and-platform/libs.md).


---

# 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://0x29a.gitbook.io/0x29a-docs/introduction/libs.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.
