WASM-TOOLS(1)
π WASM-TOOLS(1) π
okay bestie, welcome to the User Commands corner of the manual β this is wasm-tools validate, and she's the queen of "is this wasm file even real?" π
β¨ NAME β¨
wasm-tools validate β Validate a WebAssembly binary π¦
πΈ SYNOPSIS πΈ
wasm-tools validate [OPTIONS] [INPUT]
π DESCRIPTION π
Validate a WebAssembly binary. Yes that's the whole vibe. π«Ά
This subcommand will validate a WebAssembly binary to determine if it's valid or not. It literally implements the validation algorithm of the WebAssembly specification. And here's the deal, no cap:
- if the binary is valid β the process exits with
0and prints nothing at all (silent queen behavior, we love her) - if the binary is not valid β nonzero exit status, plus an error message on
stderrπ
π Arguments:
[INPUT]β the input file to process.
If it's not provided, or if it's -, then stdin is read entirely and processed. Heads up: for most subcommands this input can either be a binary *.wasm file or a textual format *.wat file. Either one slays, she handles both. β¨
β¨ OPTIONS β¨
-f,--features <FEATURES>β comma-separated list of WebAssembly features to enable during validation.
If a - character is present in front of a feature it will disable that feature. For example -simd will disable the simd proposal. π
The placeholder all can be used to enable all wasm features and the term -all can be used to disable all features.
The default set of features enabled are all WebAssembly proposals that are at phase 4 or after. This means that the default set of features accepted are relatively bleeding edge. π
Versions of the WebAssembly specification can also be selected. The wasm1 or mvp feature can select the original WebAssembly specification and wasm2 can be used to select the 2.0 version.
Available feature options can be found in the wasmparser crate: <https://github.com/bytecodealliance/wasm-tools/blob/main/crates/wasmparser/src/features.rs> π₯
--generate-dwarf <lines|full>β optionally generate DWARF debugging information from WebAssembly text files.
When the input to this command is a WebAssembly text file, such as *.wat, then this option will instruct the text parser to insert DWARF debugging information to map binary locations back to the original source locations in the input *.wat file. This option has no effect if the INPUT argument is already a WebAssembly binary or if the text format uses (module binary ...). π
-gβ shorthand for--generate-dwarf fullβ¨-o,--output <OUTPUT>β where to place output.
If not provided then stdout is used. π
-v,--verbose...β use verbose output (-vinfo,-vvdebug,-vvvtrace) π--color <COLOR>β configuration over whether terminal colors are used in output.
Supports one of auto|never|always|always-ansi. The default is to detect what to do based on the terminal environment, for example by using isatty. π
[default: auto]
-h,--helpβ print help (see a summary with-h) π
π EXAMPLES π
# Validate `foo.wasm` with the default Wasm feature proposals.
$ wasm-tools validate foo.wasm
# Validate `foo.wasm` with more verbose output
$ wasm-tools validate -vv foo.wasm
# Validate `fancy.wasm` with all Wasm feature proposals enabled.
$ wasm-tools validate --features all fancy.wasm
# Validate `mvp.wasm` with the original wasm feature set enabled.
$ wasm-tools validate --features=wasm1 mvp.wasm
$ wasm-tools validate --features=mvp mvp.wasm
and that's the whole manual, bestie β go validate something and let it eat π β¨
this was wasm-tools validate, version 1.239.0+ds, dated August 2026 β mwah, take care of her π«Άπ
π¦ where this page comes from
- ubuntu stonking: wasm-tools 1.239.0+ds-10 Β· Apache-2.0 OR Apache-2.0 WITH LLVM exception OR MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms