Quickstart
From an empty folder to a running project.
Quickstart
This page goes from nothing to running code. The examples run MicroStudio from a
checkout as microstudio; microstudio in its place is the
same command.
If you have not installed it yet, see Installation.
Run three lines of Luau
No Rojo file is needed, and nothing is read from disk. Instance.new, game,
workspace, Players, the datatypes and task are all in scope:
microstudio -e "
local part = Instance.new('Part')
part.Name = 'Probe'
part.Parent = workspace
print(part:GetFullName(), typeof(part.Position))
"game.Workspace.Probe Vector3Run a file, stdin, or a prompt
microstudio script.luau # a file
microstudio - # a script on stdin
microstudio # a prompt, on a fresh worldA script is treated as a program: when its entry chunk returns, so does MicroStudio — after the work the script scheduled finishes.
microstudio -e "
task.spawn(function() task.wait(0.25) print('background finished') end)
print('started')
"started
background finishedAt the prompt, bare expressions echo their value:
MicroStudio 1.1.1 — Luau 0.740 — :help for commands
> workspace
Instance<Workspace> Workspace
> Instance.new("Part").Size
4, 1, 2
> CFrame.Angles(0, math.pi / 2, 0)
0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0
> game:GetService("CollectionService"):GetTags(workspace)
[]See The REPL for the prompt's commands.
Boot the bundled example
examples/hello is a small project with a Rojo file, a server script and a
shared module. dev reads the project, loads the compiled Luau into a live
DataModel and runs the server scripts:
microstudio dev examples/hello --onceMicroStudio dev — .../examples/hello/default.project.json
loaded 6 instances
hello, MicroStudio
running on the server: true
tagged a checkpoint: Checkpoint1
checkpoint position: 0, 0, 0
tagged instances: 1
util.sum: 6
[server] ServerScriptService.TS.gameUse it as a boot check
dev uses a real clock, so task.wait(0.5) really waits. dev --once boots the
project, drives it for --timeout seconds (0.1 by default) and exits non-zero if
anything errored. This is the "does my project still boot" check for CI:
microstudio dev examples/hello --once --timeout 3MicroStudio dev — .../examples/hello/default.project.json
loaded 6 instances
hello, MicroStudio
running on the server: true
tagged a checkpoint: Checkpoint1
checkpoint position: 0, 0, 0
tagged instances: 1
util.sum: 6
[server] ServerScriptService.TS.gameFor assertions rather than a boot check, use microstudio test.
Stay in the world, or re-run on save
Add --interactive to run a file and stay in the world it created, or
--watch to re-run on save, like a Luau scratchpad:
microstudio script.luau --interactive
microstudio script.luau --watch
microstudio script.luau --interactive --watchdev accepts both flags too. Continue with
Running a project for the full dev workflow.