Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 pull

From 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-skills

The 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 status

How 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 SafePed finds GetSafeCoordForPed just like safe ped would.
  • Native name normalization — GET_PLAYER_PED, GetPlayerPed and getplayerped are 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_NAME signature heading instead of enum entries.
  • Each result prints the file's absolute on-disk path. search only 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; the docs/.../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-docs tarball weighs 274 MB (site assets); a sparse clone of content/docs alone is ~4 MB.
  • dist/cli.cjs in CJS format — the bundle runs under plain Node regardless of "type": "module" or whether a package.json sits 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.

About

Offline CLI and AI agent skill for searching FiveM documentation, GTA V natives, and Overextended resources. Fast, local, and developer-friendly.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages