mdc

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

mdc

Run one docker compose command across every compose project in a directory tree.

License CI Latest Release

mdc discovers compose.yaml, compose.yml, docker-compose.yaml, and docker-compose.yml, picks one canonical file per directory, and runs the same docker compose command for each target.

Installation

# Homebrew
brew install aaronflorey/tap/mdc

# Go
go install github.com/aaronflorey/mdc@latest

Prebuilt binaries are also published on the GitHub releases page.

Quick Start

mdc ps
mdc up -d
mdc --depth 2 pull
mdc --jobs 4 logs --tail 50
mdc --ansi never ps

Usage

mdc [mdc flags] <docker compose args...>

Flags

  • --depth: scan depth (0 = current directory only, default 1)
  • --jobs: max concurrent docker compose processes (0 = all targets)
  • --quiet-targets: suppress per-target section headers for non-merged output

Setup

git clone https://github.com/aaronflorey/mdc.git
cd mdc
task setup
task ci

How It Works

  • Discovery starts in the current directory and walks child directories up to --depth.
  • If a directory has multiple compose files, this precedence is used:
    1. compose.yaml
    2. compose.yml
    3. docker-compose.yaml
    4. docker-compose.yml
  • mdc preserves the target directory basename as the Compose project name when it is unique, and switches to a deterministic unique name only when duplicate basenames would collide.
  • Non-ps commands print grouped output per project in sorted directory order.
  • mdc ps tries docker compose ps --format json, merges results into one table, and falls back to stitched text when JSON is unavailable.
  • Exit code is non-zero if any compose target fails.
  • Ctrl-C cancels the shared run context so in-flight docker compose processes stop together.
  • mdc only parses its own flags (--depth, --jobs, --quiet-targets) and passes everything else through to docker compose.

Development

task setup
task test
task test:integration
task lint
task build
task ci

task run -- ps forwards arguments to go run ..

task test:integration requires a working local Docker Engine with docker compose available.

Releases

Releases use release-please for versioning and changelog management. Merged Conventional Commits are collected into a release PR, and merging that PR creates a vX.Y.Z tag, publishes release archives with GoReleaser, and updates the aaronflorey/homebrew-tap formula.

Project Files

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL