How to Set Up the Corsair Development Environment: Complete Monorepo Guide

Set up the Corsair development environment by installing Node.js 22+ and pnpm 10, cloning the repository, running pnpm install, and verifying with pnpm typecheck, pnpm lint, and pnpm test.

The corsairdev/corsair repository is a TypeScript monorepo containing a core integration framework and dozens of plugin packages. This guide walks through the complete environment setup based on the official source code in CONTRIBUTING.md and repository structure.


Prerequisites for the Corsair Development Environment

Before cloning, ensure your system meets these requirements:

  • Node.js 22+ — The plugin generator relies on --experimental-strip-types for TypeScript execution
  • pnpm 10 — The exclusive package manager for workspace dependency resolution

Verify versions with:

node --version  # v22.x.x or higher

pnpm --version  # 10.x.x

Clone and Install the Corsair Repository

The corsairdev/corsair workflow requires a fresh fork for each integration to avoid stale code conflicts.

Fork and Clone


# 1. Delete any existing fork on GitHub (if returning for a new integration)

# 2. Fork via https://github.com/corsairdev/corsair

# 3. Clone into a dedicated directory

git clone https://github.com/<your-username>/corsair.git corsair-<integration-slug>
cd corsair-<integration-slug>

Install Workspace Dependencies

pnpm install

This command resolves all workspace dependencies, builds type declarations across packages, and populates node_modules/.pnpm with the shared store.


Verify Your Corsair Development Environment

Run the repository's standard health checks to confirm everything works:

pnpm typecheck   # Static TypeScript validation

pnpm lint        # Biome linting across all packages

pnpm test        # Unit and integration test suite

pnpm build       # Compile all packages in dependency order

All four commands must pass before proceeding with plugin development.


Generate a Plugin with the Corsair CLI

The CLI package at packages/cli/ provides scaffolding commands to bootstrap new integrations.

Create a New Plugin

pnpm run generate:plugin MyNewPlugin

This generates:

  • A new package at packages/my-new-plugin/
  • Standardized source structure following existing plugin conventions
  • Registration hooks in the test harness at demo/testing/src/server/corsair.ts

Develop in Watch Mode

Keep your plugin compiling automatically during development:

pnpm --filter my-new-plugin dev

Run the Corsair Studio Locally

The Studio package (packages/studio/) provides a web UI for inspecting running Corsair instances.

Start Core and Studio

Terminal 1 — Core server:

pnpm --filter @corsair-dev/corsair dev

Terminal 2 — Studio UI:

pnpm --filter @corsair-dev/studio dev

The Studio launches at http://localhost:3000 and connects to the in-process core server for real-time inspection.


Key Architecture Locations in corsairdev/corsair

Understanding the monorepo structure accelerates development:

Component Location Purpose
Core framework packages/corsair/ Runtime, database adapters, authentication plumbing
CLI tooling packages/cli/ Plugin generation, credential storage, OAuth flows
Studio UI packages/studio/ Local development and debugging interface
MCP SDK packages/mcp/ Agent-facing server adapters
Test harness demo/testing/ E2E testing sandbox for plugins

Reference the authoritative documentation:


Complete Development Workflow Example


# Initial setup

git clone https://github.com/<your-username>/corsair.git corsair-slack
cd corsair-slack
pnpm install

# Verification

pnpm typecheck && pnpm lint && pnpm test

# Create and develop plugin

pnpm run generate:plugin Slack
pnpm --filter slack dev

# Test via Studio

pnpm --filter @corsair-dev/corsair dev  # terminal 1

pnpm --filter @corsair-dev/studio dev    # terminal 2

# Final validation

cd demo/testing
pnpm test

Summary

Setting up the Corsair development environment requires:

  • Node.js 22+ and pnpm 10 as non-negotiable prerequisites
  • Fresh fork and clone for each integration to prevent state conflicts
  • pnpm install to bootstrap the entire workspace dependency graph
  • Four verification commands (typecheck, lint, test, build) to validate health
  • CLI generator at packages/cli/ for consistent plugin scaffolding
  • Studio UI at packages/studio/ for interactive development and debugging

Frequently Asked Questions

What Node.js version does Corsair require?

Corsair requires Node.js 22 or higher because the plugin generator uses the --experimental-strip-types flag for native TypeScript execution without transpilation.

Why does Corsair use pnpm instead of npm or yarn?

The corsairdev/corsair monorepo relies on pnpm 10 for its workspace-aware dependency resolution, content-addressable store in node_modules/.pnpm, and deterministic lockfile behavior across the core framework and plugin packages.

How do I test my plugin without publishing it?

Use the local Studio (pnpm --filter @corsair-dev/studio dev) connected to the core server, or run the demo testing suite at demo/testing/ via pnpm test to exercise endpoints in an isolated environment.

Where are generated plugin files created?

The CLI writes new plugins to packages/<plugin-name>/ following the scaffold defined in packages/cli/, and automatically registers them in demo/testing/src/server/corsair.ts for immediate testability.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →