Monorepo management for opam overlays
OCaml 99.6%
Dune 0.1%
Other 0.3%
99 1 0

Clone this repository

https://tangled.org/anil.recoil.org/monopam
git@git.recoil.org:anil.recoil.org/monopam

For self-hosted knots, clone URLs may differ based on your setup.

README.md

monopam#

Opam overlay and monorepo manager using git subtrees.

Overview#

Monopam manages synchronization between:

  • An opam overlay repository
  • Individual git checkouts of packages
  • A monorepo using git subtrees

This enables maintaining multiple OCaml packages in a single repository while preserving their individual git histories.

Installation#

opam install monopam

Workflow#

Initialize#

monopam init

Creates configuration and initializes the monorepo structure.

Check Status#

monopam status

Shows synchronization state of all packages, including:

  • Pending commits in checkouts
  • Uncommitted changes in monorepo
  • Remote tracking status

Pull Updates#

monopam pull           # Pull all packages
monopam pull <package> # Pull specific package

For each package:

  1. Clones or fetches the individual checkout
  2. Adds or pulls the subtree in the monorepo

Push Changes#

monopam push           # Push all packages
monopam push <package> # Push specific package

For each package with monorepo changes:

  1. Splits the subtree commits
  2. Pushes to the individual checkout

Use --upstream to also push checkouts to their remotes.

Add/Remove Packages#

monopam add <package>    # Add package to monorepo
monopam remove <package> # Remove package from monorepo

Directory Structure#

overlay/           # Opam overlay repository
src/               # Individual git checkouts
  package-a/
  package-b/
monorepo/          # Combined monorepo
  package-a/       # Subtree from src/package-a
  package-b/       # Subtree from src/package-b

License#

ISC