← Wiki

CLI-first testing — every project gets a CLI mirror

2026-04-07 concept testingcliintegrationtddmethodology

Every project should have a CLI utility that mirrors the core business logic without UI. Not a separate tool — the same modules, different entry point.

lib/pipeline/       # Business logic (pure functions, no UI)
cli/main.ts         # CLI wrapper — calls same functions as UI
app/                # UI — calls same functions from lib/pipeline/
Makefile            # make integration — runs CLI with test data

Why this matters:

Rules:

This is a forcing function for clean architecture: if your business logic can’t run from a CLI, it’s too coupled to the framework.