Skip to content

Getting Started

Mog is a programmable spreadsheet platform with a Rust compute engine, CRDT collaboration, and canvas rendering. This guide will help you install the SDK, create your first workbook, and render interactive spreadsheets in your app.

Current version: 0.6.0

Prerequisites

  • Node.js 18+ — required for the TypeScript SDK and build tooling
  • pnpm (recommended) — or npm / yarn as your package manager
  • A modern browser with WebAssembly support (Chrome, Firefox, Safari, Edge)
  • Rust toolchain (optional) — only needed if building the compute engine from source

Installation

Install the Mog SDK with your preferred package manager:

Runtime

Package Manager

bash
npm install @mog-sdk/node

Other install methods

Docker

bash
docker run -p 3000:3000 ghcr.io/fundamental-research-labs/mog:latest

Homebrew

bash
brew install mog

Quick Start

Follow these steps to create and render your first Mog spreadsheet.

1Install the SDK

Install the Mog Node.js SDK. It includes prebuilt native binaries for macOS, Linux, and Windows.

bash
# npm
npm install @mog-sdk/node
# pnpm
pnpm add @mog-sdk/node

2Create a workbook

Create a workbook, set cell values, and evaluate formulas.

typescript
import { createWorkbook } from "@mog-sdk/node";
const wb = await createWorkbook();
const ws = wb.getActiveSheet();
await ws.setCell("A1", "Revenue");
await ws.setCell("A2", 150000);
await ws.setCell("A3", 230000);
await ws.setCell("A4", "=SUM(A2:A3)");
await wb.calculate();
const total = await ws.getValue("A4");
console.log(total); // 380000

3Embed in a web app

Drop a full spreadsheet into any React app with the embed component.

tsx
import { MogSheet } from "@mog-sdk/embed/react";
export function App() {
return (
<MogSheet
src="/data/sales.xlsx"
width={1200}
height={600}
/>
);
}

4Export to XLSX

Save your workbook as a standard Excel file.

typescript
import { createWorkbook, save } from "@mog-sdk/node";
const wb = await createWorkbook();
const ws = wb.getActiveSheet();
await ws.setCell("A1", "Hello");
await ws.setCell("B1", "=LEN(A1)");
await save(wb, "output.xlsx");

Building from Source

To build Mog from source, clone the repository and use pnpm to install dependencies and start the development server.

bash
git clone https://github.com/fundamental-research-labs/mog
cd mog
pnpm install --frozen-lockfile
pnpm typecheck
pnpm test

This requires Node.js 18+, pnpm, and the Rust toolchain for compute engine changes. Use the smallest relevant check for the package you are changing.

Next Steps