Skip to content

Commit defce37

Browse files
committed
docs: update documentation about cat plugin
1 parent bb78bc3 commit defce37

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Those hosts then run the same codebase which is compiled to WebAssembly:
2525
- the REPL logic
2626
- the plugins
2727

28+
The plugins like `ls` or `cat` can interact with the filesystem using the primitives of the languages they are written in.
29+
30+
- on the CLI, a folder from the disk is mounted via the `--dir` flag
31+
- on the browser, a virtual filesystem is mounted, the I/O operations are forwarded via the `@bytecodealliance/preview2-shim/filesystem` shim, which shims the `wasi:filesystem` filesystem interface
32+
2833
<p align="center"><a href="https://topheman.github.io/webassembly-component-model-experiments/"><img src="./packages/web-host/public/wasi.png" alt="Demo" /></a></p>
2934
<p align="center">
3035
Check the online demo at<br/><a href="https://topheman.github.io/webassembly-component-model-experiments/">topheman.github.io/webassembly-component-model-experiments</a>
@@ -59,7 +64,8 @@ pluginlab\
5964
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_greet.wasm\
6065
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_ls.wasm\
6166
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_echo.wasm\
62-
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm
67+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm\
68+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_cat.wasm
6369
```
6470

6571
Other flags:
@@ -76,13 +82,15 @@ pluginlab\
7682
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_greet.wasm\
7783
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_ls.wasm\
7884
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_echo.wasm\
79-
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm
85+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm\
86+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_cat.wasm
8087
[Host] Starting REPL host...
8188
[Host] Loading REPL logic from: https://topheman.github.io/webassembly-component-model-experiments/plugins/repl_logic_guest.wasm
8289
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_greet.wasm
8390
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_ls.wasm
8491
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_echo.wasm
8592
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm
93+
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_cat.wasm
8694
repl(0)> echo foo
8795
foo
8896
repl(0)> echo $ROOT/$USER
@@ -158,7 +166,8 @@ This will (see [justfile](./justfile)):
158166
--plugins ./target/wasm32-wasip1/debug/plugin_greet.wasm\
159167
--plugins ./target/wasm32-wasip1/debug/plugin_ls.wasm\
160168
--plugins ./target/wasm32-wasip1/debug/plugin_echo.wasm\
161-
--plugins ./target/wasm32-wasip1/debug/plugin_weather.wasm
169+
--plugins ./target/wasm32-wasip1/debug/plugin_weather.wasm\
170+
--plugins ./target/wasm32-wasip1/debug/plugin_cat.wasm
162171
```
163172

164173
This will run the `pluginlab` binary which will itself:

crates/pluginlab/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Those hosts then run the same codebase which is compiled to WebAssembly:
2020
- the REPL logic
2121
- the plugins
2222

23+
The plugins like `ls` or `cat` can interact with the filesystem using the primitives of the languages they are written in.
24+
25+
- on the CLI, a folder from the disk is mounted via the `--dir` flag
26+
- on the browser, a virtual filesystem is mounted, the I/O operations are forwarded via the `@bytecodealliance/preview2-shim/filesystem` shim, which shims the `wasi:filesystem` filesystem interface
27+
2328
More details on the github repo: [topheman/webassembly-component-model-experiments](https://github.com/topheman/webassembly-component-model-experiments).
2429

2530
## Install
@@ -38,7 +43,8 @@ pluginlab\
3843
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_greet.wasm\
3944
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_ls.wasm\
4045
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_echo.wasm\
41-
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm
46+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm\
47+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_cat.wasm
4248
```
4349

4450
Other flags:
@@ -56,13 +62,15 @@ pluginlab\
5662
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_greet.wasm\
5763
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_ls.wasm\
5864
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_echo.wasm\
59-
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm
65+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm\
66+
--plugins https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_cat.wasm
6067
[Host] Starting REPL host...
6168
[Host] Loading REPL logic from: https://topheman.github.io/webassembly-component-model-experiments/plugins/repl_logic_guest.wasm
6269
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_greet.wasm
6370
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_ls.wasm
6471
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_echo.wasm
6572
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_weather.wasm
73+
[Host] Loading plugin: https://topheman.github.io/webassembly-component-model-experiments/plugins/plugin_cat.wasm
6674
repl(0)> echo foo
6775
foo
6876
repl(0)> echo $ROOT/$USER

0 commit comments

Comments
 (0)