stardust

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT

README

Stardust

Stardust is an embedded Starlark interpreter for Go, providing both a library for integrating scripting capabilities into your applications and a standalone CLI for running Starlark scripts.

The intention is to provide the ability to write simple cross-platform (Windows, Linux, macOS) scripts, but with Python-like syntax. This is not intended to be a full-featured scripting language.

It is built on top of starlark-go.

Features

  • Some Batteries Included: Extends Starlark with modules for manipulating the filesystem, working with files, and running commands.
  • Modular and Documented: Functions are arranged in namespaced modules. Documentation is generated automatically from docstrings. Automated tests exist.

Project Structure

  • cmd/stardust/main.go: The entry point for the CLI tool
  • embed/pkg.go: The entry point for the embedded interpreter
  • modules/: Contains a set of built-in functions, refer to fs, os, path, random, and console for more information.
  • resources/: Contains test scripts, samples, and documentation.

Built-in Functions

Detailed documentation for built-in functions can be found in the resources/modules/docs/ directory. See resources/samples for example scripts.

Usage

To run this as a CLI tool, first go install it, then pass the script path as an argument to the application:

go install github.com/pdvcs/stardust/cmd/stardust@latest
stardust ./resources/samples/files.star

To embed the library in an application, import github.com/pdvcs/stardust/embed and use the Run function. See resources/examples/embed.go for an example.

Directories

Path Synopsis
cmd
gendoc command
stardust command
modules
fs
os
resources
examples command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL