Bulldog is an opinionated base library for building .NET command line tools. It provides a robust foundation that handles common concerns in CLI tool development, allowing developers to focus on implementing their core business logic rather than boilerplate setup.
- Logging Integration: Built-in Serilog configuration for structured logging
- Dependency Injection: Automatic DI container setup and configuration
- Cancellation Handling: Graceful handling of cancellation tokens and signals
- Command Line Parsing: Integration with CommandLineParser library for robust argument handling
- Standardized Structure: Enforces best practices while maintaining flexibility
- Extensible Design: Provides extension points for customization
- .NET 7.0 SDK
- nuke global tool
Add the Bulldog package to your project:
dotnet add package Bulldog- Create a new .NET project
- Add the Bulldog package
- Inherit from
ToolBasein your main program class - Implement your tool's logic
Example:
public class MyTool : ToolBase
{
protected override async Task<int> RunAsync(CancellationToken cancellationToken)
{
// Your tool's logic here
return 0;
}
}This project builds with Nuke.
To build the solution:
dotnet build Bulldog.slnTo run the build:
build.cmdThis runs the FullBuild target of the nuke build project (The same target that is run as part of CI)
Tests will be run as part of FullBuild target. To run them explicitly:
build.cmd Test # For unit tests
build.cmd SmokeTest # For smoke testsThe smoke test builds and runs an example tool which can be used as a reference.
We welcome contributions! Take a look at the issues to find something to work on. Please read the CONTRIBUTING.md before contributing.
- Follow the existing code style and conventions
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PRs
Community engagement is welcome! Please use the following channels:
- GitHub Issues: For bug reports and feature requests
- Pull Requests: For code changes and reviews
- Discussions: For general questions and community engagement
Please see our security policy for details on reporting security vulnerabilities.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
