Getting Started
Install Serez Code, write your first script, and get comfortable with the tools. Current version: v9.2.4
Installation
Windows
Download from GitHub Releases:
- sz-windows-x64-setup.msi — installer, adds
szto your PATH automatically. - sz-windows-x64.exe — portable binary, no installation needed.
macOS
- sz-macos-arm64 — Apple Silicon (M1/M2/M3)
- sz-macos-x64 — Intel
chmod +x sz-macos-arm64
mv sz-macos-arm64 /usr/local/bin/szLinux
- sz-linux-x64 — x64 static binary
chmod +x sz-linux-x64
mv sz-linux-x64 /usr/local/bin/szFrom source
Requires Rust stable:
git clone https://github.com/Sergio3215/serez-code
cd serez-code
cargo build --releaseVerify
sz --versionAll assets for v9.2.4 on GitHub →
Your first script
Create a file called hello.sz:
let name = "Serez"
out "Hello from {name}!"
let nums = [1, 2, 3, 4, 5]
let sum = nums.reduce(0, (acc, x) => acc + x)
out "Sum: {sum}" // → Sum: 15Run it:
sz hello.szout to print values. Expressions are not auto-printed when running a file — only in the REPL.The REPL
Run sz with no arguments. Results are printed automatically:
sz
>> let x = 10
>> x * 3
30
>> "hello".toUpperCase()
HELLOCLI commands
| Command | What it does |
|---|---|
sz script.sz | Run a script file |
sz | Start the interactive REPL |
sz --watch script.sz | Re-run automatically on every save |
sz --check script.sz | Analyze estimated memory usage without running |
sz --version | Print the installed version |
sz init | Create a serez.json interactively in the current directory |
sz init --y | Create serez.json using the folder name as project name (no prompts) |
sz run <script> | Execute a script defined in serez.json (e.g. sz run dev) |
sz install <name> | Install a package into ./packages/ |
sz uninstall <name> | Remove an installed package |
serez.json — Project manifest
Every Serez Code project can have a serez.json manifest. Run sz init to create one, or sz init --y to skip prompts:
{
"name": "my-app",
"version": "1.0.0",
"description": "My Serez Code app",
"author": "Sergio",
"scripts": {
"dev": "sz index.sz",
"build": "sz run apipack"
},
"dependencies": {
"serez-ai": "1.0.0"
},
"permissions": ["File", "OS"]
}Run any script with sz run:
sz run dev // runs: sz index.sz
sz run build // runs: sz run apipackWatch mode
sz --watch main.szMemory check mode
sz --check script.sz
Function 'fibonacci': ~312 estimated bytes
Criticality: ██ 🟢 < 1KB (Safe)
Function 'processData': ~11840 estimated bytes
Criticality: ██████████ 🔴 > 10KB (Critical)Editor Support (VS Code & LSP)
Serez Code includes first-class editor integration powered by the Language Server Protocol (LSP).
Language Server (sz-lsp)
The companion binary sz-lsp runs out-of-the-box to provide editor features. It runs JSON-RPC over stdio and reuses the compiler's lexer, parser, and type-checker to provide:
- Diagnostics: Live syntax error reporting (with files/lines/cols) and type checker warnings on every keystroke.
- Autocompletion: Auto-complete keywords, built-in functions, the 21 native namespaces and their methods, and your own project symbols.
- Go to Definition: Jump to user-defined functions, classes, enums, variables, and imported modules.
- Hover Tooltips: View signatures of functions and methods or summaries of namespaces.
- Code Navigation: Search document symbols, view code references, and rename symbols project-wide.
VS Code Extension
Install the official Serez Code extension in VS Code for syntax highlighting, code formatting, and full LSP features.
- The extension detects and starts
sz-lspautomatically (looks for it in your systemPATH). - Configure the LSP in your VS Code settings using
serez.lsp.enabledandserez.lsp.path. - Full support for JSX and outline views inside
.szxfiles. - Supports Restricted Mode (runs highlighter and formatter on untrusted workspaces, starts the LSP analyzer only after you grant trust).