Skip to main content
PyPI versions license

wasm-action

Wasm-action facilitates the creation, distribution and generic utilization of non-browser based WebAssembly workloads through a local-first approach with a focus on privacy and security. Written primarily in Python, it also explores the Python ecosystem's maturity for WebAssembly and beyond.

Features

  • Versatile use as GitHub action, CLI or Python library.
  • Supported registries: wa.dev
  • Supported artifact types: wasm
  • Supported actions: push, pull
  • Supports Python 3.10+ on Linux, MacOS and Windows
  • Python sandbox for running untrusted code

Planned

  • OCI registry support (a.k.a. Docker registry)

Usage

Pull from registry

      - uses: xelato/wasm-action@main
        with:
          action: pull
          registry: wa.dev
          package: component-book:adder

To pull a private package, define your token:

        env:
          WARG_TOKEN: ${{ secrets.WARG_TOKEN }}
Inputs
Name Description Required Example
action Pull from registry yes pull
registry Registry domain name yes wa.dev
package Package specification yes namespace:name@version
namespace:name
namespace/name
namespace/name@version
path Target path to save the download no file.wasm
Outputs
Name Description Example
registry Registry domain name wa.dev
registry-type Detected registry type warg
package Package foo:bar@1.2.3
package-namespace Package namespace foo
package-name Package name bar
package-version Package version 1.2.3
filename Download location foo-bar_1.2.3.wasm
digest File hash sha256:2afffac0...

Push to registry

      - uses: xelato/wasm-action@main
        with:
          action: push
          registry: wa.dev
          package: foo:bar@1.2.3
          path: files/foo_bar_1.2.3.wasm
        env:
          WARG_TOKEN: ${{ secrets.WARG_TOKEN }}
          WARG_PRIVATE_KEY: ${{ secrets.WARG_PRIVATE_KEY }}

CLI

The tool can be run without installing, using uv/uvx.

$ uvx wasm-action --help          
Usage: wasm-action [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  eval     Expression evaluator
  key      Generate private key or read one from stdin
  pull     Pull from registry
  push     Push to registry
  python   Python in a sandbox
  version  Print version
  x        Run a WebAssembly file
Pull from registry
$ uvx wasm-action pull --registry wa.dev --package wasi:io
registry=wa.dev
registry-type=warg
warg-url=https://warg.wa.dev
package=wasi:io@0.2.0
package-namespace=wasi
package-name=io
package-version=0.2.0
digest=sha256:c33b1dbf050f64229ff4decbf9a3d3420e0643a86f5f0cea29f81054820020a6
filename=wasi:io@0.2.0.wasm
$ file wasi:io@0.2.0.wasm 
wasi:io@0.2.0.wasm: WebAssembly (wasm) binary module version 0x1000d
Push to registry
$ export WARG_TOKEN="..."
$ export WARG_PRIVATE_KEY="..."
$ uvx wasm-action push -r wa.dev -p foo:bar@1.2.3 --path foo_bar_1.2.3.wasm
Key generation

New token registration and push to wa.dev require generation and configuration of a private/public key pair which can be facilitated with:

$ uvx wasm-action key
{
    "private": "ecdsa-p256:9y5nigLvFp3KZZQtuvN9DchpGIMUB4bwGAtkIoOCla4=",
    "public": "ecdsa-p256:AvspSQWBK65ItTou/uVCi5qC4P+HBCi4R34OIPb3ILRl",
    "id": "sha256:c836bd8a3082f2e8d70bdfa48296e580ab847fcdeadb351f448d03f152d44093"
}
# use private key to configure in github or save it elsewhere in a secure manner
$ uvx wasm-action key | jq .private | pbcopy
# use corresponding public key for new token registration at wa.dev
$ pbpaste | uvx wasm-action key | jq .public

Use as Library

The package is published to the Python Package Index and can be installed/depended-on under the name wasm-action on all supported Python versions.

$ pip install wasm-action
>>> import wasm_action as wa
>>> wa.pull('wa.dev', 'wasi:io')
PackageDownload(namespace='wasi', name='io', version='0.2.0', content='...', digest='sha256:c33b1dbf050f64229ff4decbf9a3d3420e0643a86f5f0cea29f81054820020a6')

However, the library interface is not yet standardised and may (and will!) change.

Python Sandbox

Experimental support for running a WASI build of python/cpython@3.14.

$ uvx --python 3.14 wasm-action python --version
Python 3.14.2+

The characters -- can be used to separate host from guest options in cases where there's ambiguity:

# get guest interpreter help
$ uvx --python 3.14 wasm-action python -- --help

Host Python

The Python interpreter used to run wasm-action. It orchestrates and mediates the guest Python execution under a supported WebAssembly Runtime (wasmtime).

Guest Python

The Python interpreter that was compiled to WebAssembly. Guest Python runs in a restricted "sandbox" environment. In addition to the .wasm module file, it also requires the Python standard library folder, currently being reused from the host Python installation.

Interpreter

Currently there is a choice between --interpreter cpython (default) and --interpreter monty.

Layout

Guest code has access to the following paths:

  • / - host's current working directory (read/write)
  • /usr/local/lib/python3.14 - host Python's stdlib (read only)
  • /tmp (read/write)

Environment variables

Code running in the guest environment only has access to the environment variables explicitly defined:

>>> import os
>>> os.environ
environ({'PYTHONPATH': '/usr/local/lib/python3.14:/build'})

Additional variables can be defined with the -e/--env option.

Packages

Limitations

Application

Running untrusted code, such as one generated by an LLM.

Release files for wasm-action 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wasm-action 0.0.13
File Size Uploaded
wasm_action-0.0.13.tar.gz 50.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wasm-action 0.0.13
File Interpreter ABI Platform
wasm_action-0.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 165.0 kB

Release files / wasm_action-0.0.13.tar.gz

Download URL wasm_action-0.0.13.tar.gz
Size 50.7 kB
Tags Source
SHA-256 checksum
How to use checksums
888923e2af5a22267253bcdd73a59e857c0301bea2ff8b575e646f52bfe2aa53
BLAKE2b-256 checksum
How to use checksums
b783a4d6ac4ac9e238a007c3fb877a76b76f9ad9b98e62cdf8cb8c6e03c9f469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

Release files / wasm_action-0.0.13-py3-none-any.whl

Download URL wasm_action-0.0.13-py3-none-any.whl
Size 114.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72320f8cbf8b64f3d9b1077a6361bca1a9eaa16c119f2c26315cabfb1a4d0a64
BLAKE2b-256 checksum
How to use checksums
16cdf40b8386fc1fdfec9a17438a50786869edc519997553dcc3faaa581ffe9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.13 This release

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page