Setting Up Meta-CLI

Introduction

In my journey of building Progressive Web Application (PWA) tools for personal use, my collection has grown to 30 independent GitHub repositories.

  • Manually running npm outdated, npx taze -w, and npm update, followed by TypeScript type checking (tsc --noEmit) and Biome formatting (biome check --write) individually across each project directory, quickly became tedious and time-consuming.

To address this, I evaluated two potential architectural paths:

  • Monorepo Approach: Consolidate all companion applications into a single repository to share configurations and centralize dependency management with a single lockfile.
  • Multi-Repo + Orchestrator CLI Approach (Meta-Repository Pattern): Retain separate repositories while building a custom CLI tool to orchestrate batch tasks from a single interface.

I chose the Multi-Repo + Orchestrator pattern as the basis for RxCLI for the following reasons:

  • Independent Repositories: Each project continues to live in its own standalone GitHub repository with its own deployment pipeline and Git history.
  • Zero Cross-Contamination: Upgrading or experimenting with cutting-edge dependencies in a single project cannot break builds or block deployments across the rest of the portfolio.
  • Granular Access & Project Boundaries: Clear isolation and modular boundaries rather than exposing or coupling the entire portfolio within a single monolithic workspace.

NOTE: While a monorepo saves disk space by avoiding duplicate node_modules and naturally prevents configuration drift from golden templates, the isolated multi-repo approach fits my isolated Cloudflare Pages deployment pipeline better.



Features

While conceptually straightforward, RxCLI eliminates repetitive terminal workflows by automating key engineering tasks across all repositories:

  • Dependency Updates: Automates routine package management across the fleet, including npx taze -w, npm outdated, npm install and npm update.
  • Vulnerability Scanning: Runs security audits via npm audit and applies standard patches using npm audit fix.
  • Batch Code Quality Audits: Executes project checks across all repositories, separating read-only audits (tsc --noEmit and biome check) from auto-formatting tasks (biome check --write), and displays a real-time scorecard table.
  • Targeted Scoping & Filtering: Allows workflows to run selectively - such as targeting only modified repositories with uncommitted changes (--changed), repositories with unpushed commits (--unpushed), or specific apps by name (--only).
  • Universal Script Runner: Acts as a pass-through runner for any custom script declared in package.json (such as npm run build or npm run test), automatically skipping projects where the script is not defined.
  • Git Repository State Inspection: Inspects working tree cleanliness (Clean vs. Modified) and tracks remote synchronization status relative to GitHub (Synced vs. ↑ N unpushed commits).
  • Batch Remote Syncing: Pulls the latest commits from GitHub across all application repositories on their active branch.
  • Batch Staging & Committing: Automatically stages modified or added files (git add -A) and creates commits with a specified message, skipping clean repositories.
  • Batch Pushing: Pushes local commits on active branches directly to GitHub across the entire portfolio to trigger automated deployment builds.



Summary

While building an orchestrator represents a standard step in multi-repo project management, it is the right architectural move for my Rx ecosystem.

  • Combined with reusable template configurations to standardize .gitignore, tsconfig.json, biome.json, next.config.ts, package.json, robots.ts, sitemap.ts, manifest.ts and _headers across all my Cloudflare Pages client-side PWAs, RxCLI drastically cuts down maintainability overhead - allowing 28 independent repositories to be maintained as smoothly as a single project.

Comments