Wasmtime WebAssembly Runtime Usage: wasmtime [OPTIONS] ... wasmtime Commands: run Runs a WebAssembly module config Controls Wasmtime configuration settings compile Compiles a WebAssembly module explore Explore the compilation of a WebAssembly module to native code serve Serves requests from a wasi-http proxy component settings Displays available Cranelift settings for a target wast Runs a WebAssembly test script file completion Generate shell completions for the `wasmtime` CLI objdump Inspect `*.cwasm` files output from Wasmtime hot-blocks Profile a Wasm module's execution and print the hottest basic blocks wizer Wizer: the WebAssembly pre-initializer! help Print this message or the help of the given subcommand(s) Arguments: ... The WebAssembly module to run and arguments to pass to it. Arguments passed to the wasm module will be configured as WASI CLI arguments unless the `--invoke` CLI argument is passed in which case arguments will be interpreted as arguments to the function specified. Options: -O, --optimize Optimization and tuning related options for wasm performance, `-O help` to see all -C, --codegen Codegen-related configuration options, `-C help` to see all -D, --debug Debug-related configuration options, `-D help` to see all -W, --wasm Options for configuring semantic execution of WebAssembly, `-W help` to see all -S, --wasi Options for configuring WASI and its proposals, `-S help` to see all -R, --record Options to enable and configure execution recording, `-R help` to see all. Generates a serialized trace of the Wasm module execution that captures all non-determinism observable by the module. This trace can subsequently be re-executed in a deterministic, embedding-agnostic manner (see the `wasmtime replay` command). Note: Minimal configuration options for deterministic Wasm semantics will be enforced during recording by default (NaN canonicalization, deterministic relaxed SIMD). --target The target triple; default is the host triple --config Use the specified TOML configuration file. This TOML configuration file can provide same configuration options as the `--optimize`, `--codegen`, `--debug`, `--wasm`, `--wasi` CLI options, with a couple exceptions. Additional options specified on the command line will take precedent over options loaded from this TOML file. --allow-precompiled Allow executing precompiled WebAssembly modules as `*.cwasm` files. Note that this option is not safe to pass if the module being passed in is arbitrary user input. Only `wasmtime`-precompiled modules generated via the `wasmtime compile` command or equivalent should be passed as an argument with this option specified. --profile Profiling strategy (valid options are: perfmap, jitdump, vtune, guest) The perfmap, jitdump, and vtune profiling strategies integrate Wasmtime with external profilers such as `perf`. The guest profiling strategy enables in-process sampling and will write the captured profile to `wasmtime-guest-profile.json` by default which can be viewed at https://profiler.firefox.com/. The `guest` option can be additionally configured as: --profile=guest[,path[,interval]] where `path` is where to write the profile and `interval` is the duration between samples. When used with `--wasm-timeout` the timeout will be rounded up to the nearest multiple of this interval. --dir Grant access of a host directory to a guest. If specified as just `HOST_DIR` then the same directory name on the host is made available within the guest. If specified as `HOST::GUEST` then the `HOST` directory is opened and made available as the name `GUEST` in the guest. --env Pass an environment variable to the program. The `--env FOO=BAR` form will set the environment variable named `FOO` to the value `BAR` for the guest program using WASI. The `--env FOO` form will set the environment variable named `FOO` to the same value it has in the calling process for the guest, or in other words it will cause the environment variable `FOO` to be inherited. --invoke The name of the function to run --preload Load the given WebAssembly module before the main module --argv0 Override the value of `argv[0]`, typically the name of the executable of the application being run. This can be useful to pass in situations where a CLI tool is being executed that dispatches its functionality on the value of `argv[0]` without needing to rename the original wasm binary. -h, --help Print help (see a summary with '-h') -V, --version Print version If a subcommand is not provided, the `run` subcommand will be used. Usage examples: Running a WebAssembly module with a start function: wasmtime example.wasm Passing command line arguments to a WebAssembly module: wasmtime example.wasm arg1 arg2 arg3 Invoking a specific function (e.g. `add`) in a WebAssembly module: wasmtime --invoke add example.wasm 1 2