wasm-pkg-tools
August 19, 2026 ยท View on GitHub
Tools to package up Wasm Components
This repo contains several Rust crates that can be used for fetching and publishing Wasm Components
to OCI registries. It is also the home of the wkg command line tool, which exposes all the
functionality of the libraries. The first (but not only) focus of this project is allow for fetching
of Wit Interfaces stored as components for use in creating components. It can also be used to fetch
and publish component "libraries" to/from a registry.
Documentation
- Install
- Quick start
- Configuration (
config.toml) - Registry metadata (
/.well-known) - Manifest (
wkg.toml) - Contributing
- License
Install
Right now installation of wkg is manual. You can either clone the repo and build from source, or
download a pre-built binary from the releases
page and add it to your PATH. In the
future we will add this tool to various package managers. If this is something you'd like to help
with, please feel free to open some PRs!
If you have a Rust toolchain installed, you can also install wkg with one of the following
options:
cargo install wkg
If you have cargo-binstall installed, you can also
install wkg with a pre-built binary:
cargo binstall wkg
Quick start
Set the default registry:
wkg config --default-registry {REGISTRY_DOMAIN}
Open the full config file in $EDITOR:
wkg config --edit
Download a package:
wkg get wasi:http@0.2.1
Publish a package to the configured registry:
wkg publish path/to/component.wasm
Pull a component directly from an OCI registry by tag or by digest to pin an exact immutable artifact:
wkg oci pull ghcr.io/webassembly/wasi/http:0.2.1
# pulls the equivalent artifact
wkg oci pull ghcr.io/webassembly/wasi/http@sha256:49be4c9201a1b9fe99d589cde205d6096384a77b8767fedeef0e53e480abff49
Fetch WIT dependencies for the current project (uses wkg.toml / wkg.lock):
wkg fetch
Update pinned versions in wkg.lock:
wkg update
Build a WIT package into a component:
wkg build
Point at a non-default config or cache directory (the --config / --cache flags attach to each
subcommand, not to wkg itself):
wkg get --config .wkg/config.toml --cache ./wkg-cache wasi:cli@0.2.0
Contributing
Want to join us? Check out our "Contributing" guide and take a look at some of these issues:
License
Licensed under Apache-2.0 WITH LLVM-exception
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license with LLVM-exception, shall be licensed as above, without any additional terms or conditions.