A small React, TanStack Router, and Vite app for the Codewire walkthrough. It has two routes and a counter, so you can check navigation, page refresh, and interaction through a published port.
All Node.js commands below run inside the VM. The workspace image supplies
Node.js and npm; your machine only needs cw and the local VM runtime.
This public example needs no credentials.
Install Codewire, then clone this repository:
git clone https://github.com/codewiresh/example.git
cd exampleFrom the project folder:
cw setup --local
cw create --local --name hello --path . --no-profile
cw exec --local --in hello -- npm ci
cw exec --local --in hello -- npm run build
cw run --local --in hello --name web --detach -- npm run dev
cw ports --local hello --publish 3000Open http://127.0.0.1:3000. The page says Hello from Codewire.
Click the counter, visit How it works, and refresh that route.
Edit src/main.tsx to see Vite update the app.
The project folder is mounted live. Dependencies and build output stay on the
VM's disk. Vite listens on port 3000; --strictPort makes an accidental second
server fail instead of quietly choosing another port.
cw logs --local hello --session web
cw stop --local hello
cw rm --local helloStopping ends sessions and keeps the VM's disk. Removing the VM asks for confirmation and leaves this project folder on your machine.
For a hosted sandbox, clone this repository into the environment, run the
same npm commands in a cw session, and publish port 3000. The Vite config
allows Codewire's cwpreview.sh hostnames. Keep the default creator-only
access for a personal preview.
For a complete hosted walkthrough and optional private Git credentials, see the quickstart.
MIT licensed. See LICENSE.