REPL Command
The repl
command starts an interactive Read-Eval-Print Loop (REPL) for the Ocuroot SDK using the Starlark language.
Usage
ocuroot repl [file] [flags]
Description
The REPL command provides an interactive shell for testing, exploring, and developing with the Ocuroot SDK using the Starlark language. It allows you to:
- Execute Starlark expressions and statements interactively
- Access all SDK modules and built-in functions
- Test SDK functionality without creating full scripts
- Load and execute functions from your package files
Arguments
file
: Optional path to a .ocu.star
file to load before starting the REPL. All globals defined in the file will be available in the REPL session.
Flags
Inherits global flags from the root command.
Examples
# Start a new REPL session
ocuroot repl
# Load an existing Starlark file and start a REPL with its globals
ocuroot repl path/to/package.ocu.star
REPL Features
- Help Function: Type
help()
to see available SDK modules
- Exit: Press Ctrl+D to exit the REPL
- Interrupt: Press Ctrl+C to interrupt the current operation
- Multi-line Input: Automatically handles multi-line statements and blocks
- Full SDK Access: All SDK modules and functions are available
review
: Review and validate a package
build
: Build a package
deploy
: Deploy a built package
Responses are generated using AI and may contain mistakes.