A command line client for Valkey, sending its arguments as a command and printing the reply.
Composed of internal-cli and a tcp-connector configured with wasi:config.
Every connection the cli makes is through the connector, so the cli is behind a componentized:sockets gate with the tcp-connector-latch. It can only reach the server it is configured for, see network access. The gate and the latch log denials with to-stderr, keeping them out of the cli's output.
Start a Valkey server:
docker run --rm -p 6379:6379 valkey/valkey:9wasmtime run -Sinherit-network -Sallow-ip-name-lookup -Sconfig -Wcomponent-model-map -Wcomponent-model-implements -Wcomponent-model-threading \
target/components/cli/cli.wasm pingPONGThe server is configured with wasi:config variables, e.g. -Sconfig-var=hostname=localhost, see tcp-connector for the keys and their defaults. The latch follows the same config.
The gate needs the component model's implements and threading features, -Wcomponent-model-implements -Wcomponent-model-threading.
See cli.wac for the composition.