{"id":50914009,"url":"https://github.com/viruxe/cfxlua-cli","last_synced_at":"2026-06-16T13:01:30.090Z","repository":{"id":359831828,"uuid":"1247647817","full_name":"VIRUXE/cfxlua-cli","owner":"VIRUXE","description":"A standalone verification tool for FiveM scripts, built because standard luac cannot handle the CitizenFX Lua flavor.","archived":false,"fork":false,"pushed_at":"2026-05-23T18:01:46.000Z","size":10796,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-23T18:17:27.727Z","etag":null,"topics":["automation","cfxlua","citizenfx","fivem","linter","lua","luaglm","static-analysis","testing","verification"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VIRUXE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-23T15:42:17.000Z","updated_at":"2026-05-23T18:01:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/VIRUXE/cfxlua-cli","commit_stats":null,"previous_names":["viruxe/cfxlua-cli"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/VIRUXE/cfxlua-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VIRUXE%2Fcfxlua-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VIRUXE%2Fcfxlua-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VIRUXE%2Fcfxlua-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VIRUXE%2Fcfxlua-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VIRUXE","download_url":"https://codeload.github.com/VIRUXE/cfxlua-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VIRUXE%2Fcfxlua-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34406824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cfxlua","citizenfx","fivem","linter","lua","luaglm","static-analysis","testing","verification"],"created_at":"2026-06-16T13:01:28.966Z","updated_at":"2026-06-16T13:01:30.080Z","avatar_url":"https://github.com/VIRUXE.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CfxLua CLI Toolchain\n\n[![Release](https://img.shields.io/github/v/release/VIRUXE/cfxlua-cli?include_prereleases)](https://github.com/VIRUXE/cfxlua-cli/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**CfxLua CLI** is a standalone verification and static analysis tool for FiveM Lua scripts. \n\nStandard Lua checkers (like `luac`) fail when encountering FiveM's specific Lua flavour—which includes custom power patches (like `each` iterators and safe navigation) and first-class vector/matrix types. This toolchain solves that by providing a server-independent environment powered by the same specialized **LuaGLM 5.4** VM used by CitizenFX.\n\n## 🌟 Key Features\n\n-   **Native FiveM Support**: Full support for CitizenFX Lua 5.4 features, including `each` iterators, `defer`, safe navigation (`?.`), and callable vectors/quaternions.\n-   **MagicMock System**: Automatically handles missing globals (e.g., `lib`, `ox_inventory`, or client-only natives) by returning intelligent, indexable/callable stubs instead of crashing.\n-   **Lazy Resource Discovery**: Dynamically scans your `resources/` folder to discover and mock exports from other resources, enabling cross-resource static analysis.\n-   **Execution Safety**: Integrated timeout protection (default 5s) prevents verification hangs on scripts containing infinite loops (like `while true do Wait(0) end`).\n-   **Powered by LuaGLM**: High-performance mathematics support with first-class vector, matrix, and quaternion types.\n\n---\n\n## 🚀 Installation\n\n### Quick Install (Pre-compiled Binaries)\n\nDownload the latest package for your platform from the [Releases](https://github.com/VIRUXE/cfxlua-cli/releases) page.\n\n#### Linux\n1. Extract the `.tar.gz` archive.\n2. Run the installer:\n   ```bash\n   sudo ./install.sh\n   ```\n\n#### Windows\n1. Extract the `.zip` archive.\n2. Run `install.bat` as Administrator (to ensure PATH is updated).\n3. Restart your terminal.\n\n### Build from Source\n\nRequirements: `build-essential`, `cmake`, and `mingw-w64` (for Windows cross-compilation).\n\n```bash\ngit clone https://github.com/VIRUXE/cfxlua-cli.git\ncd cfxlua-cli\nmake -j$(nproc)\nsudo ./install.sh\n```\n\n---\n\n## 📖 Usage\n\nTo verify a script, simply pass the file path to the `cfxlua` command:\n\n```bash\ncfxlua path/to/your/resource/server.lua\n```\n\n### Environment Variables\n\n-   **`CFXLUA_TIMEOUT`**: Execution timeout in milliseconds (default: `5000`).\n-   **`CFXLUA_VM`**: Path to a custom Lua VM binary.\n-   **`CFXLUA_RUNTIME`**: Path to a custom runtime mock directory.\n\n---\n\n## 🛠️ Advanced Configuration\n\n### Lazy Resource Discovery\nThe tool attempts to resolve unknown exports by searching for an `fxmanifest.lua` in sibling directories. If an export like `exports.qbx_core:Notify()` is encountered, it will find the `qbx_core` resource and automatically stub the requested function.\n\n### MagicMocks\nIf your script relies on external libraries (like `ox_lib`) that aren't present in the standalone environment, the MagicMock system ensures that calls to `lib.*` or undefined natives return `nil` or dummy objects gracefully, allowing the syntax check to continue.\n\n---\n\n## 🧬 Technical Background (LuaGLM)\n\nThis toolchain is built upon **LuaGLM**, a Lua 5.4.4 runtime providing complete bindings to the [GLM](https://github.com/g-truc/glm) C++ mathematics library.\n\n### Vectors \u0026 Quaternions\nVectors are first-class, immutable types. You can use standard GLSL swizzling and arithmetic:\n```lua\nlocal v = vec(1.0, 2.0, 3.0)\nprint(v.xyz) -- vec3(1.0, 2.0, 3.0)\nprint(#v)    -- 3.74165 (Magnitude)\n```\n\n### Power Patches\n- **Compound Operators**: `+=`, `-=`, `*=`, `/=`, etc.\n- **Safe Navigation**: `t?.x?.y` returns `nil` if `t` or `x` are missing.\n- **In Unpacking**: `local a, b in t` (Unpacks keys from table `t`).\n- **Each Iteration**: `for k, v in each(t) do ... end`.\n\n---\n\n## 🤝 Contributing\n\nContributions to improve mocks, add support for more FiveM-specific patterns, or enhance the resource discovery logic are welcome!\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feat/amazing-mock`).\n3. Commit your changes.\n4. Push to the branch and open a Pull Request.\n\n## 📜 Credits\n\n-   **VIRUXE**: Advanced Mocks and CLI Toolchain.\n-   **Cfx.re**: Original LuaGLM 5.4 runtime and FiveM integration patches.\n-   **Polaris Naz**: Performance patches and execution safety logic.\n-   **Lua Team**: The base Lua language.\n\n## ⚖️ License\nThis project is licensed under the **MIT License**. See `lua.h` for the original Lua copyright notice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviruxe%2Fcfxlua-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviruxe%2Fcfxlua-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviruxe%2Fcfxlua-cli/lists"}