2 Commits

Author SHA1 Message Date
44ea1eebb0 style: auto-format example files with lux fmt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 06:52:44 -05:00
b0f6756411 feat: add File and Process effects for real I/O
Adds two essential effects that enable Lux to interact with the system:

File effect:
- read(path) - Read file contents as string
- write(path, content) - Write string to file
- append(path, content) - Append to file
- exists(path) - Check if file/directory exists
- delete(path) - Delete a file
- readDir(path) - List directory contents
- isDir(path) - Check if path is directory
- mkdir(path) - Create directory (including parents)

Process effect:
- exec(cmd) - Run shell command, return stdout
- execStatus(cmd) - Run command, return exit code
- env(name) - Get environment variable (returns Option)
- args() - Get command line arguments
- exit(code) - Exit program with code
- cwd() - Get current working directory
- setCwd(path) - Change working directory

Also fixes formatter bug with empty handler blocks in `run ... with {}`.

These effects make Lux capable of writing real CLI tools and scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 16:09:20 -05:00