# OpenWork Package.json Scripts: Complete Development and Build Command Reference

> Explore OpenWork's package.json scripts for seamless development and build commands. Automate workflows for Electron, web UI, and backend services with this comprehensive reference.

- Repository: [Different AI/openwork](https://github.com/different-ai/openwork)
- Tags: api-reference
- Published: 2026-08-01

---

**TLDR:** OpenWork's monorepo defines 40+ npm scripts in the root [`package.json`](https://github.com/different-ai/openwork/blob/main/package.json) that automate development, testing, evaluation, and release workflows across the Electron desktop client, web UI, and Den backend services.

The `different-ai/openwork` repository orchestrates its complex architecture through a centralized script system defined in the root [`package.json`](https://github.com/different-ai/openwork/blob/main/package.json). These openwork package.json scripts leverage pnpm workspaces to target specific packages—such as `@openwork/app` and `@openwork-ee/den-api`—while providing unified commands for the entire development lifecycle.

## Development and Demo Environment Scripts

### Local Development Commands

The primary entry point for developers is the `dev` script, which launches the full stack including the desktop client, UI, and backend services. For targeted development, the repository provides granular options:

- **`dev`** – Starts the complete development stack (desktop + UI + Den backend)
- **`dev:worktree`** – Launches development mode with git worktree support for parallel branch testing
- **`dev:electron`** – Starts only the Electron desktop client in development mode
- **`dev:ui`** – Runs the Next.js web interface independently
- **`dev:den`** – Launches the Den backend with multi-organization support
- **`dev:den-local`** – Runs the Den backend in local development mode

These commands utilize pnpm's `--filter` flag to execute only within relevant workspace packages, ensuring fast startup times and isolated dependency resolution.

### Demo and Sandbox Environments

For testing complete workflows, the demo scripts provision full-stack environments:

- **`demo:den`** – Spins up the Den demo environment with multi-org mode and opens the web UI
- **`demo:electron`** – Launches the Electron demo with pre-configured test data
- **`demo:reset`** – Cleans and resets demo data for fresh testing cycles
- **`dev:sandbox`** – Initializes an isolated sandbox environment for experimental features

## Build, Preview, and Testing Pipeline

### Production Build Commands

The build system compiles TypeScript and bundles assets for distribution:

- **`build`** – Executes the full monorepo build pipeline via `scripts/build.mjs`
- **`build:ui`** – Compiles the Next.js UI for production deployment
- **`build:web`** – Bundles the Den web application
- **`preview`** – Serves a production preview of the built UI for manual verification

### Quality Assurance and Type Checking

Quality gates enforce code standards before commits:

- **`typecheck`** – Runs TypeScript compilation checks across all workspace packages
- **`test:e2e`** – Executes the Playwright end-to-end test suite for the main application
- **`test:health`** – Performs health checks on running services
- **`test:todos`** – Validates TODO comments and task tracking
- **`check:enterprise-mcp-mock-server`** – Validates the enterprise mock server configuration

## Evaluation and Release Automation

### Evaluation Harness Commands

OpenWork includes a specialized evaluation framework for AI validation:

- **`evals`** – Runs the full evaluation suite via `evals/runner/run.mjs`
- **`evals:test`** – Executes specific test evaluations
- **`evals:spec`** – Runs specification-based evaluations
- **`fraimz`** – Generates demo-first validation proofs ("fraimz") for the current codebase

### Release Management Scripts

The release pipeline automates versioning and distribution:

- **`release:prepare`** – Executes `scripts/release/prepare.mjs` to generate changelogs, bump versions, and create Git tags
- **`release:review`** – Opens the release for team review before publication
- **`release:ship`** – Publishes the prepared release to distribution channels

### Version Bumping Utilities

Semantic versioning commands for the `@openwork/app` package:

- **`bump:patch`** – Increments the patch version (bug fixes)
- **`bump:minor`** – Increments the minor version (new features)
- **`bump:major`** – Increments the major version (breaking changes)
- **`bump:set`** – Sets a specific version number

## Infrastructure and Database Management

For local backend development, Docker and Prisma management scripts automate database operations:

- **`dev:den:mysql`** – Starts the MySQL container using [`packaging/docker/docker-compose.web-local.yml`](https://github.com/different-ai/openwork/blob/main/packaging/docker/docker-compose.web-local.yml)
- **`dev:den:mysql:down`** – Stops and removes the MySQL container
- **`dev:den:db-push`** – Pushes the Prisma schema to the development database
- **`dev:den:seed-demo`** – Seeds the database with demonstration data for testing

These infrastructure helpers ensure consistent database states across development environments without manual Docker commands.

## Practical Usage Examples

Execute these commands from the repository root using pnpm:

```bash

# Start the complete development stack

pnpm run dev

# Run only the desktop client

pnpm run dev:electron

# Spin up the full demo environment

pnpm run demo:den

# Build production bundles

pnpm run build:ui
pnpm run build:web

# Run evaluation suite

pnpm run evals

# Prepare a new release

pnpm run release:prepare

# Bump version to next minor release

pnpm run bump:minor

```

The scripts automatically resolve to the correct sub-projects through pnpm workspace filters, eliminating the need to navigate into individual package directories.

## Key Implementation Files

Several Node.js modules implement the script behavior referenced in [`package.json`](https://github.com/different-ai/openwork/blob/main/package.json):

- **`scripts/dev-two-electron-demo.mjs`** – Helper for launching dual Electron instances for multi-window testing
- **`scripts/build.mjs`** – Orchestrates the complex build pipeline across the monorepo
- **`scripts/release/prepare.mjs`** – Handles changelog generation and version tagging logic
- **`evals/runner/run.mjs`** – Entry point for the evaluation and fraimz execution engine

## Summary

- OpenWork's root [`package.json`](https://github.com/different-ai/openwork/blob/main/package.json) serves as the central command catalogue for the pnpm monorepo
- **Development scripts** (`dev`, `dev:electron`, `dev:den`) support both full-stack and targeted development modes
- **Demo scripts** (`demo:den`, `demo:reset`) provide clean, reproducible test environments
- **Build commands** (`build`, `build:ui`, `build:web`) compile production assets through `scripts/build.mjs`
- **Testing scripts** (`typecheck`, `test:e2e`) enforce code quality across workspace packages
- **Evaluation commands** (`evals`, `fraimz`) run AI validation through `evals/runner/run.mjs`
- **Release automation** (`release:prepare`, `bump:minor`) handles versioning via `scripts/release/prepare.mjs`
- **Infrastructure helpers** manage MySQL containers and Prisma schema migrations

## Frequently Asked Questions

### How do I start only the Electron desktop client without the backend?

Run `pnpm run dev:electron` from the repository root. This script uses pnpm's `--filter @openwork/app` flag to target only the Electron package, launching the desktop client in development mode without starting the Den backend services or web UI.

### What is the difference between `dev:den` and `demo:den` scripts?

The `dev:den` script starts the Den backend in local development mode with hot-reloading enabled, while `demo:den` initializes a complete demo environment including database seeding, multi-organization configuration, and automatic opening of the web interface for demonstration purposes.

### How does the release preparation process work in OpenWork?

The `release:prepare` script executes `scripts/release/prepare.mjs`, which automatically generates changelogs from conventional commits, bumps version numbers across relevant packages, creates Git tags, and stages the release for review before the `release:ship` command publishes to distribution channels.

### Where are the database infrastructure scripts defined?

Database management commands like `dev:den:mysql` and `dev:den:db-push` are defined in the root [`package.json`](https://github.com/different-ai/openwork/blob/main/package.json) but reference [`packaging/docker/docker-compose.web-local.yml`](https://github.com/different-ai/openwork/blob/main/packaging/docker/docker-compose.web-local.yml) for container orchestration and use Prisma CLI commands to manage schema migrations and demo data seeding.