CLI Reference
rbx-tsx compile <input>
Section titled “rbx-tsx compile <input>”Compiles a file or directory of TS/TSX to Luau.
| Flag | Description | Default |
|---|---|---|
-o, --output <path> | Output file or directory | stdout |
--css | Also compile .css files via rbx-css | false |
--react-path <path> | Require path for React | ReplicatedStorage.Packages.React |
--react-roblox-path <path> | Require path for ReactRoblox | ReplicatedStorage.Packages.ReactRoblox |
--packages-path <path> | Instance path where wally/pesde packages are mounted | auto-detected from the Rojo project, else ReplicatedStorage.Packages |
--server-packages-path <path> | Instance path where server-realm packages are mounted | auto-detected from the Rojo project, else ServerScriptService.ServerPackages |
--string-requires | Emit Luau string requires (require("@game/...")) instead of instance paths | false |
--strict | Treat warnings as errors | false |
--sourcemap | Emit source map comments | false |
-s, --silent | Omit the -- Auto-generated by rbx-tsx header comments | false |
--no-const | Emit local for every binding instead of promoting never-reassigned ones to const (for toolchains without const support) | const enabled |
--warn <level> | all, unsupported, or none | all |
rbx-tsx compile App.tsx # → stdoutrbx-tsx compile App.tsx -o App.luau # → filerbx-tsx compile src/ -o out/ # → directoryUnsupported constructs emit warnings, not errors, by default. Use --strict to promote
them to errors, or --warn to filter which warnings appear.
Package mounts
Section titled “Package mounts”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
Section titled “String requires”--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.
rbx-tsx watch <path>
Section titled “rbx-tsx watch <path>”Watches a directory or file for changes and recompiles. Accepts the same flags as compile.
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.
rbx-tsx check <input>
Section titled “rbx-tsx check <input>”Runs the compiler without emitting files. Reports warnings and errors only.
rbx-tsx check src/rbx-tsx init <name>
Section titled “rbx-tsx init <name>”Scaffolds a new Roblox project with starter components, tsconfig.json, wally.toml,
and default.project.json.
rbx-tsx init my-apprbx-tsx types [path]
Section titled “rbx-tsx types [path]”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.
| Flag | Description | Default |
|---|---|---|
-o, --output <dir> | Output directory for the generated .d.ts files (package mode) | types/packages |
-f, --force | Overwrite existing .d.ts files next to local modules | false |
wally install # or: pesde installrbx-tsx types # reads wally.toml / pesde.toml + all package foldersrbx-tsx types src/ # local mode: emit a sibling .d.ts for each .luau under src/rbx-tsx types src/util.luau # local mode: single modulePackage 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.
Output filename mapping
Section titled “Output filename mapping”*.tsx/*.ts/*.jsx/*.js→.luauindex.tsx→init.luau(Rojo convention)index.client.tsx→init.client.luau
Path resolution
Section titled “Path resolution”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.