> For the complete documentation index, see [llms.txt](https://pepper-scripts.gitbook.io/pepper-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pepper-scripts.gitbook.io/pepper-scripts-docs/jobs/pepper-farmer/commands-and-exports.md).

# Commands & Exports

## Player commands & keys

| Command / key              | Function                                                                              |
| -------------------------- | ------------------------------------------------------------------------------------- |
| `F6` or `/farmer`          | Open or close the farm tablet                                                         |
| `K` (in the vehicle)       | Machine work menu: operation, seed/product, stop, park                                |
| ox\_target (usually `Alt`) | Actions on crops, animals, machines, merchants, lease boards, office and farm storage |

{% hint style="info" %}
Players can change `F6` and `K` themselves: **Settings → Key Bindings → FiveM**. You set the defaults in `config/config.lua` (`Config.Key`, `Config.Command`) and `config/vehicles.lua` (`Config.Machinery.menuKey`).
{% endhint %}

## Admin commands

Admins only (ACE `pepper_farmer.admin` or a framework group from `Config.Admin.groups`). The commands work in chat with `/` and in the server console without `/`. `<id>` is the server ID of the player, who must be online.

| Command                                                    | Effect                                                    |
| ---------------------------------------------------------- | --------------------------------------------------------- |
| `/farmadmin setlevel <id> <level>`                         | Set the level (1–100)                                     |
| `/farmadmin addxp <id> <amount>`                           | Give XP (without daily bonus and multipliers)             |
| `/farmadmin reset <id>`                                    | Reset level, XP, prestige and statistics of the character |
| `/farmadmin givequality <id> <item> <count> <quality 1–5>` | Give an item with a quality                               |

Examples:

```
/farmadmin setlevel 12 30
/farmadmin addxp 12 5000
/farmadmin givequality 12 tomato 20 4
```

All admin actions are written to the audit log (`farmer_audit`) and – if set up – to the Discord webhook from `config/server.lua`. You can change the command name `farmadmin` in `Config.Admin.command`.

{% hint style="info" %}
Most admin tasks are more convenient in the tablet's [admin tab](broken://pages/52a88d6a724c08c0b288cd67655c2b029d8140c3) – there, level/XP/reset also work for offline players.
{% endhint %}

## Console commands

Type these commands into the **server console** (txAdmin: **Live Console**).

| Command                               | Effect                                                                                                                                               |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `farmer_items de` / `farmer_items en` | Rewrites `install/ox_items_de.lua` or `install/ox_items_en.lua` from `config/items/*.lua` – needed after adding your own items. Server console only. |
| `farmer_locations_export`             | Writes all positions changed in the admin tab to `install/location_overrides.lua`. Server console or admins.                                         |

## Exports (server, read-only)

| Export                      | Returns                                                                   |
| --------------------------- | ------------------------------------------------------------------------- |
| `getVersion()`              | Pepper Farmer version                                                     |
| `getProfile(src)`           | The player's profile (level, XP, rank, farm …)                            |
| `getLevel(src)`             | The player's level (or `nil` if not loaded)                               |
| `hasUnlock(src, kind, key)` | Does the player have an unlock? (e.g. `kind = 'feature'`, `key = 'coop'`) |

Example:

```lua
local level = exports.pepper_farmer:getLevel(source)
if level and level >= 20 then
    -- …
end
```

{% hint style="info" %}
There is intentionally **no** export that lets other resources create money, XP or items.
{% endhint %}
