Skip to content

oleg-koval/dcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

tests Coverage Status Go Report Card OpenSSF Scorecard

dcli icon

dcli

Lightweight Docker Compose and Git management CLI
Clean, restart, and manage repositories with a single command


Features

  • 🐳 Docker Management - Clean containers/volumes, rebuild, and restart services
  • πŸ”„ Git Batch Operations - Reset multiple repositories to any branch on origin
  • 🧩 Custom Command Packs - Save local automation, share repo-pack commands, and export/import packs for onboarding
  • βš™οΈ Execution-First CLI - Run commands directly; use dcli commands and dcli commands ui to manage packs and sharing
  • πŸš€ Homebrew Distribution - Install with a single command: brew install dcli
  • πŸ”„ Auto-Updates - Checks GitHub Releases on launch and self-updates when a newer version is available
  • πŸ–₯️ Cross-Platform - Works on macOS (Intel & Apple Silicon), Linux, and Windows
  • βš™οΈ YAML Configuration - Simple config file at ~/.dcli/config.yaml
  • πŸ“ Clear Error Messages - Comprehensive feedback on what went wrong and why
  • πŸ§ͺ Well-Tested - 58 tests with 82.4% code coverage across all platforms

Installation

Using Homebrew (Recommended)

brew tap oleg-koval/dcli
brew install dcli
dcli --version

From Source

git clone https://github.com/oleg-koval/dcli.git
cd dcli
make build
./bin/dcli --version

Direct Download

Download binaries for your platform from GitHub Releases

Set DCLI_DISABLE_AUTO_UPDATE=1 if you want to skip the startup update check. Set DCLI_AUTO_UPDATE_TIMEOUT=250ms to adjust the best-effort update check timeout (default: 1s). Set DCLI_AUTO_UPDATE_CHANNEL=prerelease (or beta / alpha) to follow prerelease builds from GitHub Releases instead of stable only.

Quick Start

Docker Commands

# Clean all services (remove containers, volumes, rebuild, restart)
dcli docker clean

# Clean specific services
dcli docker clean api web

# Restart services while preserving data
dcli docker restart

# Restart specific services
dcli docker restart api

Git Commands

# Reset all configured repos to develop
dcli git reset develop

# Reset all configured repos to develop
dcli git reset develop

Custom Commands

# Add a personal command
dcli commands add john deploy -- docker compose up -d

# List loaded commands
dcli commands

# Open the interactive browser for management only
dcli commands ui

# Export a pack for onboarding
dcli commands export --file team-pack.json

# Import a shared pack
dcli commands import --file team-pack.json

Configuration

Create ~/.dcli/config.yaml:

repositories:
  - path: /Users/username/projects/backend
    name: backend
  - path: /Users/username/projects/frontend
    name: frontend
  - path: /Users/username/projects/infra
    name: infra

Environment Variables

  • DCLI_PROJECT_DIR - Override default project directory (defaults to current directory)
  • DCLI_AUTO_UPDATE_TIMEOUT - Override the startup update check timeout using a Go duration string, such as 250ms or 1s

Example:

DCLI_PROJECT_DIR=/path/to/monorepo dcli docker clean api web

Commands Reference

Global Flags

  • -h, --help - Show help
  • -v, --version - Show version

Docker Subcommand

dcli docker clean [service ...]      # Clean and rebuild (removes containers, volumes, rebuilds)
dcli docker restart [service ...]    # Restart services (preserves data)

Git Subcommand

dcli git reset [develop|acceptance]  # Reset all configured repos to specified branch

Commands Subcommand

dcli commands                         # List loaded commands
dcli commands show [path...]          # Show details for one command
dcli commands add [path...] -- <cmd>   # Add a personal command
dcli commands edit [path...]          # Edit command metadata or replace the step command
dcli commands enable [path...]        # Enable a command
dcli commands disable [path...]       # Disable a command
dcli commands delete [path...]        # Delete a command
dcli commands export --file <path>    # Export a command pack
dcli commands import --file <path>    # Import a command pack
dcli commands ui [--export-file <path>] # Open the command management TUI

System Requirements

  • Docker 20.10+ with Docker Compose
  • Git 2.20+
  • macOS 10.14+, Ubuntu 18.04+, or Windows 10+

Documentation

Use Cases

Development Workflow

Reset your working environment to latest develop:

dcli git reset develop      # Fetch and reset all repos
dcli docker clean           # Clean all containers and volumes
# Fresh environment ready for new feature branch

Quick Service Restart

After code changes or configuration updates:

dcli docker restart web api  # Restart specific services
# Preserves database data and volumes

Monorepo Management

Configure all microservices and reset with one command:

# In ~/.dcli/config.yaml: add all repo paths
dcli git reset acceptance    # All services to acceptance branch
dcli docker clean           # Clean all microservices

Architecture

dcli is built with:

  • Go 1.25.0+ - Compiled language for reliability
  • Cobra - Battle-tested CLI framework
  • YAML - Human-readable configuration
  • Docker Compose API - Direct execution without shells

Zero external dependencies for core functionality.

Project Status

  • βœ… Alpha Release (v0.1.0)
  • βœ… Tests passing (15+ tests)
  • βœ… Cross-platform builds (macOS, Linux, Windows)
  • βœ… Homebrew distribution ready
  • πŸš€ Production-ready for Docker Compose and Git workflows

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details

Author

@oleg-koval

Website: dcli.olegkoval.com


dcli makes container, repository, and custom command management effortless
Report Issues β€’ Discussions β€’ Releases β€’ Buy Me a Coffee

About

Docker Compose and Git management CLI for macOS, Linux, and Windows. Easily clean and restart containers, reset repositories to develop or acceptance branches.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors