# AI agents

How AI agents and LLM tools should read these docs (llms.txt, llms-full.txt and Markdown pages) and how to ask an AI for help without leaking keys.

Source: https://fivedash.fivex.gg/docs/en/developers/ai-agents

These docs were written for people and for AI agents. Every page also exists as plain Markdown, and there's an index and a single file with everything, in the `llms.txt` format. That way you can hand the right docs to ChatGPT, Claude, Cursor or any agent, and ask for help setting up your city without the AI making up exports or options that don't exist.

[Video: how to do it in under 20 seconds](https://fivedash.fivex.gg/docs/videos/docs-agents-en.mp4)

## Before you start

* An AI or agent that can read links or files you paste.
* What you want to do, in one sentence (e.g. "swap my scripts' Discord webhooks for FiveDash logs").
* Never paste keys, tokens or secret links into the conversation. See the **Security** section below.

## The AI formats

| Address                          | What it has                                   | When to use                                                    |
| -------------------------------- | --------------------------------------------- | -------------------------------------------------------------- |
| `/docs/llms.txt`                 | The index: the list of doc pages, with links  | For the agent to find out what exists and pick what to read    |
| `/docs/<lang>/llms-full.txt`     | Every page of one language in a single file   | To give the whole context at once (tools with a large context) |
| `/docs/<lang>/<slug>.md`         | One page in Markdown                          | To give only the task's topic                                  |
| **Copy page as Markdown** button | The open page, in Markdown, on your clipboard | To paste straight into the chat                                |

`<lang>` is `pt` (Portuguese) or `en` (English). `<slug>` is the page's path, the same as its normal link. Examples:

```text
/docs/llms.txt
/docs/pt/llms-full.txt
/docs/en/llms-full.txt
/docs/en/developers/logs-api.md
/docs/en/developers/fivem-resource.md
/docs/en/getting-started/install-resource.md
```

Each page makes sense on its own: the key prerequisites are repeated on each, so an agent that reads only one `.md` has what it needs.

### Which one to pick

| Task                                                | Give the AI                                                              |
| --------------------------------------------------- | ------------------------------------------------------------------------ |
| Install and connect the resource                    | `getting-started/install-resource.md` and `developers/fivem-resource.md` |
| Wire a script to logs                               | `developers/exports-and-events.md` (and the script)                      |
| Swap Discord webhooks                               | `logs/migrate-from-webhooks.md` and `developers/logs-api.md`             |
| Send screenshots to the CDN                         | `developers/cdn-api.md`                                                  |
| Understand the whitelist or store on your framework | `developers/frameworks.md`                                               |
| General question or several areas                   | `llms-full.txt` in your language                                         |
| Don't know where to start                           | `llms.txt`, and ask the agent to choose                                  |

## How to ask an AI to help set up your city

The AI works on your city's files (scripts, `server.cfg`, `config.lua`). What happens in the FiveDash panel (generating the key, creating logs, creating CDN keys, connecting payments) is done by you, with your account.

| The AI can do                                                      | You do in the panel                                                           |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| Fix the `server.cfg` order (`ensure fivedash` after the framework) | Generate the server key (**Game connection → Connect server → Generate key**) |
| Write the `exports.fivedash:log(...)` calls in scripts             | Create each log and pick its **Key**                                          |
| Swap the Discord link for the log's link, leaving the rest alone   | Copy each log's link                                                          |
| Write the CDN upload (`screenshot-basic`, NUI, server)             | Create the upload key and pick the folder                                     |
| Explain a `[FiveDash]` console warning                             | Check the **Game connection** card and its warnings                           |

### Tips for the request

1. **Say what your base is:** framework (QBCore, Qbox, ESX, ox_core, Creative, vRP), the database driver (`oxmysql`…) and the inventory.
2. **Give the right page:** paste the task's `.md` or its link, and ask the AI to follow only what's written.
3. **Use example values:** instead of the key, write `fdk_xxxxxxxx`; instead of the log link, `https://<logs-address>/api/logs/<channelId>/<token>`. You paste the real values later, straight into the file.
4. **Ask for the changes only:** "show me which file and where each snippet goes". Review before pasting.
5. **Test in the console:** after the change, `restart` the script, `fivedash logs test <key>` and `fivedash` to see the state.

### Example requests

Wire a script to logs:

```text
Read https://fivedash.fivex.gg/docs/en/developers/exports-and-events.md
and follow only what it says.

My city runs QBCore with oxmysql. The fivedash resource is already installed.
I want to send to the log with the key "store-robbery" whenever someone robs
a store in this script (pasted below). Use player = source, put the stolen
amount in fields and create the fivedashLog function at the top of the file.
Show me the changes only.

<paste the script's server.lua here>
```

Swap Discord webhooks:

```text
Read https://fivedash.fivex.gg/docs/en/developers/logs-api.md.
This config.lua has Discord webhooks (discord.com/api/webhooks/...).
Replace each one with a LOG_URL_<NAME> placeholder so I can paste the
FiveDash links later. Don't change anything else.
```

Review the install:

```text
Read https://fivedash.fivex.gg/docs/en/developers/fivem-resource.md.
This is my server.cfg (without keys) and what the console printed on boot.
Tell me if the ensure order is right and what each [FiveDash] warning means.
```

> In the panel, every log has a **Copy AI prompt** button under **How to send**. It copies a ready-made request with that log's key, every export option and the safety rules. Just paste it into the AI along with the script.

## Security

> Never paste keys, tokens or secret links into an AI chat, a ticket or a screenshot. What goes into a conversation may be stored outside your control.

| Secret                          | How to spot it                                                             | If it leaks                                                |
| ------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------- |
| Server key                      | Starts with `fdk_` (in `fivedash/config.lua` or the `fivedash_key` convar) | **Server → Overview → Game connection → Generate new key** |
| A log's link                    | `…/api/logs/<channelId>/<token>`: the token is the password                | On the log, **Edit log → Generate new link**               |
| CDN upload key                  | Starts with `fdm_`                                                         | **CDN → Settings → Upload keys → Revoke**                  |
| Discord bot token, payment keys | In the **Discord** and **Store** modules                                   | Replace them at the provider and in the panel              |

Good practices:

* Replace real values with examples before pasting any file: `fdk_xxxxxxxx`, `fdm_xxxxxxxx`, `<token>`.
* Ask the AI to read the key from a convar or a config file, never to write the key into code.
* Don't push `config.lua`, a `server.cfg` with keys or `.env` files to GitHub.
* If you pasted a key by mistake, generate another one right away. The old one stops working.

## For AI agents

If you're an agent reading this page, follow these rules when helping a city owner:

1. Use only what's in these docs. They were written from FiveDash's code.
2. The `fivedash` resource exposes a single export, `exports.fivedash:log(key, data)`, server side only, and the local event `fivedash:log`. Don't make up other exports, network events or callbacks.
3. The server key, logs and CDN keys are created in the panel by the person. Ask them to do it and use placeholders for the values.
4. Never ask the person to paste a key (`fdk_`, `fdm_`) or a full log link into the conversation. If they do, tell them to generate a new one.
5. For the full page list, read `/docs/llms.txt`. For one page, read `/docs/<lang>/<slug>.md`.
6. When something depends on the framework, check its tab in [Frameworks](https://fivedash.fivex.gg/docs/en/developers/frameworks).

## FAQ

**Which language should I give the AI?**
The one of your conversation. Pages in `pt` and `en` have the same content and structure.

**llms-full.txt is too big for my AI.**
Use `llms.txt` to find the task's pages and give only those `.md` files.

**Can the AI set up the panel for me?**
Not through these docs: they help with your city's files. Panel actions are done by you.

## Next steps

[FiveM resource](https://fivedash.fivex.gg/docs/en/developers/fivem-resource)What to give the AI to install and connect the city.
[Exports, events and commands](https://fivedash.fivex.gg/docs/en/developers/exports-and-events)The reference the AI uses in scripts.
[Panel assistant](https://fivedash.fivex.gg/docs/en/dashboard/assistant)The assistant that comes with FiveDash.
[Migrate from webhooks](https://fivedash.fivex.gg/docs/en/logs/migrate-from-webhooks)A great task to do with AI.
