Skip to main content
Chapi Assistant provides powerful project scaffolding capabilities using Clean Architecture templates. You can create new projects from templates or clone existing repositories.

Creating a New Project

Chapi uses a template-based approach to scaffold new .NET projects with Clean Architecture.
1

Open Project Creation

Navigate to the project creation dialog in Chapi Assistant or use the AI Assistant to create a project.
# AI Assistant command example
"Create a new API called MyApiProject in C:\Projects"
2

Configure Project Details

Provide the following information:
  • Project Name: The name of your project (e.g., MyApiProject)
  • Parent Directory: Where the project will be created (e.g., C:\Projects)
  • Template URL: Git repository URL for the template (default: Clean Architecture)
  • Remote URL (optional): Your remote Git repository URL
3

Project Creation Process

Chapi Assistant performs the following steps automatically:
  1. Clone the template repository
  2. Remove original Git metadata (.git folder)
  3. Rename project structure to match your project name
  4. Initialize new Git repository
  5. Add remote origin (if provided)
  6. Register project in Chapi workspace
Progress is shown in real-time:
Clonando repositorio base...
Limpiando metadatos de Git...
Personalizando estructura del proyecto...
Inicializando nuevo repositorio Git...
Asociando repositorio remoto...
Registrando proyecto en Chapi...
4

Verify Project Structure

Your new project will contain:
MyApiProject/
├── API/
│   ├── Controllers/ or Endpoints/
│   ├── Config/
│   └── Program.cs
├── Application/
│   ├── UseCases/
│   └── Services/
├── Domain/
│   ├── Entities/
│   ├── Interfaces/
│   └── Common/
├── Infrastructure/
│   ├── Persistence/
│   └── Services/
└── .git/

Cloning an Existing Repository

You can also clone existing repositories into your Chapi workspace.
1

Use Clone Command

Provide the repository URL and destination path:
# Via AI Assistant
"Clone https://github.com/username/repo.git to C:\Projects"
2

Automatic Registration

After cloning, Chapi automatically:
  • Registers the project in your workspace
  • Detects the project technology (.NET, Node.js, etc.)
  • Scans main folders and structure
  • Loads Git metadata

Project Templates

Chapi supports different architectural patterns based on the template structure:
Projects with Endpoints folder use Ardalis-style architecture:
  • API layer uses Endpoints instead of Controllers
  • Generic repository pattern
  • Dependency injection via Scrutor auto-discovery
  • Minimal API endpoints
Detection: Chapi checks for API/Endpoints folder

Code Implementation

The project creation logic is implemented in CreateProjectUseCase.cs:
public async Task<Result<string>> ExecuteAsync(
    CreateProjectRequest request, 
    Action<string> onProgress = null)
{
    string targetPath = Path.Combine(
        request.ParentDirectory, 
        request.ProjectName
    );

    // 1. Clone template repository
    await _gitRepository.CloneAsync(request.TemplateUrl, targetPath);

    // 2. Remove original .git folder
    DeleteDirectory(Path.Combine(targetPath, ".git"));

    // 3. Rename template structure
    string oldName = Path.GetFileNameWithoutExtension(request.TemplateUrl);
    await _templateService.RenameTemplateAsync(
        targetPath, oldName, request.ProjectName
    );

    // 4. Initialize new Git repository
    await _gitRepository.InitAsync(targetPath);

    // 5. Add remote if provided
    if (!string.IsNullOrWhiteSpace(request.RemoteUrl))
    {
        await _gitRepository.AddRemoteAsync(
            targetPath, "origin", request.RemoteUrl
        );
    }

    // 6. Register in Chapi
    await _projectRepository.AddProjectAsync(targetPath);

    return Result<string>.Success(targetPath);
}

Managing Projects

Add Existing Project

Add a project that wasn’t created by Chapi:
# Via AI Assistant
"Add the project at C:\MyExistingProject"

List Projects

View all registered projects:
# Via AI Assistant
"List all my projects"
Output example:
📂 My Projects:
• MyApiProject (C:\Projects\MyApiProject)
• LegacyApp (C:\Work\LegacyApp)
• TestProject (C:\Dev\TestProject)

Remove Project

Remove a project from Chapi workspace (doesn’t delete files):
# Via AI Assistant
"Remove current project from Chapi"

Default Template

Chapi uses the following default template for .NET projects:
https://github.com/Start-Z/CleanArchitecture-Template.git
This template includes:
  • Clean Architecture structure
  • Dependency Injection setup
  • Entity Framework Core integration
  • CQRS pattern support
  • Repository pattern implementation

Best Practices

  • Use a dedicated workspace folder (e.g., C:\Projects)
  • Avoid deeply nested paths
  • Ensure you have write permissions
  • Use PascalCase (e.g., MyApiProject)
  • Avoid special characters and spaces
  • Choose descriptive names
  • Create the remote repository first (GitHub/GitLab)
  • Provide the SSH or HTTPS URL during creation
  • Chapi will configure the remote automatically
  • Check that all folders are renamed correctly
  • Verify Git initialization: git status
  • Ensure dependencies resolve: dotnet restore

Troubleshooting

Directory already exists: If the target directory exists, Chapi will fail. Either:
  • Choose a different name
  • Delete the existing directory
  • Use a different parent directory
Template clone fails: Ensure:
  • You have internet connectivity
  • The template URL is valid
  • Git is installed and accessible
After creating a project, Chapi automatically switches to it, loading all Git metadata and project context for the AI Assistant.

Next Steps

Generate Modules

Learn how to scaffold new modules using Chapi’s code generation

Git Workflow

Master Git operations within Chapi Assistant

Build docs developers (and LLMs) love