https://github.com/samber/do-template-cli
🛠️ CLI boilerplate showcasing github.com/samber/do
https://github.com/samber/do-template-cli
boilerplate cli container dependency-injection di dig do fix go injector invoke ioc provide template wire
Last synced: 29 days ago
JSON representation
🛠️ CLI boilerplate showcasing github.com/samber/do
- Host: GitHub
- URL: https://github.com/samber/do-template-cli
- Owner: samber
- License: mit
- Created: 2025-09-25T12:36:16.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-09-25T13:08:55.000Z (5 months ago)
- Last Synced: 2025-10-11T02:37:56.666Z (4 months ago)
- Topics: boilerplate, cli, container, dependency-injection, di, dig, do, fix, go, injector, invoke, ioc, provide, template, wire
- Language: Go
- Homepage: https://github.com/samber/do
- Size: 30.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CLI boilerplate showcasing github.com/samber/do


[](https://goreportcard.com/report/github.com/samber/do)
[](./LICENSE)
**⚙️ 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:**
- [do-template-api](https://github.com/samber/do-template-api)
- [do-template-worker](https://github.com/samber/do-template-worker)
## 🚀 Install
Clone the repo and install dependencies:
```bash
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
```
## 💡 Features
- **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
## 🚀 Contributing
```sh
# install deps
make deps
make deps-tools
# compile
make build
# build with hot-reload
make watch-run
# test with hot-reload
make watch-test
```
## 🤠 `do` documentation
- [GoDoc: https://godoc.org/github.com/samber/do/v2](https://godoc.org/github.com/samber/do/v2)
- [Documentation](https://do.samber.dev/docs/getting-started)
## 💫 Show your support
Give a ⭐️ if this project helped you!
[](https://github.com/sponsors/samber)
## 📝 License
Copyright © 2025 [Samuel Berthe](https://github.com/samber).
This project is [MIT](./LICENSE) licensed.