blog: Running Wasm Components From the Command Line (approved)#126
Conversation
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
Great point, thanks so. much! Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
vados-cosmonic
left a comment
There was a problem hiding this comment.
Hey @tpmccallum thanks for writing this, this is an awesome intro to how to use wasmtime --invoke! I left a bunch of comments but feel free to take or leave any of them -- most are almost NIT level.
I know that trying to strike the balance between technical and approachable is absolutely devilish to pull off so feel free to ignore any overly technical points I made!
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Victor Adossi <123968127+vados-cosmonic@users.noreply.github.com>
Co-authored-by: Victor Adossi <123968127+vados-cosmonic@users.noreply.github.com>
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
vados-cosmonic
left a comment
There was a problem hiding this comment.
Thanks for the hard work here -- I still have a few comments, but feel free to take/leave them!
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
_posts/2025-04-10-invoking-component-functions-in-wasmtime-cli.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Victor Adossi <123968127+vados-cosmonic@users.noreply.github.com>
pchickey
left a comment
There was a problem hiding this comment.
This is a great introductory blog post - thank you very much @tpmccallum for all your help getting the invoke PR across the finish line, and for writing this up!
vados-cosmonic
left a comment
There was a problem hiding this comment.
Thanks for making the changes @tpmccallum
On the interface/raw function export change, I think the --invoke invocation would change, so if you decide to take that change then running through it just once more is probably worth doing :)
|
Thanks, @pchickey Thanks, @vados-cosmonic wasm_answer % wasmtime --version
wasmtime 33.0.0 (4d0a43fd0 2025-04-14)
wasm_answer % cargo component build --target wasm32-wasip2 --release
Generating bindings for wasm_answer (src/bindings.rs)
Finished `release` profile [optimized] target(s) in 0.01s
wasm_answer % wasmtime run --invoke 'get-answer()' target/wasm32-wasip2/release/wasm_answer.wasm
42Please let me know if you need me to tweak the date in the Chat soon |
|
Thanks for really putting in the work here @tpmccallum -- this is going to be an amazing entry point for people into the ecosystem. |
Just setting the `date` frontmatter to a future publishing date.
pchickey
left a comment
There was a problem hiding this comment.
Only marking this as "request changes" because I think we need to delay publishing until Wasmtime 33 is out. Also, I believe the policy is we need someone on the TSC to sign this off? one of @ricochet @ospencer @abrown @tschneidereit please
| * [Rust](https://www.rust-lang.org/tools/install) (if you already have Rust installed, make sure you are on [the latest version](https://github.com/rust-lang/rust/releases)), | ||
| * [`cargo`](https://crates.io/crates/cargo) (if already installed, please make sure you are on [the latest version](https://crates.io/crates/cargo)), | ||
| * [`cargo component`](https://crates.io/crates/cargo-component) (if already installed, please make sure you are on [the latest version](https://crates.io/crates/cargo-component)), and | ||
| * [`wasmtime` CLI](https://docs.wasmtime.dev/cli-install.html) (or use a [precompiled binary](https://docs.wasmtime.dev/cli-install.html#download-precompiled-binaries)). If already installed, ensure you are using [the latest version](https://github.com/bytecodealliance/wasmtime/releases). |
There was a problem hiding this comment.
We should wait to publish this until Wasmtime 33 is out - invoke didnt make it into the Wasmtime 32 release. I'd amend this to say it requires wasmtime 33 specifically, rather than the latest.
There was a problem hiding this comment.
There was a problem hiding this comment.
@tpmccallum and I have talked about this but for anyone else wondering: this is on the agenda for the next TSC meeting (no hurry since we expect it to be published later in May).
abrown
left a comment
There was a problem hiding this comment.
This was discussed today in the TSC and we are all in favor of this being merged once Wasmtime v33 is out. Thanks again for working on this!
ospencer
left a comment
There was a problem hiding this comment.
This will be an excellent addition to the blog; thanks @tpmccallum for writing, and thank you to the others for their thorough reviews!
This is an article demonstrating how to use the
wasmtime run --invokefeature. It explains WAVE syntax and implements a component with an exported function that is invoked in the Wasmtime CLI.Relates to Zulip chat at #wasmtime > Article announcing the new `--invoke` feature. @ 💬
Related GitHub URLs:
run --invokefor components using wave wasmtime#10054