Your first Socotra project
A five-minute walkthrough from install to a running .NET solution.
Prerequisites
- .NET SDK 10.0 or later
- Internet connection (for NuGet packages and GitHub templates)
1. Install
dotnet tool install -g EssaLab.SocotraIf the latest Socotra release is a beta or other prerelease, the .NET CLI will not install it by default. Pass --prerelease to opt in:
dotnet tool install --global EssaLab.Socotra --prereleaseThe --prerelease flag is required for preview, beta, RC, and any other prerelease builds.
Verify the installation:
socotra --version2. Initialize a project
mkdir MyEcommerceApp
cd MyEcommerceApp
socotra initsocotra init generates a socotra.yaml using the empty template by default — a minimal file containing only the schema version. Pick a pre-built architecture with --template:
socotra init --template modular-monolith
socotra init --template clean-architecture3. Examine the config
The default empty output is intentionally tiny — just a schema annotation and the version key, so editors with the YAML Language Server give you IntelliSense from the first keystroke:
# yaml-language-server: $schema=https://essalab.github.io/Socotra.Schemas/schemas/v1/schema.json
socotra:
version: "1.0"Choosing --template modular-monolith produces a fuller starter that you can edit in place:
# yaml-language-server: $schema=https://essalab.github.io/Socotra.Schemas/schemas/v1/schema.json
socotra:
version: "1.0"
solution:
name: MyEcommerceApp
dotnetVersion: "net9.0"
architecture:
pattern: modular-monolith
modules:
- name: MyEcommerceApp.Core
layers:
- name: Domain
type: ClassLib
- name: Application
type: ClassLib
- name: Infrastructure
type: ClassLib
- name: Api
type: WebApi
shared:
- name: SharedKernel
type: ClassLib4. Validate
socotra validateSchema version : 1.0
Solution name : MyEcommerceApp
Module count : 2
Configuration : Validvalidate parses the YAML, verifies the schema version, checks for duplicate module names, and validates layer names — all without touching the filesystem.
5. Preview the plan
socotra planThe plan output displays the solution file, projects, directories, and any existing state that will be preserved. No filesystem changes are made during planning.
6. Apply
socotra applyYou'll be prompted for confirmation before any writes occur. During execution, a progress bar shows creating the solution file, adding projects, and creating directories.
7. Check status
socotra statusShows which parts of the configuration are Applied, Pending, or Drifted. For a complete pipeline comparison:
socotra status --full8. Modify and re-apply
Add a new module to socotra.yaml:
modules:
- name: MyEcommerceApp.Core
layers: [Domain, Application, Infrastructure, Presentation]
- name: MyEcommerceApp.Shared
layers: [Domain, Application]
- name: MyEcommerceApp.Reporting # new module
layers: [Domain, Infrastructure]socotra plan
socotra applySocotra detects only the new module and creates it non-destructively — existing projects are untouched.
9. Use templates
Add a built-in DDD template to a module:
socotra template export base-entityThis copies the built-in template to .socotra/templates/base-entity/. Reference it in a layer's templates list, then run socotra apply.
To add a custom template from GitHub:
socotra template add github:user/templates/path