@anx-scripts/fivem-skills
v0.6.0
Published
Local FiveM documentation mirrors (docs, natives, Overextended) with offline search CLI
Readme
fivem-skills
CLI that mirrors FiveM documentation locally and searches it offline — so AI agents (and humans) have the docs at hand without network access or scraping.
Sources:
| Name | Repository | Content |
| --------- | ---------------------------------------------------- | ------------------------------------------- |
| docs | citizenfx/fivem-docs → content/docs | Official FiveM documentation |
| natives | citizenfx/natives | FiveM / GTA V / RDR3 native functions |
| ox | overextended/overextended.github.io → content/docs | ox_lib, ox_inventory, oxmysql… docs |
Data lands in ~/.fivem-skills/data/<source>/ (shallow git sparse clones — ~8 MB total).
Install
bun add -g @anx-scripts/fivem-skills # or: npm install -g @anx-scripts/fivem-skills
fivem-skills pullFrom a local clone: bun install && bun run build && bun link.
Using with AI agents
The repo ships SKILL.md — an agent skill teaching the search → read-the-printed-path workflow. Install it into a project with skills:
bunx skills add anx-scripts/fivem-skills # or: npx skills add anx-scripts/fivem-skillsThe skill tells the agent to prompt for a global CLI install when fivem-skills is missing, so installing the skill alone is enough to bootstrap.
Usage
fivem-skills pull # download/update all sources
fivem-skills pull natives # selected sources only
fivem-skills search GetPlayerPed # search everywhere
fivem-skills search "ox_lib callback" -s ox # AND within the ox source
fivem-skills search "SET_PED_.*" -e -l 50 # regex, limit 50 files
fivem-skills list # source statusHow search works
- Multiple words = AND — a file matches when every word appears somewhere in it (file name or content). Force an exact phrase with regex:
-e "register callback". - camelCase splitting — query words are split on camelCase boundaries, so
SafePedfindsGetSafeCoordForPedjust likesafe pedwould. - Native name normalization —
GET_PLAYER_PED,GetPlayerPedandgetplayerpedare the same query; underscores and case don't matter when matching file names. - Ranking — exact file name match > partial file name match > content-only matches (sorted by number of matching lines).
- Results show up to 5 matching lines per file, preferring markdown headings — for a native that surfaces its
## NATIVE_NAMEsignature heading instead of enum entries. - Each result prints the file's absolute on-disk path.
searchonly finds and previews — read a file by opening that path with your own editor/grep tools, so you pull just the lines you need (native files are tiny; thedocs/.../game-references/*files are huge lookup tables — grep them, never read whole). - Output is colorized on interactive terminals only (respects
NO_COLOR); piped output stays plain.
Development
bun run dev -- search callback # run from src/ without building
bun run typecheck
bun run build # bundles src/cli.ts into dist/cli.cjs (CJS, zero dependencies)Design notes:
- Sparse clones instead of tarballs — the full
citizenfx/fivem-docstarball weighs 274 MB (site assets); a sparse clone ofcontent/docsalone is ~4 MB. dist/cli.cjsin CJS format — the bundle runs under plain Node regardless of"type": "module"or whether apackage.jsonsits next to it.- Built-in sources only — this repo will eventually ship a SKILL.md instructing agents; a fixed, known set of sources keeps their behavior predictable. New sources are added deliberately in code (
src/sources.ts), not via configuration.
