> For the complete documentation index, see [llms.txt](https://docs.lostdev.store/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lostdev.store/races/admin-guide.md).

# Admin Guide

## Who counts as an admin

Access is controlled by `Config.Admin`:

* `permission` — an ACE permission string checked for the player.
* `allowedGroups` — framework group names (e.g. `admin`, `god`) that are always allowed, regardless of ACE permission.

A player passes if **either** check succeeds. Set `Config.Admin.enabled = false` to disable all admin/route-creator functionality entirely.

## Managing saved routes

Beyond building new routes (see [Creating Routes](/races/route-creator.md)), these server-side commands manage routes already saved to the database:

| Command                        | Effect                                                                                                                                        |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `/raceadmin`                   | Prints the full admin command list to chat, as a quick reference.                                                                             |
| `/race_delete <raceKey>`       | Deactivates a saved route (soft-delete — it stops appearing/loading, without touching history/leaderboard rows tied to it).                   |
| `/race_toggle <raceKey>`       | Enables/disables a saved route without deleting it.                                                                                           |
| `/race_reload`                 | Reloads all routes from `Config.Routes` + the database. Use this after manually editing `Config.Routes` in code, or if the cache seems stale. |
| `/race_export_saved <raceKey>` | Exports an already-loaded (not just drafted) route as a pasteable Lua snippet, printed to the server console.                                 |

## Debug mode

`/racedebug` (or whatever `Config.DebugCommand` is set to) toggles verbose debug output for **yourself only** — useful when troubleshooting a specific race without spamming every admin's console.

## Moderation notes

* Deleting a route (`/race_delete`) is non-destructive to history — past results, leaderboard entries, and ghosts tied to that `raceKey` are preserved; the route simply stops being offered to players.
* All admin actions are authorized server-side (`Races.RequireAdmin`), so disabling `Config.Admin.nui` or `Config.Admin.commands` individually only hides the corresponding client-side entry point — the underlying permission check is what actually gates access.
* If `Config.Logs.discord.enabled` is on, admin actions (save/delete/toggle/export) can be mirrored to a Discord webhook for an audit trail.


---

# 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://docs.lostdev.store/races/admin-guide.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.
