Start here

Getting started

Describe the processes your project runs side by side in one config file, then start, watch and stop them as a single stack.

Node 22.18 or later, on macOS or Linux.

  1. Install

    npm install --save-dev @aip-tech/braid
    pnpm add --save-dev @aip-tech/braid
    yarn add --dev @aip-tech/braid
  2. Describe your processes

    Create braid.config.ts next to your package.json:

    braid.config.ts
    import { defineConfig } from "@aip-tech/braid";
    
    export default defineConfig({
    	processes: [
    		{
    			name: "api",
    			command: "pnpm",
    			args: ["--filter", "./api", "dev"],
    			watch: ["api/src"],
    		},
    		{ name: "web", command: "pnpm", args: ["--filter", "./web", "dev"] },
    	],
    });

    If your package.json doesn't set "type": "module" (npm init sets "commonjs"), name the file braid.config.mts instead. braid finds either.

    defineConfig gives you autocomplete and type checking. Here api restarts whenever a file under api/src changes; web runs a dev server with its own reload.

  3. Start the stack

    npx braid start

    braid starts every process in a background daemon and prints a summary:

    [braid] 2 processes running (pid 40213)
      ● api  pid 40214
      ● web  pid 40215

    Closing the terminal doesn't stop it.

  4. Check on it, then stop it

    npx braid status          # what's running, with CPU and memory
    npx braid logs --follow   # every process's output, live
    npx braid stop            # stop everything

Add "dev": "braid start --foreground" to your package.json scripts to run the stack attached to your terminal instead, with every process's output streamed there until Ctrl+C.

Next steps