Skip to content

Add a cli interface #69

@jsturtevant

Description

@jsturtevant

This would make it easier to use in agent skills and and other tools.

Add a hyperlight-sandbox CLI binary so users can run scripts in an isolated sandbox directly from the terminal without writing a host program.

hyperlight-sandbox run script.py --backend wasm-python --allow-domain https://httpbin.org

Proposed CLI surface

hyperlight-sandbox run <SCRIPT> [OPTIONS]

Options:
  --backend <wasm-python|wasm-js|hyperlightjs|nanvix-js|nanvix-python>
                          Sandbox backend [default: wasm-python]
  --module <PATH>         AOT-compiled guest module (uses backend default if omitted)
  --input <DIR>           Read-only host dir mounted at /input
  --output <DIR>          Writable host dir mounted at /output
  --allow-domain <URL>    Allow network access (repeatable)
  --config <FILE>         TOML config file (flags override)
  --heap-size <BYTES>     Guest heap size
  --stack-size <BYTES>    Guest stack size
  -v, --verbose           Debug logging

Config file (TOML)

Possible config file.

backend = "wasm-python"
module = "python-sandbox.aot"

[network]
allow_domains = ["https://httpbin.org"]

[fs]
input = "./data"
output = "./results"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions