All Docs Quick Start
Getting Started

Quick Start

This guide assumes you've already installed the SDK. By the end you'll have a running app shell with a WebView2 panel embedded in a Win32 window.

1. Create a New Project

pi-sdk new my-app
cd my-app

This scaffolds:

my-app/
  src/
    main.cpp          # Win32 entry point + WebView2 init
    controller.cpp    # App controller stub
  ui/
    index.html        # WebView2 HTML entry point
    main.js           # JS side of the message bridge
  assets/
  CMakeLists.txt
  pi-sdk.json         # Project manifest

2. Build

pi-sdk build

On first build, CMake configures and MSVC compiles. Subsequent builds are incremental. Output goes to dist/:

dist/
  my-app.exe
  my-app-core.dll
  https://cdn.proginsight.com/proginsight/

3. Run

pi-sdk run

Or launch dist/my-app.exe directly. You should see the default shell window: a 1200×800 Win32 frame with a WebView2 panel showing the scaffold UI.

4. Make a Change

Open ui/index.html and change the title text. Save, then rebuild:

pi-sdk build && pi-sdk run

For faster iteration, start the dev server (serves the ui/ directory with live-reload):

pi-sdk dev

In dev mode, changes to ui/ files reload instantly without a full rebuild. C++ changes still require pi-sdk build.

5. Send a Message from JS to C++

In ui/main.js:

// Send a message to the C++ host
window.chrome.webview.postMessage(JSON.stringify({
    type: 'greet',
    payload: { name: 'World' }
}));

In src/controller.cpp, the scaffold already wires AddWebMessageReceived:

webview->add_WebMessageReceived(
    Callback<ICoreWebView2WebMessageReceivedEventHandler>(
        [this](ICoreWebView2*, ICoreWebView2WebMessageReceivedEventArgs* args) {
            wil::unique_cotaskmem_string raw;
            args->TryGetWebMessageAsString(&raw);
            // raw.get() is the JSON string — parse and dispatch
            return S_OK;
        }
    ).Get(), nullptr
);

What's Next

  • Configuration Reference
  • Message Bridge API
  • Packaging & Distribution