# Wren-CLI
retoor <retoor@molodetz.nl>
A command-line interface and REPL for the [Wren](http://wren.io) programming language. Built on [libuv](http://libuv.org/) for asynchronous I/O with native support for HTTP/HTTPS, WebSockets, TLS, SQLite, JSON, regex, and more.
## Prerequisites
- C compiler (GCC or Clang)
- Make
- OpenSSL development libraries
- Python 3 (for tests)
## Build
```bash
git clone https://github.com/wren-lang/wren-cli.git
cd wren-cli
make build
```
Output binary: `bin/wren_cli`
### Platform-Specific Builds
| Platform | Command |
|----------|---------|
| Linux | `make build` |
| macOS | `cd projects/make.mac && make` |
| FreeBSD | `cd projects/make.bsd && gmake` |
## Test
```bash
make tests
```
Run a specific test suite:
```bash
python3 util/test.py json
```
## Build Targets
| Target | Description |
|--------|-------------|
| `make build` | Release build |
| `make debug` | Debug build |
| `make clean` | Clean build artifacts |
| `make tests` | Build and run all tests |
| `make buildmanual` | Build documentation to `bin/manual/` |
## Usage
```bash
bin/wren_cli script.wren # Execute a script
bin/wren_cli # Start the REPL
```
## Modules
**Core**: io, os, scheduler, timer, net, repl
**Extended**: json, env, math, base64, datetime, dns, signal, subprocess, crypto, regex, http, tls, sqlite, websocket, jinja, pathlib, tempfile, uuid
## Documentation
### Building the Manual
```bash
make buildmanual
```
Output: `bin/manual/` (open `index.html` in a browser)
The manual works offline when opened directly via `file://` protocol.
### Manual Source Structure
```
manual_src/
data/
site.yaml # Site metadata (name, version)
navigation.yaml # Navigation structure and page list
templates/ # Jinja2 base templates
pages/ # Content pages (api/, tutorials/, howto/, etc.)
static/ # CSS, JS assets
```
### Adding Documentation for a New Module
1. Create `manual_src/pages/api/<name>.html` using the template from an existing API page
2. Add entry to `manual_src/data/navigation.yaml` under the API Reference section
3. Update `prev_page`/`next_page` in adjacent API pages
4. Build: `make buildmanual`
## License
MIT