wasmedge(1)

πŸ“¦
version 0.16.1 Β· 5 versions
, in ubuntu stonking

πŸ’– wasmedge(1) β€” General Commands Manual πŸ’–

okay bestie, sit down, hydrate, and let me tell you about wasmedge β€” the standalone runtime for WebAssembly. this is section 1 of the General Commands Manual, so like, it's a command, and it's iconic, and you're gonna learn it. no cap. 🫢


✨ SYNOPSIS ✨

wasmedge [SUBCOMMAND] [OPTIONS] [--] WASM_OR_SO [ARG ...]

like, that's the whole vibe in one line. subcommand? maybe. options? maybe. the wasm file or shared object? mandatory, bestie. args after it? sure, why not.


🌸 DESCRIPTION 🌸

so WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime, and it's built for cloud native, edge, and decentralized applications. it literally powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices. the range?? unmatched. πŸ’…

the WasmEdge Runtime hands you a well-defined execution sandbox for the WebAssembly bytecode program it's containing. what that means is: it gives you isolation and protection for your operating system resources β€” think file system, sockets, environment variables, processes β€” plus memory space. the most important use case, fr fr, is safely executing user-defined or community-contributed code as plug-ins inside a software product (like SaaS, software-defined vehicles, edge nodes, or even blockchain nodes β€” yes, all of those). and that's how it lets third-party developers, vendors, suppliers, and community members extend and customize the software product. entrusting randos with your runtime but safely? that's the whole point. πŸ‘‘

wasmedge takes a file path, WASM_OR_SO, pointing at a WebAssembly file or a native shared library object β€” the kind generated by wasmedge compile(1). ok so yes, that cross-reference is doing a lot of work, keep reading.

ARG is the optional command line arguments array, and the way it behaves depends on the mode, so pay attention bestie:

  • In reactor mode, the first argument is gonna be the function name, and the arguments after ARG[0] will be parameters of wasm function ARG[0]. she's calling functions directly, she's that girl.
  • In command mode, the arguments are the command line arguments of the WASI _start function. they're also known as command line arguments (argv) for a standalone C/C++ program. so like, classic main-argc-argv energy. πŸŽ€

🌈 SUBCOMMANDS 🌈

  • compile β€” the WasmEdge compiler subcommand. see wasmedge-compile(1) for all the options that apply in this mode. this is the "make it fast ahead of time" era.
  • run β€” the WasmEdge runtime tool subcommand. wasmedge run is literally just an alias of wasmedge without the --version option. the options for this mode? they're down below, keep scrolling. ⬇️

✨ OPTIONS ✨

πŸŽ€ Generic program information

  • -h, --help β€” show the help messages. and it will ignore every other argument below, so don't bother stacking them, she's not listening.
  • -v, --version β€” show the version information. same energy: it will ignore all the other arguments below.

πŸ’œ Basic options

  • --reactor β€” enable reactor mode. reactor mode calls _initialize if it's exported.
  • --dir β€” bind directories into the WASI virtual filesystem. each directory can be specified as --dir host_path. you can also map a guest directory onto a host directory with --dir guest_path:host_path, where guest_path is the path that will correspond to host_path for calls like fopen inside the guest. mapping?? we love a good mapping. πŸ—ΊοΈ
  • --env β€” environmental variables. each variable can be specified as --env NAME=VALUE.
  • --force-interpreter β€” forcibly run WASM in interpreter mode. no compiled code, just vibes.
  • --forbidden-plugin β€” the list of plugins to ignore. not invited, blocked, periodt.

πŸ“Š Statistics information

  • --enable-time-measuring β€” enable generating code for counting time during execution. ⏱️
  • --enable-gas-measuring β€” enable generating code for counting gas burned during execution. β›½
  • --enable-instruction-count β€” enable generating code for counting WebAssembly instructions executed. counting each and every one, meticulous queen.
  • --enable-all-statistics β€” enable generating code for every statistics option β€” that includes instruction counting, gas measuring, and execution time. all of them. the whole set. 🌟

🚧 Resource limitations

  • --time-limit β€” limitation of maximum time (in milliseconds) for execution. the default value is 0, which means no limitations at all. so if you don't set it, she will run forever and that's on you.
  • --gas-limit β€” limitation of execution gas. the upper bound can be specified as --gas-limit GAS_LIMIT.
  • --memory-page-limit β€” limitation of pages (as size of 64 KiB) in every memory instance. the upper bound can be specified as --memory-page-limit PAGE_COUNT.

🧚 WebAssembly proposals

  • --disable-import-export-mut-globals β€” disable the Import/Export of mutable globals proposal.
  • --disable-non-trap-float-to-int β€” disable the Non-trapping float-to-int conversions proposal.
  • --disable-sign-extension-operators β€” disable the Sign-extension operators proposal.
  • --disable-multi-value β€” disable the Multi-value proposal.
  • --disable-bulk-memory β€” disable the Bulk memory operations proposal.
  • --disable-reference-types β€” disable the Reference types proposal.
  • --disable-simd β€” disable the SIMD proposal.
  • --enable-multi-memory β€” enable the Multiple memories proposal.
  • --enable-tail-call β€” enable the Tail-call proposal.
  • --enable-extended-const β€” enable the Extended-const proposal.
  • --enable-threads β€” enable the Threads proposal.
  • --enable-all β€” enable all features. literally all of them. go off. πŸ‘‘

🌟 EXAMPLE 🌟

πŸ“ Call a WebAssembly function

say you've got a WebAssembly program sitting in a file called fibonacci.wasm, set up so it exports a fib() function and takes a single i32 integer as the input parameter. you can run wasmedge in reactor mode and invoke that exported function like this:

$ wasmedge --reactor fibonacci.wasm fib 10

look at her go. ✨

πŸ“ Execute a standalone WebAssembly program

now say you've got a WebAssembly program containing a main() function that prints out hello followed by the command line arguments. that one goes like:

$ wasmedge hello.wasm world

πŸ’– AUTHOR πŸ’–

Copyright Β© 2019-2022 Second State INC. Licensed under the Apache License, Version 2.0.


πŸ‘€ SEE ALSO πŸ‘€

Regular manual pages

Full documentation

a complete manual of WasmEdge can be found online. iykyk. 🌐


and that's the tea, bestie β€” this page was dated 2026-09-08 and it lives in the wasmedge(1) slot of your manual, so go forth and run some wasm. obsessed with you. mwah. πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from