rsx
is a tool that packages your Risor scripts into a standalone Go binary, allowing for easy distribution of your applications without dependencies.
Note
RSX is currently in beta.
- Package Risor scripts into a single executable
- Built-in Risor modules for additional functionality
- Easy project initialization and management
- Built-in SQLite support with FTS5
- Ability to external Risor native modules:
import rsx
rsx.load("gh:rubiojr/risor-libs/lib/test", { branch: "main" })
- Additional Risor Go modules included:
- sched: Schedule tasks
You need to have Go installed on your system. If you don't have it, you can download it from the official website.
Install RSX using Go:
go install --tags fts5 github.com/rubiojr/rsx@latest
Ensure that your Go bin directory is in your PATH.
-
Create a new Risor project:
rsx new myapp cd myapp
-
Edit the main script (
main.risor
) to add your code:import rsx rsx.log("Hello from Risor!")
-
Build the Go binary:
rsx build
Note
rbx runs go build
under the hood, so you can pass any additional environment variables to it, like GOOS
, GOARCH
, etc.
- Run your application:
./myapp # Output: Hello from Risor!
main.risor
: The entry point of your application.lib/
: Directory for additional Risor modules.
Place any additional .risor
files in the lib
directory. They will be automatically available at runtime.
External Risor Go modules are supported. To add a custom Go module, follow these steps:
Add a .modules
file in the root of your project with the following format:
github.com/rubiojr/risor-modules/hello
github.com/rubiojr/risor-modules/onemore
Where each line is the Go module path used in a Go import statement.
Then, run rsx build
to build the binary with the custom module.
Risor Go modules are regular Go modules that extend Risor functionality with new built-ins, like https://github.com/rubiojr/risor-modules/hello.
See related official documentation at https://risor.io/docs/contributing_modules.
RSX comes with a built-in rsx
module providing basic functionality. For available functions, refer to rsx.risor.
During development, you can run your Risor scripts directly:
# needs main.risor as the main entry point
rsx run
Or you can use eval
also:
rsx eval main.risor
This allows for faster iteration without needing to rebuild the binary.
Note
Custom native Go modules not built into RSX are not avaible with rsx run
.
If you are using a custom module, you will need to build the binary with rsx build
to test it.
- Verba: API server to store and index Spanish RTVE news transcripts.
- Firefox history exporter - Firefox history to JSON exports.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues, questions, or contributions, please open an issue on GitHub.