Socotra
CLI · command

socotra apply

Execute the computed plan and reconcile the filesystem with the desired state.


Synopsis

socotra apply [--auto-approve] [--output text|json] [--detailed-exit-codes]

Options

OptionTypeDefaultDescription
--auto-approveboolfalseSkip interactive confirmation prompt
--outputtext | jsontextOutput format
--detailed-exit-codesboolfalseDistinguish applied-changes from no-changes

Exit codes

CodeMeaning
0No changes needed (or applied without --detailed-exit-codes)
1Error during execution
2Changes applied (only with --detailed-exit-codes)

Behavior

  • Displays the plan and prompts for confirmation (unless --auto-approve).
  • --output json implies --auto-approve.
  • Shows a progress bar in text mode; silent in JSON mode.
  • On failure, prints recovery guidance: use --log-file, check dotnet --version, inspect the journal at .socotra/journal/.
Automatic rollback
If any step fails mid-execution, Socotra reverts the changes made so far and reports the error.

Examples

socotra apply
socotra apply --auto-approve
socotra apply --output json
socotra apply --log-file ./debug.log
success
{ "success": true, "appliedCount": 5, "errors": [] }
failure
{
  "success": false,
  "appliedCount": 2,
  "errors": [
    "Failed to create project 'MyApp.Orders.Infrastructure': dotnet new returned exit code 1",
    "Changes were rolled back"
  ]
}
Schema 1.1 · CLI 1.0