Documentation menu
Getting Started

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:

macOS

chmod +x sz-macos-arm64
mv sz-macos-arm64 /usr/local/bin/sz

Linux

chmod +x sz-linux-x64
mv sz-linux-x64 /usr/local/bin/sz

From source

Requires Rust stable:

git clone https://github.com/Sergio3215/serez-code
cd serez-code
cargo build --release

Verify

sz --version

All 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: 15

Run it:

sz hello.sz
Note: Use out 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()
HELLO

CLI commands

CommandWhat it does
sz script.szRun a script file
szStart the interactive REPL
sz --watch script.szRe-run automatically on every save
sz --check script.szAnalyze estimated memory usage without running
sz --versionPrint the installed version
sz initCreate a serez.json interactively in the current directory
sz init --yCreate 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 apipack

Watch mode

sz --watch main.sz

Memory 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-lsp automatically (looks for it in your system PATH).
  • Configure the LSP in your VS Code settings using serez.lsp.enabled and serez.lsp.path.
  • Full support for JSX and outline views inside .szx files.
  • Supports Restricted Mode (runs highlighter and formatter on untrusted workspaces, starts the LSP analyzer only after you grant trust).