โ๏ธ Fork this repository and start your new project with do
dependency injection.
A comprehensive CLI template project demonstrating the full power of the github.com/samber/do
dependency injection library. This project implements a complete data processing application with type-safe dependency injection, modular architecture, and real-world concerns.
Perfect as a starting point for new Go projects or as a learning resource for understanding dependency injection patterns in Go applications.
See also:
Clone the repo and install dependencies:
git clone --depth 1 --branch main https://github.com/samber/do-template-cli.git your-project-name
cd your-project-name
docker compose up -d
make deps
make deps-tools
- Type-safe dependency injection - Service registration and resolution using
samber/do
- Modular architecture - Clean separation of concerns with dependency tree visualization
- CLI framework integration - Built with Cobra for powerful command-line interfaces
- Configuration management - Environment-based configuration with dependency injection
- Data processing pipeline - Complete example with CSV/JSON processing and file I/O
- Repository pattern - Data access layer with injected dependencies
- Service layer - Business logic with proper dependency management
- Application lifecycle - Health checks and graceful shutdown handling
- Comprehensive error handling - Structured logging and error management
- Production-ready - Ready to fork and customize for your next project
- Extensive documentation - Inline comments explaining every
do
library feature
# install deps
make deps
make deps-tools
# compile
make build
# build with hot-reload
make watch-run
# test with hot-reload
make watch-test
Give a โญ๏ธ if this project helped you!
Copyright ยฉ 2025 Samuel Berthe.
This project is MIT licensed.