Documentation

Technical Details

Deep dive into AbpDevTools architecture, requirements, and development guidelines

System Architecture

Understanding how AbpDevTools is built and organized

4-Layer Architecture

AbpDevTools follows a clean, layered architecture for maintainability and extensibility

Presentation Layer

CliFx Commands Command Line Interface User Interaction

Business Layer

Build Command Run Command Migrate Command Replace Command Logs Command

Data Layer

YAML Configuration Local Sources Environment Variables

Platform Layer

Windows Services macOS Services Linux Services

Design Principles

CliFx Framework

Built on CliFx for modern, declarative CLI command definition with dependency injection support.

Dependency Injection

Microsoft.Extensions.DependencyInjection provides IoC container for service management and testability.

Platform Abstraction

OS-specific implementations for Windows, macOS, and Linux with runtime detection and service resolution.

Configuration-Driven

YAML-based configuration files for environments, local sources, replacements, and tool settings.

Requirements & Compatibility

System requirements and supported platforms

.NET Version Support

.NET Version Status Support Level
.NET 10.0 ✓ Supported Latest (Release builds only)
.NET 9.0 ✓ Supported Primary (Debug & Release)
.NET 8.0 ✓ Supported Stable (Release builds only)
.NET 7.0 ✓ Supported Stable (Release builds only)
.NET 6.0 ✓ Supported Stable (Release builds only)
.NET 5.0 ✗ Not Supported EOL

Operating System Support

Windows

✓ Fully Supported

  • Native notifications
  • Recycle bin integration
  • Docker support
  • All features available

macOS

✓ Fully Supported

  • Native notifications
  • Recycle bin integration
  • Docker support
  • All features available

Linux

△ Partial Support

  • Basic notifications
  • No recycle bin
  • Docker support
  • Core features available

Dependencies

CliFx

v2.3.4

Declarative CLI framework for command definition and argument parsing

Microsoft.Extensions.DependencyInjection

v7.0.0

Dependency injection container for service management

Spectre.Console

v0.46.1

Beautiful terminal UI and formatting library

YamlDotNet

v13.4.0

YAML configuration file parsing and serialization

AutoRegisterInject

v1.2.1

Automatic service registration with attributes

Unidecode.NET

v2.1.0

Unicode to ASCII transliteration for file names

Performance Benchmarks

Real-world performance metrics and optimization tips

3-5s
Cold Start Time
Time to first command execution
<1s
Incremental Build
Subsequent build operations
30-50MB
Memory Usage
Idle memory consumption
50%
Build Time Reduction
With GraphBuild parallelization

Optimization Tips

Build Optimization

  • Use abpdev build --graphBuild for parallel project builds
  • Specify configuration: -c Release for optimized builds
  • Filter projects with -f to build only what's needed
  • Use interactive mode -i to select specific solutions

Run Optimization

  • Use --no-build when projects are already built
  • Enable --graphBuild for parallel execution
  • Skip migrations with --skip-migrate when not needed
  • Use -a flag to run all without prompts

Environment Optimization

  • Use virtual environments to avoid file modifications
  • Pre-configure environments with abpdev env config
  • Reuse environments across team members
  • Switch environments with -e flag instantly

Extensibility Points

How to extend and customize AbpDevTools for your needs

Custom Commands

Create your own commands by implementing the ICommand interface from CliFx

CustomCommand.cs
using CliFx.Attributes;

[Command("custom")]
public class CustomCommand : ICommand
{
    public ValueTask ExecuteAsync(IConsole console)
    {
        console.Output.WriteLine("Hello from custom command!");
        return default;
    }
}

Service Registration

Use AutoRegisterInject attributes for automatic dependency injection registration

Service.cs
using AutoRegisterInject;

[RegisterTransient]
public class MyCustomService
{
    public void DoWork()
    {
        // Your implementation
    }
}

[RegisterSingleton]
public class MySingletonService
{
    // Singleton services are created once
}

Platform-Specific Services

Implement different behaviors for Windows, macOS, and Linux

Program.cs
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
    services.AddTransient<IPlatformService, WindowsPlatformService>();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
    services.AddTransient<IPlatformService, MacPlatformService>();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
    services.AddTransient<IPlatformService, LinuxPlatformService>();
}

Key Extension Areas

1

Configuration Providers

Add custom configuration sources and formats

2

Notification Managers

Implement platform-specific notification systems

3

Recycle Bin Managers

Handle file deletion per platform conventions

4

Project Discovery

Custom project and solution detection logic

5

Build Integration

Extend build process with custom steps

6

Environment Apps

Add support for additional development tools

Configuration System

Understanding AbpDevTools configuration files and variables

Configuration Files

AbpDevTools uses YAML files for flexible, human-readable configuration

📄

abpdev.yml

Project-specific settings and environments

Environments:
  Development:
    Variables:
      ASPNETCORE_ENVIRONMENT: "Development"
      ConnectionStrings__Default: "Server=localhost;Database=MyDevDb"
  Production:
    Variables:
      ASPNETCORE_ENVIRONMENT: "Production"
      ConnectionStrings__Default: "Server=prod-server;Database=MyProdDb"
📦

local-sources.yml

Local package source mappings for development

abp:
  RemotePath: https://github.com/abpframework/abp.git
  Path: C:\github\abp
  Packages:
    - Volo.Abp.*
    - Volo.Abp.Core
🔄

replacement.yml

File replacement patterns for bulk operations

UpdateBranding:
  FilePattern: "appsettings.json"
  Find: "MyOldBrand"
  Replace: "MyNewBrand"
🛠️

environment.yml

Global tool configuration and preferences

Tools:
  AbpStudioPath: "C:\\Tools\\AbpStudio"
Notifications:
  Enabled: true

Built-in Variables

Use special placeholders in your configuration files for dynamic values

{Today}

Current Date

Replaced with today's date in YYYY-MM-DD format

Example: Database_MyApp_{Today}Database_MyApp_2025-01-08
{AppName}

Application Name

Replaced with the detected application name or folder name

Example: logs/{AppName}/logs.txtlogs/MyProject/logs.txt
{Now}

Current Timestamp

Replaced with current date and time

Example: backup_{Now}backup_2025-01-08_14-30-00

Troubleshooting Guide

Common issues and solutions for AbpDevTools

Installation Issues

Tool not found after installation

Ensure dotnet tools folder is in your PATH. Add to your shell profile:

  • Windows: Add %USERPROFILE%\.dotnet\tools to PATH
  • macOS/Linux: Add $HOME/.dotnet/tools to PATH in ~/.bashrc or ~/.zshrc

Permission denied during installation

Run the installation command with appropriate permissions or use --tool-path to specify a writable location

Runtime version mismatch

Specify the target framework: dotnet tool install -g AbpDevTools --framework net8.0

Build Issues

Projects not discovered

Ensure you're in the correct directory with .sln or .csproj files. Use -p to specify the working directory path

Dependency errors during build

Run dotnet restore first, or use abpdev build -i for interactive project selection to isolate problematic projects

Parallel build failures

Disable GraphBuild with --no-graphBuild or build specific projects with -f filter

Runtime Issues

Application won't start

Check logs with abpdev logs <project-name>. Verify database migrations ran successfully with abpdev migrate

Environment variables not applied

Verify environment configuration with abpdev env config. Check YAML syntax and variable naming format (use double underscores __ for nested keys)

Hot reload not working

Ensure you're using abpdev run -w for watch mode. Some project types may not support hot reload

Configuration Issues

YAML syntax errors

Validate YAML syntax using online validators. Ensure proper indentation (spaces, not tabs) and correct key-value formatting

Local sources not working

Verify paths in local-sources.yml exist and contain valid .csproj files. Use forward slashes or escaped backslashes in paths

Replacements not executing

Check file patterns match actual files. Verify find/replace strings don't contain special regex characters unless intended

Contributor Guidelines

How to contribute to AbpDevTools development

Getting Started

1

Clone the Repository

git clone https://github.com/enisn/AbpDevTools.git
cd AbpDevTools
2

Create a Feature Branch

git checkout -b feature/your-feature-name
3

Build the Project

./pack.ps1

This will build the project and create NuGet packages in the nupkg folder

4

Install Locally for Testing

dotnet tool install --global --add-source ./nupkg AbpDevTools

Development Setup

Prerequisites

  • .NET 9.0 SDK (for development)
  • PowerShell 7+ (for build scripts)
  • Git
  • Visual Studio 2022 or VS Code (optional)

Running Tests

dotnet test

Debugging

  • Set breakpoints in your command code
  • Run with abpdev [command] from the terminal
  • Attach debugger to the running process

Coding Standards

C# Conventions

  • Follow C# naming conventions (PascalCase for public members)
  • Use async/await for I/O operations
  • Prefer var when type is obvious
  • Use string interpolation for string formatting
  • Add XML documentation comments for public APIs

Command Organization

  • One command per file in Commands/ folder
  • Use descriptive command names with hyphens
  • Implement ICommand from CliFx
  • Register commands in Program.cs
  • Group related commands in subfolders

Documentation

  • Update README.md for user-facing changes
  • Add XML comments for command help text
  • Document configuration file changes
  • Include usage examples for new commands
  • Update this technical documentation

Pull Request Guidelines

Before Submitting

Best Practices

  • Keep PRs focused and small - one feature per PR
  • Write clear commit messages following conventional commits format
  • Add screenshots for UI changes if applicable
  • Reference related issues in PR description
  • Respond to code review feedback promptly
  • Ensure CI/CD checks pass before requesting review

Release Process

For maintainers releasing new versions

1

Update Version

Update version in AbpDevTools.csproj

2

Build & Pack

Run ./pack.ps1 to create NuGet packages

3

Test Package

Install from local nupkg and verify functionality

4

Create Release

Create GitHub release with version tag and changelog

5

Publish to NuGet

Upload package to nuget.org

Ready to Contribute?

Join the community and help make AbpDevTools even better