Command Line Usage#

bialet is a single binary. The command line controls how the server starts, how it is configured, and a few standalone modes (-r, -t, -T).

Starting the Server#

Run bialet from your app directory:

bialet

This serves the current directory on 127.0.0.1:7001.

Development mode: bialet dev#

bialet dev

Starts the server from the current directory, enables live reload and the in-browser error display, and opens the server URL in your browser. The flags are stored in the database and persist across restarts, so you only need to run dev once. Plain bialet starts the server without touching those flags or opening the browser.

On Windows, double-clicking bialet.exe in File Explorer counts as a dev launch: the server starts in dev mode with the browser opening automatically. Run it from a terminal to start without dev mode.

See Live Reload and Error Pages for what dev mode turns on.

Options#

Pass the app directory and flags to control startup:

bialet -p 8080 -h 0.0.0.0 /path/to/app

Every option has a short and a long form. Values can be passed as --option value or --option=value:

bialet --port 8080 --host 0.0.0.0 /path/to/app
bialet --port=8080 /path/to/app

Parameter

Description

Default

-p, --port

Port number

7001

-h, --host

Host name

127.0.0.1

-H, --help

Show this help and exit

None

-r, --run

Run the code passed as argument, then exit

None

-t, --validate

Validate the syntax of a Wren file, then exit

None

-T, --tests

Run tests in the _tests/ folder

None

-v, --version

Print the version and exit

None

-l, --log

Log file location

stdout

-d, --db

SQLite database file location

_db.sqlite3

-w, --wal

Enable SQLite Write-Ahead logging mode

Disabled

-i, --ignore

Ignored files: comma-separated list of glob expressions

README*,AGENTS*,LICENSE*,*.json,*.yml,*.yaml

-m, --mem-soft

Memory soft limit (MB)

128

-M, --mem-hard

Memory hard limit (MB)

256

-c, --cpu-soft

CPU soft limit (%)

15

-C, --cpu-hard

CPU hard limit (%)

30

-b, --max-post

Max request body (KB)

128

-u, --max-upload-size

Max per-file upload (bytes; K/M/G suffix scales it, e.g. 4MB)

4 MB (see note below)

-f, --foreign-keys

SQLite foreign keys: on or off

on

-s, --synchronous

SQLite synchronous: off, normal, full, or extra

normal

-q, --quiet

Quiet: suppress the browser auto-open and colored output

Disabled

Long options that require a value reject an empty one (--port alone is an error). Unknown options, short or long, are rejected with an error and the usage text instead of being silently ignored.

Size values for -u are bytes; a K, M, or G suffix (KiB/MiB/GiB) scales them. -u 4MB, -u 4096KB, and -u 4194304 are the same limit.

The upload cap is also bounded by the request-body limit (-b). A file must fit inside a multipart body smaller than -b (default 128 KB), so the effective per-file limit is the smaller of -u and that body cap minus ~8 KB of multipart framing. With defaults that is about 120 KB, not 4 MB. See File Size Limits for how to raise it.

Version#

Print the installed version and exit:

bialet -v
# bialet 1.2.0

Quiet mode#

-q (or --quiet) suppresses the browser auto-open and colored log output. Useful in scripts, containers, and CI:

bialet -q /path/to/app

Run Code from the Command Line#

Use -r to run Wren code once and exit:

bialet -r 'System.log("Hello, World!")'

The response will be printed directly.

bialet -r 'return "No log, plain response"'

You have to respect newlines in the code.

Running Tests#

Bialet includes a built-in testing framework. See Testing Guide for full documentation.

bialet -T                    # Run all tests in _tests/
bialet -T docs/examples      # Run tests in a specific directory

Validate Syntax of a Wren File#

To check the syntax of a Wren file without executing it, use -t. Run it the same way you run the server:

If you start your server from the app directory:

cd /path/to/app
bialet               # starts server
bialet -t index.wren # validates syntax

If you start your server with an explicit root path:

bialet /path/to/app                         # starts server
bialet -t /path/to/app/index.wren /path/to/app # validates syntax

The root path is required when your file imports from _app/ or uses relative imports. If you omit it for such files, the validator will exit with an error.

This will validate the syntax and exit with code 0 if the syntax is valid, or code 1 if there are compilation errors. Useful for CI/CD pipelines and pre-commit hooks.

# Example: Check syntax before deploying (explicit root path)
if bialet -t /path/to/app/main.wren /path/to/app; then
    echo "Syntax OK, deploying..."
else
    echo "Syntax errors found, aborting deployment"
    exit 1
fi

Upload and SQLite Tuning#

These limits and SQLite pragmas are startup flags, set per app per launch:

File Upload Limit#

  • Max Upload Size (-u, --max-upload-size): the per-file cap for Request.file(). Files over it are rejected and logged with the limit. Default 4 MB, and bounded by the request-body cap — see File Size Limits. Example: bialet -u 8MB /path/to/app.

SQLite Pragma Settings#

  • Foreign Keys (-f, --foreign-keys): enable or disable foreign key constraints (default: on). Disable with -f off only when you know a migration depends on it; otherwise orphaned rows go unchecked.

  • Synchronous (-s, --synchronous): controls how SQLite writes to disk (default: normal).

    • off: Fastest, least safe

    • normal: Balanced performance and safety (default)

    • full: Very safe, slower

    • extra: Maximum safety, slowest

bialet -f off -s full -u 2MB /path/to/app

SQLite applies these at connection open, so changing them requires restarting the server.