This document explains how to use the `fun` binary after building or installing it: invocation patterns, options, environment variables, include/search paths, REPL, and examples.
## Synopsis
```
fun [options] [<script.fun>] [-- args...]
```
- If `<script.fun>` is provided, `fun` runs the script.
- If omitted and the build enables the REPL, `fun` starts an interactive session.
## Options
-`-i`, `--repl` — start the interactive REPL explicitly (if built with REPL support)
-`-v`, `--version` — print version and exit
-`-h`, `--help` — show usage info and exit
Notes:
- Available options may vary by build configuration. Always check `fun --help` for your binary.
## Exit codes
-`0` — success
- non‑zero — error during parse, compile, or runtime
## Standard library and includes
`fun` searches for modules included from `.fun` code in these locations:
1. The path provided by the environment variable `FUN_LIB_DIR` (highest precedence)
2. The compiled‑in default `DEFAULT_LIB_DIR` (configured during build/install)
Tips:
- When running from the repository without installing, set `FUN_LIB_DIR` to the local `./lib` directory so examples can find the stdlib.