Skip to content

CLI Reference

Compiles a file or directory of TS/TSX to Luau.

FlagDescriptionDefault
-o, --output <path>Output file or directorystdout
--cssAlso compile .css files via rbx-cssfalse
--react-path <path>Require path for ReactReplicatedStorage.Packages.React
--react-roblox-path <path>Require path for ReactRobloxReplicatedStorage.Packages.ReactRoblox
--packages-path <path>Instance path where wally/pesde packages are mountedauto-detected from the Rojo project, else ReplicatedStorage.Packages
--server-packages-path <path>Instance path where server-realm packages are mountedauto-detected from the Rojo project, else ServerScriptService.ServerPackages
--string-requiresEmit Luau string requires (require("@game/...")) instead of instance pathsfalse
--strictTreat warnings as errorsfalse
--sourcemapEmit source map commentsfalse
-s, --silentOmit the -- Auto-generated by rbx-tsx header commentsfalse
--no-constEmit local for every binding instead of promoting never-reassigned ones to const (for toolchains without const support)const enabled
--warn <level>all, unsupported, or noneall
Terminal window
rbx-tsx compile App.tsx # → stdout
rbx-tsx compile App.tsx -o App.luau # → file
rbx-tsx compile src/ -o out/ # → directory

Unsupported constructs emit warnings, not errors, by default. Use --strict to promote them to errors, or --warn to filter which warnings appear.

Package imports emit self-contained requires rooted at the mount, e.g. require(game:GetService("ReplicatedStorage").Packages.Maid). When the Rojo project maps the Packages/ / ServerPackages/ install directories elsewhere, the mounts are auto-detected from default.project.json (the compile log prints Rojo: packages mounted at ... when detection succeeds — if it doesn’t appear, pass the flag explicitly). --packages-path / --server-packages-path always win over detection. The bundled helper requires (React, ReactRoblox, Promise, RegExp) follow --packages-path unless their dedicated flags are set. Wally [server-dependencies] route to the server mount; pesde has no realm-specific dependency section, so all pesde packages use the shared mount.

--string-requires re-emits every require in Luau’s string form: alias- and package-resolved paths become require("@game/<Service>/..."), filesystem-relative paths become require("./...") / require("../..."), and an init module’s imports of its own children become require("@self/..."). @game and @self are aliases provided by Roblox’s require-by-string support, so the output resolves in Studio and under luau-lsp with a sourcemap, but not in environments without those aliases. Paths string requires cannot express (e.g. bracket-indexed CSS style modules) keep the instance form.

Watches a directory or file for changes and recompiles. Accepts the same flags as compile.

Terminal window
rbx-tsx watch src/ -o out/

The Rojo project (default.project.json) is read once at watch startup for alias and package-mount detection; restart the watcher to pick up edits to it.

Runs the compiler without emitting files. Reports warnings and errors only.

Terminal window
rbx-tsx check src/

Scaffolds a new Roblox project with starter components, tsconfig.json, wally.toml, and default.project.json.

Terminal window
rbx-tsx init my-app

Generates TypeScript declarations (.d.ts) from installed wally/pesde Luau packages, a local .luau module, or a directory of local modules, so imports resolve to real types instead of any.

FlagDescriptionDefault
-o, --output <dir>Output directory for the generated .d.ts files (package mode)types/packages
-f, --forceOverwrite existing .d.ts files next to local modulesfalse
Terminal window
wally install # or: pesde install
rbx-tsx types # reads wally.toml / pesde.toml + all package folders
rbx-tsx types src/ # local mode: emit a sibling .d.ts for each .luau under src/
rbx-tsx types src/util.luau # local mode: single module

Package mode searches every install location (Packages/, ServerPackages/, DevPackages/ for wally; roblox_packages/, roblox_server_packages/ for pesde), so server and dev dependencies resolve too. Passing a path that isn’t the manifest directory switches to local mode, which writes a .d.ts next to each module — existing .d.ts files are never overwritten without --force.

See Package Type Extraction for details on what it captures.

  • *.tsx / *.ts / *.jsx / *.js.luau
  • index.tsxinit.luau (Rojo convention)
  • index.client.tsxinit.client.luau

Package imports resolve to the package mounts described above. Rojo-aware path resolution reads default.project.json to map source directories — or individual modules, for tools like rogen that emit file-level $path entries — to game:GetService(...) require paths. When the importer and the target both have file-level mappings under the same service, the require is emitted tree-relative (script.Parent...), derived from the two tree positions rather than the filesystem; this applies whether or not --string-requires is on. Package manifests (wally.toml / pesde.toml) are auto-detected.