An open API service indexing awesome lists of open source software.

https://github.com/oleg-koval/dcli

Docker Compose and Git management CLI for macOS, Linux, and Windows. Easily clean and restart containers, reset repositories to develop or acceptance branches.
https://github.com/oleg-koval/dcli

cli cross-platform docker docker-compose git go homebrew linux macos windows

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          


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)

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

### From Source

```bash
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](https://github.com/oleg-koval/dcli/releases/tag/v0.1.0)

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

```bash
# 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

```bash
# Reset all configured repos to develop
dcli git reset develop

# Reset all configured repos to develop
dcli git reset develop
```

### Custom Commands

```bash
# 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`:

```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:
```bash
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...] -- # 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 # Export a command pack
dcli commands import --file # Import a command pack
dcli commands ui [--export-file ] # 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

- ๐Ÿ“– [Installation Guide](docs/INSTALL.md) - Detailed installation instructions for all platforms
- โš™๏ธ [Configuration Guide](docs/CONFIGURATION.md) - Complete configuration reference with examples
- ๐Ÿ“ [Contributing](CONTRIBUTING.md) - How to contribute to dcli
- ๐Ÿ”’ [Security Policy](SECURITY.md) - Reporting security vulnerabilities

## Use Cases

### Development Workflow

Reset your working environment to latest develop:
```bash
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:
```bash
dcli docker restart web api # Restart specific services
# Preserves database data and volumes
```

### Monorepo Management

Configure all microservices and reset with one command:
```bash
# 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](CONTRIBUTING.md) for guidelines.

## License

MIT License - see [LICENSE](LICENSE) for details

## Author

[@oleg-koval](https://github.com/oleg-koval)

---


dcli makes container, repository, and custom command management effortless

Report Issues โ€ข
Discussions โ€ข
Releases