OpenWork Package.json Scripts: Complete Development and Build Command Reference
TLDR: OpenWork's monorepo defines 40+ npm scripts in the root 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. 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 testingdev:electron– Starts only the Electron desktop client in development modedev:ui– Runs the Next.js web interface independentlydev:den– Launches the Den backend with multi-organization supportdev: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 UIdemo:electron– Launches the Electron demo with pre-configured test datademo:reset– Cleans and resets demo data for fresh testing cyclesdev: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 viascripts/build.mjsbuild:ui– Compiles the Next.js UI for production deploymentbuild:web– Bundles the Den web applicationpreview– 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 packagestest:e2e– Executes the Playwright end-to-end test suite for the main applicationtest:health– Performs health checks on running servicestest:todos– Validates TODO comments and task trackingcheck: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 viaevals/runner/run.mjsevals:test– Executes specific test evaluationsevals:spec– Runs specification-based evaluationsfraimz– Generates demo-first validation proofs ("fraimz") for the current codebase
Release Management Scripts
The release pipeline automates versioning and distribution:
release:prepare– Executesscripts/release/prepare.mjsto generate changelogs, bump versions, and create Git tagsrelease:review– Opens the release for team review before publicationrelease: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 usingpackaging/docker/docker-compose.web-local.ymldev:den:mysql:down– Stops and removes the MySQL containerdev:den:db-push– Pushes the Prisma schema to the development databasedev: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:
# 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:
scripts/dev-two-electron-demo.mjs– Helper for launching dual Electron instances for multi-window testingscripts/build.mjs– Orchestrates the complex build pipeline across the monoreposcripts/release/prepare.mjs– Handles changelog generation and version tagging logicevals/runner/run.mjs– Entry point for the evaluation and fraimz execution engine
Summary
- OpenWork's root
package.jsonserves 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 throughscripts/build.mjs - Testing scripts (
typecheck,test:e2e) enforce code quality across workspace packages - Evaluation commands (
evals,fraimz) run AI validation throughevals/runner/run.mjs - Release automation (
release:prepare,bump:minor) handles versioning viascripts/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 but reference packaging/docker/docker-compose.web-local.yml for container orchestration and use Prisma CLI commands to manage schema migrations and demo data seeding.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →