Scripts
A script is a self-contained .lis file that does not belong to any project, i.e. not located under a src/ dir with a lisette.toml manifest.
Scripts are typically used for prototypes and one-off utilities.
Running a script
Section titled “Running a script”lis run <file> compiles the script file into a binary in a temp dir, then runs the script binary. Any argument after <file> is passed to the script.
import "go:fmt"import "go:os"
fn main() { fmt.Println("hello,", os.Args[1])}lis run greet.lis aliceA shebang makes a script directly executable:
#!/usr/bin/env -S lis run
import "go:fmt"import "go:os"
fn main() { fmt.Println("hello,", os.Args[1])}chmod +x greet.lis && ./greet.lis aliceScripts support most verbs: build, emit, check, and format.
Third-party Go modules
Section titled “Third-party Go modules”A script declares third-party Go dependencies in a comment block at the top of the script, above the first import:
// [dependencies.go]// "github.com/google/uuid" = "v1.6.0"
import "go:fmt"import "go:github.com/google/uuid"
fn main() { fmt.Println(uuid.NewString())}This block is managed by lis add --script and lis sync --script.
To add a third-party Go dependency to a script:
lis add --script greet.lis google/uuid ✓ Added github.com/google/uuid v1.6.0lis add writes the entry into the comment block:
// [dependencies.go]// "github.com/google/uuid" = "v1.6.0"To reconcile the comment block against the script’s imports:
lis sync --script greet.lisTo remove a dependency, delete its entry from the block and run lis sync.
Limitations
Section titled “Limitations”Scripts are meant to stay small, so they are limited:
- No support for tests
- No support for redirects via
--replaceand--path
If a script outgrows these limits, promote it into a project:
- Run
lis new <project-name> - Move the script file to
src/main.lis - Move the comment block to
lisette.tomlwithout the//markers