Build and deploy with a familiar syntax

From the Latin "andō" - to set in motion.

ANDO is a continous integration tool that runs your build and deployment workflow inside a Docker container. C# syntax, support for .NET, Node, Npm, Cloudflare and more.

Getting started

Install as a dotnet tool.

shell
# Install ANDO
dotnet tool install -g ando

# Create a hello world build script (csando files are c#)
echo 'Log.Info("Hello, World!");' > build.csando

# Run the build script
ando run

ANDO commands

The CLI provides a small, focused surface area.

Command Description
ando Run the build script in a Docker container.
ando verify Check build script for errors without executing.
ando clean Remove artifacts, temp files, and containers.
ando help Show available commands and options.

See the CLI reference for all options.

Example build.csando

C# code defines projects, tools, workflow settings, and operations. Compose builds with nested scripts.

build.csando
// Project and directory references
var WebApi = Dotnet.Project("./src/WebApi/WebApi.csproj");
var Frontend = Directory("./frontend");

// Backend build and publish
Dotnet.Restore(WebApi);
Dotnet.Build(WebApi);
Dotnet.Test(WebApi);
Dotnet.Publish(WebApi, o => o.Output(Root / "dist" / "api"));

// Frontend build
Node.Install();
Npm.Ci(Frontend);
Npm.Run(Frontend, "build");

// Deploy frontend to Cloudflare Pages
Cloudflare.EnsureAuthenticated();
Cloudflare.PagesDeploy(Frontend / "dist", "my-frontend");
Cloudflare.PurgeCache("example.com");

Examples

Real-world build scripts and advanced patterns to get you started.

Browse all examples

All Operations

Each operation registers a deterministic step and runs inside the container. Exceptions are labeled: Git operations and Ando.Build run on the host, and a few queries (such as Git.Commit) are evaluated when the script loads instead of running as steps.

Installers for Bun, Node.js, Docker, the .NET SDK, DocFX and Playwright are listed on the Tool installation page.

Ando (20)

UseImage Sets the Docker image for the build container.
CopyArtifactsToHost Copies files from the container to the host after the build.
CopyZippedArtifactsToHost Copies container files to the host as a single archive after the build.
Ando.Build Runs a nested build script in its own container.
Ando.Block Groups steps into a named block with optional failure and cleanup steps.
Ando.Finally Registers steps that always run at the end of a block or the run.
Ando.Defer Runs code at execution time and then runs the steps it registers.
Ando.When Runs steps only if a condition is true at execution time.
Ando.Require Fails the build if a condition is false at execution time.
Ando.Cancelled Returns true once the user pressed Ctrl+C.
Ando.Confirm Asks for confirmation before the build continues.
Ando.StepTree Returns the --dry-run step tree of another script.
Ando.Report Adds a value to the run record.
Ando.CommandTimeout Sets the timeout for the command steps registered after it.
Ando.CopyToContainer Copies a host file or directory into the build container.
Ando.CopyToHost Copies a file or directory from the build container to the host, in step order.
Ando.Lock Takes a named lock for this run, so only one run holds it at a time.
Ando.InvocationRoot Returns the host directory ANDO was run from.
Ando.WriteManifest Writes a manifest.json with version, commit and file hashes.
Ando.ImportArtifacts Imports and verifies a previous build's artifacts for deployment.

Globals (8)

Root Returns the project root path, where build.csando is located.
Temp Returns the temporary files directory (.ando/tmp).
Secrets.UserSecrets Reads a .NET user secrets store on the host and redacts its values.
Secrets.EnvFile Reads named keys from a dotenv file without exporting them.
Env Reads an environment variable, failing if it is not set unless optional.
Directory Creates a directory reference for operations that need a working directory.
DefineProfile Defines a build profile that you activate with the -p flag.
Log Writes info, warning, error and debug messages to the build output.

Archive (2)

Archive.TarGz Creates a byte-identical tar.gz of a directory.
Archive.Zip Creates a byte-identical zip of a directory.

Azure App Service (14)

AppService.AccessRestrictions Returns the access restrictions of a web app or slot as JSON.
AppService.CreateSlot Creates a deployment slot for a web app.
AppService.DeleteSlot Deletes a deployment slot of a web app.
AppService.DeployFolder Zips a published folder and deploys it to an App Service web app.
AppService.DeployWithSwap Deploys to a slot, then swaps it into production.
AppService.DeployZip Deploys a zip file to an App Service web app.
AppService.GetHostName Returns the default host name of a web app or slot.
AppService.ListSlots Lists the deployment slots of a web app.
AppService.Restart Restarts a web app.
AppService.Show Returns the web app's details as JSON.
AppService.Start Starts a web app.
AppService.Stop Stops a web app.
AppService.SwapSlots Swaps two deployment slots of a web app.
AppService.TemporaryAccessRule Adds an IP allow rule and removes it again when the block ends.

Azure Bicep (7)

Bicep.Build Compiles a Bicep file to an ARM JSON template.
Bicep.DeployToResourceGroup Deploys a Bicep template to a resource group.
Bicep.DeployToSubscription Deploys a Bicep template at subscription scope.
Bicep.Validate Validates a Bicep template against a resource group.
Bicep.ValidateSubscription Validates a Bicep template at subscription scope.
Bicep.WhatIf Previews the changes a Bicep deployment would make and returns them.
Bicep.WhatIfSubscription Previews a subscription-scope Bicep deployment and returns the changes.

Azure CLI (10)

Azure.Cli Runs an az command and returns its output.
Azure.CreateResourceGroup Creates a resource group if it does not exist.
Azure.EnsureAuthenticated Authenticates to Azure using the best available method.
Azure.EnsureLoggedIn Deprecated: verifies an Azure CLI login; use EnsureAuthenticated instead.
Azure.InstallCli Installs an exact Azure CLI version in the container.
Azure.LoginWithManagedIdentity Logs in to Azure with a managed identity.
Azure.LoginWithServicePrincipal Logs in to Azure with a service principal.
Azure.SetSubscription Sets the active Azure subscription.
Azure.ShowAccount Displays the current Azure account.
Azure.Vm.RunCommand Runs a shell script on a Linux VM and returns its output.

Azure Functions (14)

Functions.AccessRestrictions Returns the access restrictions of a function app or slot as JSON.
Functions.CreateSlot Creates a deployment slot for a function app.
Functions.DeleteSlot Deletes a deployment slot of a function app.
Functions.DeployWithSwap Deploys to a slot, then swaps it into production.
Functions.DeployZip Deploys a zip file to an Azure Functions app.
Functions.GetHostName Returns the default host name of a function app or slot.
Functions.ListSlots Lists the deployment slots of a function app.
Functions.Publish Publishes a function app with Azure Functions Core Tools.
Functions.Restart Restarts a function app.
Functions.Show Returns the function app's details as JSON.
Functions.Start Starts a function app.
Functions.Stop Stops a function app.
Functions.SwapSlots Swaps two deployment slots of a function app.
Functions.TemporaryAccessRule Adds an IP allow rule and removes it again when the block ends.

Bun (1)

Bun.Install Installs Bun in the container.

Cloudflare (8)

Cloudflare.EnsureAuthenticated Verifies the Cloudflare API token.
Cloudflare.EnsurePagesProject Verifies that the credentials can read a Pages project.
Cloudflare.PagesCreateProject Creates a Cloudflare Pages project.
Cloudflare.PagesDeploy Deploys a directory to Cloudflare Pages.
Cloudflare.PagesListDeployments Lists the deployments of a Pages project.
Cloudflare.PagesListProjects Lists the Cloudflare Pages projects.
Cloudflare.PurgeCache Purges the entire cache of a Cloudflare zone.
Cloudflare.UseCredentials Passes explicit Cloudflare credentials to every later Cloudflare step.

DocFX (6)

Docfx.BuildAndCopy Generates documentation, copies it and cleans up in one step.
Docfx.Cleanup Removes intermediate DocFX files.
Docfx.CopyToDirectory Copies the generated documentation to a target directory.
Docfx.GenerateDocs Generates API documentation from a docfx.json file.
Docfx.Install Installs DocFX as a dotnet global tool.
Docfx.IsInstalled Returns true if DocFX is installed on the host.

Docker (3)

Docker.Build Builds a Docker image with buildx and optionally pushes it.
Docker.Install Installs the Docker CLI in the container.
Docker.IsAvailable Returns true if the Docker CLI and daemon are reachable.

Dotnet (8)

Dotnet.Build Compiles a project.
Dotnet.Project Creates a reference to a .NET project file.
Dotnet.Publish Publishes a project into deployment artifacts.
Dotnet.ReadVersion Reads the version from a props file when the script loads.
Dotnet.Restore Restores NuGet packages for a project.
Dotnet.SdkInstall Installs the .NET SDK in the container.
Dotnet.Test Runs the unit tests of a project.
Dotnet.Tool Creates a reference to a .NET CLI tool.

Entity Framework Core (3)

Ef.DatabaseUpdate Applies pending EF Core migrations to a database.
Ef.DbContextFrom Creates a reference to a DbContext in a project.
Ef.Script Generates an idempotent SQL migration script.

Files (1)

Files.Copy Copies a file or directory inside the build container.

Git (15)

Git.ChangedFiles Lists the files changed since a ref as a step.
Git.ChangedSince Returns true if files changed since a ref.
Git.Commit Returns the full SHA of the commit being built.
Git.CommitTime Returns the commit time as unix seconds.
Git.Install Installs git in the build container when it is missing.
Git.LastTag Returns the most recent tag matching a pattern.
Git.LatestTag Finds the most recent matching tag as a step.
Git.Push Pushes the current branch to the remote.
Git.PushTag Pushes one tag to the remote.
Git.PushTags Pushes tags to the remote, skipping existing ones.
Git.RemoteTags Lists the tags on a remote as a step.
Git.RequireClean Fails the build if the working tree has uncommitted changes.
Git.RevParse Resolves a revision to a SHA as a step.
Git.ShortCommit Returns the short SHA of the commit being built.
Git.Tag Creates a git tag.

GitHub (3)

GitHub.CreatePr Creates a GitHub pull request.
GitHub.CreateRelease Creates a GitHub release with optional file uploads.
GitHub.PushImage Deprecated: pushes a Docker image to ghcr.io.

HTTP (3)

Http.Get Sends a GET request and returns the body and status code.
Http.PublicIpV4 Returns this machine's public IPv4 address.
Http.WaitForHealthy Polls URLs until they report healthy.

Node (1)

Node.Install Installs Node.js in the container.

Npm (5)

Npm.Build Runs npm run build.
Npm.Ci Runs npm ci for a clean, reproducible install.
Npm.Install Runs npm install in a directory.
Npm.Run Runs an npm script from package.json.
Npm.Test Runs npm test.

NuGet (3)

Nuget.EnsureAuthenticated Ensures a NuGet API key is available for publishing.
Nuget.Pack Creates a NuGet package from a project.
Nuget.Push Pushes NuGet packages to a feed.

Playwright (2)

Playwright.Install Installs Playwright browsers and system dependencies.
Playwright.Test Runs Playwright end-to-end tests.

Shell (2)

Shell.Bash Runs a bash script in the build container.
Shell.Run Runs a command with arguments in the build container.

139 operations

For LLM usage

Download quick-start resources: skills.md and llms.txt.

This is the current contents of llms.txt.

# ANDO - Build and Deploy Toolchain

> ANDO is a typed build system where build scripts are written in C# and executed in Docker containers.

## Quick Start

```
dotnet tool install -g ando
echo 'Log.Info("Hello, World!");' > build.csando
ando run
```

**Runtime Compatibility:** ANDO targets .NET 9. For the most predictable results, use a .NET 9 SDK image in your build container (e.g., `mcr.microsoft.com/dotnet/sdk:9.0`) unless you have a specific reason to deviate.

## LLM Guardrails (Read This Before Writing build.csando)

ANDO build scripts are compiled as C# scripts with a fixed, typed API surface. If you generate scripts with an LLM, follow these rules to avoid the most common hallucinations:

- Do NOT `using Ando.Core`, `using Ando.Dotnet`, `using Ando.Docker`, etc. Those namespaces are not part of the build-script surface. Use the globals documented below.
- Do NOT call `UseImage(...)`, `CopyArtifactsToHost(...)`, or `CopyZippedArtifactsToHost(...)` as global functions. They are methods on the `Ando` global: `Ando.UseImage(...)`, etc.
- `Env(name, required: bool)` has a second parameter named `required:` and it is a `bool`. There is no `Env(name, "default")` overload. Use `Env(..., required: false) ?? "default"` for defaults.
- `Dotnet.Build(...)` and `Dotnet.Test(...)` use simple option properties (not fluent methods). Example: `o.Configuration = Configuration.Release; o.NoRestore = true;`
- Docker tags use `WithTag(...)` (call it multiple times). There is no `WithTags(...)`.
- Steps register while the script is evaluated and run afterwards. C# `try`/`finally`, `if` and `foreach` around step calls therefore do not act at execution time. Use `Ando.Block`, `Ando.Finally`, `Ando.Defer` and `Ando.When` (see "Step model and deployment gates").
- Step outputs (`StepOutput`, `CommandStep`) can only be read inside execution-time lambdas (`Ando.Defer`, `Ando.When`, `Ando.Require`, `Ando.Report`, `Func<>` overloads). Reading one while the script is evaluated throws.

### Minimal Verified Example (Compiles)

```csharp
// ando-doc-snippet-test
// build.csando

var publish = DefineProfile("publish");

Ando.UseImage("mcr.microsoft.com/dotnet/sdk:9.0");

var app = Dotnet.Project("./src/App/App.csproj");
var tests = Dotnet.Project("./tests/App.Tests/App.Tests.csproj");

Dotnet.Restore(app);
Dotnet.Build(app, o => { o.Configuration = Configuration.Release; o.NoRestore = true; });
Dotnet.Test(tests, o => { o.Configuration = Configuration.Release; o.NoRestore = true; o.NoBuild = true; });

if (publish)
{
    Dotnet.Publish(app, o => o
        .WithConfiguration(Configuration.Release)
        .SkipRestore()
        .SkipBuild()
        .Output(Root / "artifacts" / "publish"));

    Docker.Build("Dockerfile", o => o
        .WithContext(".")
        .WithTag("myapp:local"));

    Ando.CopyZippedArtifactsToHost("artifacts", "./artifacts");
}
```

## Prerequisites

ANDO requires Docker to run builds in isolated containers. If Docker is not available, ANDO shows specific error messages:
- Docker not installed: Shows installation instructions for your platform.
- Docker daemon not running: Shows platform-specific instructions to start Docker Desktop (Windows/macOS) or the Docker daemon (Linux).

## CLI Commands

Listed in the order of `ando help`. Commands marked (AI) need Claude and are not deterministic; see "Optional AI-assisted commands" below.

- `ando` or `ando run` - Run the build script in a Docker container
- `ando verify` - Check build script for errors without executing
- `ando commit` (AI) - Commit all changes with AI-generated message using Claude
- `ando bump [patch|minor|major]` - (Deterministic with `changelog: template`; `--changelog claude` is AI.) Bump version across all projects in build.csando (default: patch). Changelog is generated from commits since the matching version tag (vX.Y.Z or X.Y.Z), falling back to the most recent tag if no exact match exists.
  - Opt-in release mode (no AI): flags `--changelog template|claude|none`, `--set <version>`, `--suggest` (prints minor if a feat commit exists since the last tag, else patch; last output line), `--dry-run`, `--no-commit`, `--tag` (annotated `<tagPrefix><version>` on the release commit, never pushed; refused before anything is written if the tag already exists; not with `--no-commit`). Unknown flags are rejected.
  - ando.config settings: `versionFiles` (replaces build.csando detection; the single PropertyGroup-child `<Version>` in .props/.csproj/.targets (PackageReference Version children kept; 0 or >1 refused) or "version" in package.json; validated before hooks; all must match), `versionScheme` (`semver` | `year-minor-patch` = YYYY.MINOR.PATCH; new year gives <year>.1.0; major rejected), `changelog` (`template`|`claude`|`none`), `changelogPaths` (git pathspecs passed after `--` to `git log` unmodified, so exclusions work: `["src","services","infra",":!src/website"]`), `changelogFile` (default CHANGELOG.md), `unreleasedHeading` (default `Unreleased`; matched case-insensitively, `## [Unreleased]` also matches), `keepUnreleased` (default false), `commitMessage` (`{version}` placeholder, default "Bump version to {version}"), `tagPrefix` (default `v`), `tagPattern` (default `v*`), `requireClean`. Template placement: the new `## <version> (<date>)` section goes immediately before the first `## ` heading (outside fenced code blocks), so the title, any YAML frontmatter and intro text stay above it; with no `## ` heading it is appended after the existing content. If a `## <unreleasedHeading>` section exists it is converted into the release instead: its heading becomes `## <version> (<date>)`, its hand-written lines stay first, then the generated groups and the review marker; with `keepUnreleased` a new empty Unreleased heading (written as before, e.g. `## [Unreleased]`) stays above. `--dry-run` prints exactly the section that would be written.
  - Template changelog: commits since the last tag matching tagPattern, grouped Features (feat) / Fixes (fix) / Other, lines `- <subject> (<sha7>)`, chore(release) and commitMessage-matching release commits skipped, written as `## <version> (<date>)` ending with `<!-- edit before committing -->`, placed before the first `## ` heading (or converted from the Unreleased section, see above).
  - Template/none mode or `requireClean: true`: refuses a dirty tree, never runs `ando commit` or Claude, commits only the files bump changed by explicit path. `ando release`/`ando ship` refuse a dirty tree in this mode (exit 1, no steps run) and show versions per versionFiles/versionScheme.
  - Example ando.config: `{"versionFiles":["Directory.Build.props"],"versionScheme":"year-minor-patch","changelog":"template","changelogPaths":["src","services","infra"],"commitMessage":"chore(release): {version}","tagPrefix":"v","tagPattern":"v*"}`
- `ando docs` (AI) - Update documentation using Claude (syncs version badges in docs files, then analyzes changes and updates relevant docs)
- `ando release` (AI) - Interactive release workflow (commit, docs, bump, push, publish). Steps are contextually enabled: commit skipped if no uncommitted changes, bump skipped if no changes since last tag, push skipped if no remote tracking.
- `ando release --all` - Run all applicable release steps non-interactively
- `ando release --dry-run` - Preview what release would do
- `ando ship` (AI) - Ship workflow (commit, bump, docs, push) without the publish step. Same as release but skips building/publishing artifacts.
- `ando ship --all` - Run all applicable ship steps non-interactively
- `ando ship --dry-run` - Preview what ship would do
- `ando clean` - Remove artifacts, temp files, and containers (removing container clears caches). ANDO automatically recreates the warm container when the requested build image differs from the running one, so changing the build image no longer requires a manual clean. Still clean (or use `--cold`) after upgrading ANDO or changing other container-affecting config, since the warm container persists the build environment between runs.
- `ando help`, `ando -h` or `ando --help` - Show available commands and options
- `ando --version` or `ando -v` - Show version number

Unknown commands show an error with the help text (e.g., `ando foo` displays "Unknown command: foo" and lists available commands).

### Cancellation (Ctrl+C)

- First Ctrl+C stops the running step (marked cancelled) and any command it left running in the build container, then runs on-failure and finally steps; commands started from then on ignore further Ctrl+C presses
- Second Ctrl+C prints a warning; cleanup keeps running
- Third Ctrl+C exits immediately (exit code 130) and skips the remaining cleanup; within 5 seconds it still tries to remove the `--ref` worktree and writes the run record with `"aborted": true`; for warm containers the temporary Azure profile is removed at the start of the next run (`--cold` removes the container). Any Ctrl+C-interrupted run exits with 130

### Run Options

- `-f, --file <file>` - Use a specific build file instead of build.csando
- `-p, --profile <profiles>` - Activate build profiles (comma-separated, e.g., `-p publish,release`)
- `--read-env` - Load environment file without prompting (checks for `.env.ando` first, falls back to `.env`)
- `--no-env` - Do not load the environment file for this run (no prompt, nothing forwarded, no `.env.ando` gitignore check; forwarded to `Ando.Build` child builds), even with `readEnv: true` in `ando.config`. Cannot be combined with `--read-env`.
- `--verbosity <level>` - Set output verbosity (quiet|minimal|normal|detailed)
- `--no-color` - Disable colored output
- `--cold` - Use a fresh container and remove it when the run ends (also after a forced exit with a third Ctrl+C)
- `--image <image>` - Use a custom Docker image
- `--dind` - Mount Docker socket for Docker-in-Docker builds
- `--ref <commit|tag>` - Build that commit instead of the working tree (`Ando.Build` child builds get the same `--ref` and run from the matching folder under the directory you ran from, and `Ando.StepTree` reads that commit). ANDO checks it out into a temporary detached git worktree (under the system temp directory), evaluates the build script from there and copies only those files into the container. Env files (`.env.ando`), `Ando.CopyToContainer` host paths, artifact copies to the host and run records still use the directory you ran `ando` from. The worktree is removed when the run ends. `Git.Commit`, `Git.ShortCommit`, `Git.LastTag` and `Git.ChangedSince` refer to the checked-out commit, and `Git.RequireClean` always passes. The build container never contains `.git`, in `--ref` runs and normal runs alike (ANDO copies the project without it). So SourceLink, `git describe` and any git command inside the container do not work; ANDO's `Git.*` operations run on the host and do work. `Dotnet.Build`, `Dotnet.Publish`, `Dotnet.Test` (when it builds) and `Nuget.Pack` therefore pass `-p:SourceRevisionId=<full commit>` automatically (the value of `Git.Commit`, HEAD of the source root, the `--ref` commit with `--ref`), so `InformationalVersion` gets `+<sha>`. Outside a git repository nothing is added. Use `WithSourceRevision(sha)` to set it yourself.
- `--record-path-file <file>` - Write the absolute path of the run record (one line) to `<file>` (relative to the invocation directory, the folder of the build script). An old file at that path is deleted when the run starts, so an early exit, `--dry-run` or a failed record write never leaves a stale path; nothing is written if the record could not be written.
- `--yes` - Accept every `Ando.Confirm` prompt (also forwarded to `Ando.Build` child builds). Without it, a run with no interactive console fails at the first `Ando.Confirm`.
- `--dry-run` - Evaluate the script and print the registered step tree (nested blocks, `on failure:` and `finally (runs last-registered first):` steps) without running any step or creating a container; exit code 0. `Ando.When` and `Ando.Defer` bodies show as one line because they run at execution time. `ando run` rejects unknown options, so a typo never starts a real run.

### Exit Codes and Run Locks

`ando run` exit codes: 0 success, 1 failure (including a failed artifact copy), 2 build script not found, 6 `.env.ando` not gitignored (declined), 7 GitHub OAuth scope check failed, 8 DIND check cancelled, 3 Docker not available, 4 profile validation failed, 5 generic or script error, 9 another ando run holds the container lock or an `Ando.Lock` name, 130 interrupted with Ctrl+C.

Each run automatically takes an exclusive lock on its build container (`~/.ando/locks/container-<container-name>.lock`) before it removes the container (`--cold`) or clears its Azure profile; a second run of the same script fails at once with exit code 9 and names the container. Set `ANDO_LOCK_DIR` to use another lock folder (the test suite does). `--dry-run` takes no lock; the OS releases the lock when the process ends. A lock folder that cannot be used only logs a warning for the container lock. `Ando.Lock("name")` adds a named lock (`name-<name>.lock`).

### Artifact Copy Failures

`Ando.CopyArtifactsToHost` and `Ando.CopyZippedArtifactsToHost` copy after the last step. If a copy fails (refused destination, destination that cannot be deleted, failed `docker cp`), the error is logged, the run exits with 1 and the run record has `"success": false` and an `artifact-copy-failed` entry under `reports`. Earlier versions only logged a warning and exited 0. To copy in step order and fail that step, use `Ando.CopyToHost`.

### Run Record

Every `ando run` writes `.ando/runs/<utc-time>.json` in the directory you ran from. It lists every step that ran (including steps in blocks, on-failure and finally steps) with `name`, `context`, `depth`, `cleanup` (true for on-failure/finally steps), start and end time, `success` and `error`, plus the values added with `Ando.Report`, the script, profiles and `ref`. Secret values are redacted. `.ando/runs/` contains its own `.gitignore`, so records never show up in `git status`.

### Secret Redaction

Values of environment variables whose names contain SECRET, PASSWORD, PASSWD, TOKEN, APIKEY, API_KEY, PRIVATE_KEY, CONNECTIONSTRING, CREDENTIAL, `_PAT` or end in KEY are replaced with `[REDACTED]` in console output, the build log and run records. Values shorter than 6 characters are not redacted.

### Docker-in-Docker (DIND) Detection

ANDO automatically detects when your build script uses operations requiring DIND (Docker.Build, Docker.Install, GitHub.PushImage, Playwright.Test). This detection also scans child builds invoked via `Ando.Build()`. If DIND is needed but not enabled, ANDO prompts:
- (Y)es - Enable DIND for this run only
- (A)lways - Enable DIND and save to ando.config
- Esc - Cancel the build

To skip the prompt, use `--dind` flag, add `dind: true` to `ando.config`, or set `ANDO_DIND=1` environment variable. Child builds automatically inherit DIND mode from parent builds (passed via both container and host process environment).

**Non-interactive warning (CI):** If stdin is not interactive (CI, redirected output, some servers), the DIND prompt cannot be answered. In CI, always enable DIND explicitly via `ando run --dind ...`, `dind: true` in `ando.config`, or `ANDO_DIND=1`.

**CI Server:** When running on the ANDO CI Server, the Docker CLI is automatically installed in DIND build containers. `Docker.Install()` is not required in build scripts on the server, but is recommended for portability. The server also configures a git committer identity (`user.name`/`user.email`) in build containers automatically, so `Git.Tag()` with annotated tags works without manual setup. Default: `Ando Server <ando-server@localhost>`. Override with `GIT_COMMITTER_NAME`/`GIT_COMMITTER_EMAIL` env vars.

**Timeouts:** Standard command operations use a 5-minute per-command timeout. This includes Npm.Install, Npm.Ci, Npm.Run, Npm.Test, and Npm.Build. If the command exceeds the timeout, ANDO stops the process tree and the failed-step log reports the timeout (for example, `Command timed out after 300000ms`). The ANDO CI Server also applies a separate whole-build timeout: default 15 minutes, max 60 minutes, configurable with project settings and `Build__DefaultTimeoutMinutes` / `Build__MaxTimeoutMinutes`.

**CI Server health checks:** `GET /health` returns 200 when the database is reachable, 503 otherwise (no auth required — use for load balancers and Docker health checks). The JSON includes `database` with the configured provider (`SqlServer` or `PostgreSql`). `GET /api/admin/system-health` (admin-only) probes database, job storage (reported separately from the database), background jobs, and GitHub App authentication, returning per-subsystem status (`healthy`/`warning`/`error`). `GET /live` returns 200 `{"status":"live"}` with no dependencies (liveness probe; a database outage does not fail it). `GET /ready` returns 200 `{"status":"ready","database":"<provider>"}` when the database accepts connections, else 503 `{"status":"unready",...}` (readiness probe). Both anonymous; the image's Docker healthcheck keeps using `/health`. Block the probes on the public hostname, e.g. Caddy: `@probes path /health /health/* /ready` + `respond @probes 404` before `reverse_proxy localhost:8080`.

**CI Server optional in-app self-update (admin):** Enable with `SelfUpdate__Enabled=true` in `/opt/ando/config/.env`. The server checks every 5 minutes for a newer `ghcr.io/aduggleby/ando-server:latest` image. When available, admins see an update bar in the web UI. Triggering update queues a background job that starts a helper Docker CLI container to run `docker compose pull ando-server` and `docker compose up -d ando-server`. A full-screen overlay with countdown and automatic reconnect handles the restart seamlessly. The web UI also detects version changes independently — if the server is updated externally, all open browser tabs automatically clear caches and reload within 60 seconds.

**CI Server database:** The server runs on SQL Server (default) or PostgreSQL, selected by `Database__Provider` (`SqlServer` | `PostgreSql`, default `SqlServer`) with `ConnectionStrings__DefaultConnection` in the provider's native format. Unknown provider values and unparseable connection strings fail startup. To move data to another provider or host, use export/import (below).
```bash
# SQL Server
Database__Provider=SqlServer
ConnectionStrings__DefaultConnection=Server=HOST,1433;Database=AndoServer;User Id=ando;Password=...;TrustServerCertificate=true;Encrypt=true
# PostgreSQL
Database__Provider=PostgreSql
ConnectionStrings__DefaultConnection=Host=HOST;Port=5432;Database=AndoServer;Username=ando;Password=...
```
The server applies EF Core migrations on startup (creates the Ando tables). Hangfire creates its own schema: `HangFire` (SQL Server) or `hangfire` (PostgreSQL). The database login needs permission to create tables and schemas.

**CI Server installer options:** `server-install.sh --db sqlserver|postgres` (default `sqlserver`) picks the provider; `--db postgres` deploys an `ando-postgres` container (`postgres:17`, data in `/opt/ando/data/pgdata`) instead of `ando-sqlserver`. Data directory ownership under rootless Docker: container UID/GID `N` maps to host `start + N - 1`, with `start` read from the `ando` entries in `/etc/subuid` and `/etc/subgid` (PostgreSQL N=999, SQL Server N=10001; with the default `ando:100000:65536` that is 100998 and 110000); the installer fails if the entry is missing or too small. `--external-db [connection-string]` uses an existing database of the selected provider (prompted when omitted); `--external-sql` is an alias. `--build-local` builds the image locally.

**CI Server + External SQL Server setup:** If you install with `--external-db` (SQL Server), create a dedicated SQL database/login first.

Example (`sqlcmd`):
```bash
sqlcmd -S YOUR_SERVER_IP,1433 -U sa -P 'YOUR_SA_PASSWORD' -C
```

SQL:
```sql
CREATE DATABASE AndoServer;
GO
CREATE LOGIN ando WITH PASSWORD = 'YourSecurePassword123!';
GO
USE AndoServer;
GO
CREATE USER ando FOR LOGIN ando;
GO
ALTER ROLE db_owner ADD MEMBER ando;
GO
```

Connection string example:
```bash
Database__Provider=SqlServer
ConnectionStrings__DefaultConnection=Server=YOUR_SERVER_IP,1433;Database=AndoServer;User Id=ando;Password=YourSecurePassword123!;TrustServerCertificate=true;Encrypt=true
```

**CI Server + External PostgreSQL setup:** With `--db postgres --external-db`, create a role that owns the database (owner can create the tables and the `hangfire` schema):
```sql
CREATE ROLE ando LOGIN PASSWORD 'YourSecurePassword123';
CREATE DATABASE "AndoServer" OWNER ando;
```
```bash
Database__Provider=PostgreSql
ConnectionStrings__DefaultConnection=Host=YOUR_SERVER_IP;Port=5432;Database=AndoServer;Username=ando;Password=YourSecurePassword123;SSL Mode=VerifyFull;Root Certificate=/app/config/postgres-ca.crt
```
TLS: use `SSL Mode=VerifyFull` for remote databases; for a private CA, mount the CA file read-only into the container (for example `/opt/ando/config/postgres-ca.crt:/app/config/postgres-ca.crt:ro`) and reference it with `Root Certificate=`. Connection pool: Npgsql allows up to 100 pooled connections per connection string by default; EF Core and Hangfire share one string, so set `Maximum Pool Size=` when running several instances against a database with a low `max_connections`.

**CI Server backup and restore:** The installer adds a daily 2 AM backup job for every install (`/opt/ando/scripts/backup.sh`, 7 daily + 12 monthly kept in `/opt/ando/backups/`). Every run writes `ando-*-config.tar.gz` (`config/` with `.env` incl. `Encryption__Key` and `github-app.pem`, `docker-compose.yml`, Caddyfile) and `ando-*-keys.tar.gz` (Data Protection keys). Containerized databases are also dumped: SQL Server `BACKUP DATABASE` to `ando-*.bak`, PostgreSQL `pg_dump --format=custom` (inside `ando-postgres`) to `ando-*.dump`. With `--external-db` the database is not dumped; back it up with its own tooling. Project secrets are AES-encrypted with `Encryption__Key` and cannot be recovered without it; without the keys archive all users are signed out. The config and keys archives do not depend on the database provider. Restore config and keys first (`tar -xzf ...-config.tar.gz -C /`, `tar -xzf ...-keys.tar.gz -C /opt/ando/data/`), then the database (external: with its own tooling). TrueNAS (no backup job): back up `Encryption__Key` and the `keys` dataset yourself alongside the database.
```bash
# Restore PostgreSQL (stop ando-server first)
docker exec -i ando-postgres pg_restore -U ando -d AndoServer --clean --if-exists < /opt/ando/backups/ando-daily-YYYYMMDD.dump
# Restore SQL Server (copy the .bak into /opt/ando/data/sqldata/backup/ first)
docker exec ando-sqlserver /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -C -Q "RESTORE DATABASE AndoServer FROM DISK = '/var/opt/mssql/backup/ando-daily-YYYYMMDD.bak' WITH REPLACE"
```
PostgreSQL major-version upgrades (for example 17 to 18) change the data directory format: dump, move `pgdata` aside, change the image tag, start an empty `ando-postgres`, then `pg_restore`.

**CI Server file logging:** stdout logging is always on. Optional daily log files: `Logging__File__Enabled` (default `false`), `Logging__File__Path` (directory, default `/var/log/ando` inside the container; mount a volume there), `Logging__File__RetainedDays` (default `90`). Files are named `ando-yyyyMMdd.log`. `Logging__LogLevel__*` levels apply to file and stdout alike. If the directory is not writable the server logs a warning at startup and continues without the file.

**CI Server moving an instance (export and import):** To move to a new host or switch provider (SQL Server <-> PostgreSQL), the server image has a CLI mode that writes all Ando data (users, roles, projects, encrypted secrets, builds, logs, artifact metadata, API tokens, settings; IDs preserved) to one JSON Lines file and loads it elsewhere.
```bash
# Source (stop ando-server first)
docker compose run --rm ando-server export --output /data/artifacts/export/ando-export.jsonl [--overwrite]
# TrueNAS-style compose app
docker exec <container> dotnet Ando.Server.dll export --output /data/artifacts/export/ando-export.jsonl
# Target (started once to migrate and seed, then stopped)
docker compose run --rm ando-server import --input /data/artifacts/export/ando-export.jsonl [--force]
docker exec <container> dotnet Ando.Server.dll import --input /data/artifacts/export/ando-export.jsonl [--force]
```
Checklist: identical `Encryption__Key` on both (every secret is decrypted as a check; failure rolls back); same Ando version on both (schema fingerprint check); stop the source during export; start the target once so it migrates and seeds roles, stop it, then import; copy `data/artifacts`, `data/repos`, `data/keys`, `github-app.pem` and `.env` separately. The Hangfire queue is not migrated: `Queued`/`Running` builds become `Cancelled` ("Cancelled by data import"). SQL Server -> PostgreSQL loses the seventh decimal of timestamps (100 ns -> 1 µs). The target must be empty unless `--force` (deletes all Ando data first); the import is one transaction (row counts and secrets verified, rollback on any error). Exit code 0/1; `--help` prints usage. A leftover `<output>.partial` file is an aborted export. Format: line 1 manifest (`format`, `formatVersion`, version, source provider, last migration, schema fingerprint, export time), then `{"table":...,"row":{...}}` lines grouped by table in foreign-key order, last line `{"table":"__end","rowCounts":{...}}` (missing = truncated, refused).

**CI Server project secrets:** Passed to builds as environment variables; values are AES-256 encrypted with `Encryption__Key` (in `config/.env`, not in the database). Names must match `^[A-Za-z_][A-Za-z0-9_]*$` and be at most 100 characters; names are case-insensitive per project (`API_KEY` = `api_key`). Names created before this rule are kept and still reach builds; to change one, delete it and re-create it under a valid name.

**CI Server upgrade notes:** Existing SQL Server installs: project secrets gain a `NormalizedName` column, backfilled with a collation-independent uppercase of each existing name, with a unique index per project. Legacy names that the new naming rule would reject stay deletable by their exact stored name but cannot be updated in place. If two secrets in one project differ only by case, the migration fails with SQL error 50001 and rolls back completely; delete one (re-create it under another name if needed), before upgrading or by starting the previous image again, then retry. Rolling back to an older server image after a successful upgrade requires restoring the database backup taken before the upgrade. API timestamps are always UTC with a trailing `Z` on both providers.

**CI Server local development:** `docker compose up -d` (SQL Server) or `docker compose -f docker-compose.yml -f docker-compose.postgres.yml up -d` (PostgreSQL, host port 17134); `./run-dev.sh --db sqlserver|postgres`. E2E: `npm test` / `npm run test:sqlserver` (SQL Server) and `npm run test:postgres` (PostgreSQL) in `tests/Ando.Server.E2E`; server tests: `dotnet test tests/Ando.Server.Tests --filter "Category!=Integration"` (unit + migration drift, no Docker) and `--filter "Category=Integration"` (Testcontainers, needs Docker, both providers by default; limit with `ANDO_TEST_DB_PROVIDERS=SqlServer`; `ANDO_TEST_DB_CONTAINERS=isolated` gives unique containers, random ports, and cleanup, and is the default when `CI` or `ANDO_HOST_ROOT` is set or the tests run inside a container).

**CI Server on TrueNAS SCALE:** works with SQL Server or the TrueNAS Postgres app; see https://andobuild.com/server-truenas.md

### Project File Copying

When ANDO starts a build, it copies project files into the Docker container. If the project is a git repository and `git` is available, ANDO uses `git ls-files` to respect `.gitignore` rules — ignored files (build outputs, node_modules, etc.) are automatically excluded. If not a git repo (or git unavailable), ANDO falls back to excluding a fixed set of directories: .git, node_modules, bin, obj, and .ando/cache.

### Optional AI-assisted commands

`ando commit`, `ando docs`, `ando release`, `ando ship` and the `--changelog claude` mode of `ando bump` call the Claude CLI. They need Claude installed and their output is NOT deterministic (commit messages, documentation edits and changelog entries can differ on every run; review them):
- `ando commit` - Generates commit messages from diffs
- `ando docs` - Reviews commits since last tag and updates documentation
- `ando release` and `ando ship` - Run `ando commit` and `ando docs` as workflow steps
- `ando bump --changelog claude` - Generates changelog entries and updates changelog files

Deterministic, AI-free path: `ando bump` with `changelog: template` in ando.config (or `--changelog template`) builds the changelog from commit messages without AI. `ando run` never uses Claude.

Requirements: Claude CLI must be installed (`npm install -g @anthropic-ai/claude-code`)

### Docs Command Details

Before running Claude, `ando docs` automatically syncs version badges in `website/src/pages/index.astro` and `README.md` to the current project version. This is non-fatal — failures are logged as warnings.

The `ando docs` command searches for and updates these files:

| Pattern | Location | Description |
|---------|----------|-------------|
| `*.md` | Anywhere | Markdown documentation files |
| `*.astro` | `website/` | Astro page components |
| `*.js` | `website/` | JavaScript data files |
| `llms.txt` | `public/` | LLM-friendly documentation |

Files skipped:
- `CHANGELOG.md` - Handled by `ando bump`
- Internal refactoring - Only user-facing changes

What triggers updates:
- New features, operations, or commands
- Changed behavior affecting users
- New options, parameters, or configuration
- Examples that need updating

Permissions: Claude runs with `--dangerously-skip-permissions` to allow file edits without interactive prompts. On first use, ANDO prompts:
- (Y)es - Allow Claude for this run only
- (n)o - Cancel the command
- (A)lways - Allow Claude and save `allowClaude: true` to ando.config

To skip the prompt, add `allowClaude: true` to your `ando.config` file.

### Configuration File

ANDO supports an optional `ando.config` file (YAML format) in the project root:

```yaml
# ando.config
dind: true
readEnv: true
allowClaude: true
```

Settings:
- `dind` - Enable Docker-in-Docker mode by default
- `readEnv` - Automatically load environment files without prompting
- `allowClaude` - Allow Claude CLI to run with elevated permissions without prompting

### Environment Files

ANDO looks for `.env.ando` (preferred) or `.env` (fallback) in the project root.

If `.env.ando` exists but is not in `.gitignore`, ANDO warns about potential secret exposure and prompts:
- (A)dd to .gitignore - Appends `.env.ando` to `.gitignore` (default)
- (C)ontinue anyway - Proceed without modifying `.gitignore`
- Esc - Abort the build

When environment variables are found, ANDO prompts:
- (Y)es - Load for this run only
- (n)o - Skip loading
- for this (r)un - Load for this run and all sub-builds
- (a)lways - Load and save `readEnv: true` to ando.config

Use `--read-env` or set `readEnv: true` in `ando.config` to skip the prompt and load automatically. Use `--no-env` to skip the file entirely for one run (it also skips the `.env.ando` gitignore check and is forwarded to `Ando.Build` child builds; an error together with `--read-env`).

### Project Files

ANDO uses and creates these files/directories:

| Path | Description |
|------|-------------|
| `build.csando` | Build script (C# with Roslyn scripting) |
| `ando.config` | YAML config file for persistent settings |
| `.env.ando` | Environment variables (preferred, project-specific) |
| `.env` | Environment variables (fallback) |
| `build.csando.log` | Plain-text log of last build run (overwritten each run) |
| `.ando/cache/` | Package caches persist inside warm containers (not on host) |
| `.ando/tmp/` | Temporary files used during builds |
| `artifacts/` | Default output directory for build artifacts |

### Logging

ANDO writes a plain-text log to `build.csando.log` in the project root. This file is overwritten on each build run (not appended) and contains the same output as the console without ANSI color codes.

### Suggested .gitignore

```gitignore
# ANDO build system
.env.ando
build.csando.log
.ando/
artifacts/
```

Explanation:
- `.env.ando` - Contains secrets (API keys, tokens). ANDO warns if not gitignored.
- `build.csando.log` - Build output log, regenerated on each run.
- `.ando/` - Cache directories (NuGet, npm) and temp files. Large and machine-specific.
- `artifacts/` - Build outputs. Should be regenerated, not committed.

### Hooks (Pre-Build and Post-Build)

ANDO supports pre-build and post-build hooks - `.csando` scripts that run automatically before and after CLI commands. Hooks execute on the host machine (not in Docker).

**Hook Types:**
| Hook | When It Runs |
|------|--------------|
| `ando-pre.csando` | Before **every** command |
| `ando-post.csando` | After **every** command |
| `ando-pre-{cmd}.csando` | Before a **specific** command |
| `ando-post-{cmd}.csando` | After a **specific** command |

**File Locations (first found wins):**
1. `./scripts/ando-{hook}.csando`
2. `./ando-{hook}.csando`

**Hook API:**
| Global | Description |
|--------|-------------|
| `Root` | Project root path (supports `/` operator) |
| `Log` | Logging: `Log.Info()`, `Log.Warning()`, `Log.Error()` |
| `Shell` | Execute commands (hooks only): `await Shell.RunAsync("cmd", "args")` |
| `Env(name)` | Get environment variable |
| `Secrets.UserSecrets(idOrProjectPath)` | Read a .NET user secrets store on the host at evaluation; values redacted |
| `Secrets.EnvFile(path, keys...)` | Read named keys from a dotenv file (use `.env.secrets`, not the auto-loaded `.env.ando`); not exported by this call; values redacted |
| `Directory(path)` | Create directory reference |

**Important:** `Shell` is a hooks-only API. It is not a global in `build.csando` build scripts.

**Environment Variables:**
| Variable | Available In | Description |
|----------|--------------|-------------|
| `ANDO_COMMAND` | All hooks | Command being executed |
| `ANDO_EXIT_CODE` | Post-hooks only | Exit code (`0` = success) |
| `ANDO_OLD_VERSION` | bump hooks | Version before bump |
| `ANDO_NEW_VERSION` | post-bump | Version after bump |
| `ANDO_BUMP_TYPE` | bump hooks | patch, minor, or major |

**Behavior:**
- Pre-hook failure aborts the command
- Post-hook failure only warns (command already completed)
- For `release` and `ship` commands, post-hooks only run when the command succeeds (exit code 0)

**Example pre-hook (validate before bump):**
```csharp
// scripts/ando-pre-bump.csando
var result = await Shell.RunAsync("dotnet", "test", "--no-build");
if (result.ExitCode != 0) throw new Exception("Tests must pass");
```

**Example post-hook (auto-update after release):**
```csharp
// scripts/ando-post-release.csando
// Skip if release failed
var exitCode = Env("ANDO_EXIT_CODE", required: false);
if (exitCode != "0") return;

await Shell.RunAsync("dotnet", "tool", "update", "-g", "mytool");
Log.Info("Tool updated!");
```

Full documentation: https://andobuild.com/hooks

## Key Facts

- File: `build.csando` (C# code, no .cs extension)
- Execution: All builds run in Docker containers. Operations register steps that run in the container, with these exceptions: `Git.*` operations and `Ando.Build` and `Ando.StepTree` run on the host (`Ando.Build` starts a child `ando` build with its own container), and the evaluation-time members `Git.Commit`, `Git.ShortCommit`, `Git.CommitTime`, `Git.ChangedSince`, `Git.LastTag`, `Dotnet.ReadVersion`, `Docker.IsAvailable` and `Docfx.IsInstalled` are not steps at all (see "Evaluated when the script loads" under All Operations)
- No `using` statements needed - namespaces are pre-imported
- Operations register steps that execute in order, after the whole script has been evaluated
- The image `mcr.microsoft.com/dotnet/sdk:10.0` (Ubuntu 24.04) has curl, tar, openssl, git and bash but not `zip` or `unzip`. `AppService.DeployFolder` installs zip itself and `Bun.Install` installs unzip.

## Scripting Basics

Build scripts are C# code executed via Roslyn scripting. Everything in the script runs at the top level (no class or method wrappers needed). The following are available as **globals** — no prefix or import required.

### Global Functions (NOT on the Ando object)

The bare globals are `Root`, `Temp`, `Directory()`, `Env()`, `DefineProfile()` and `Log`, plus the operation objects (`Dotnet`, `Npm`, `Git`, and so on; see "Operation Objects"). `Directory()`, `Env()` and `DefineProfile()` are standalone functions, NOT methods on the `Ando` object:

```csharp
// CORRECT - these are global functions:
var dir = Directory("./frontend");
var key = Env("API_KEY");
var release = DefineProfile("release");

// WRONG - these are NOT on the Ando object:
// var dir = Ando.Directory("./frontend");  // ERROR
// var key = Ando.Env("API_KEY");           // ERROR
```

### Environment Variables (Env)

The `Env()` function gets environment variables. Its signature is:
```
string? Env(string name, bool required = true, bool secret = false)
```

Three usage patterns:
```csharp
// 1. Required (default) - throws if not set
var apiKey = Env("API_KEY");

// 2. Optional - returns null if not set
var optional = Env("OPTIONAL_VAR", required: false);

// 3. Optional with default - use null-coalescing
var lang = Env("SITE_LANG", required: false) ?? "en";
```

The value is registered for redaction when the name looks secret (`*_TOKEN`, `*_SECRET`, `*_PASSWORD`, `*_KEY` ...) or when `secret: true` is passed.

**Important:** The second parameter is `required:` (a bool), NOT a default value. `Env("NAME", "default")` will NOT compile — use `Env("NAME", required: false) ?? "default"` instead.

There is no `SetEnv()` function. Environment variables must be set externally via `.env.ando` files, the OS environment, or CI/CD configuration.

### Secrets

Secrets are redacted by value (console, `build.csando.log`, run records, `--dry-run` trees; values under 6 characters are never redacted). UserSecrets values are registered for redaction when the script reads them (indexer or `TryGet`), so read config through `Secrets` only if it is secret; each line of a multi-line value is also redacted on its own. Both `Secrets` members run on the host while the script is evaluated (not steps) and return a read-only set: `set["Key"]` throws an error naming the missing key (never a value); `set.TryGet(key, out value)` returns false instead.

```csharp
// .NET user secrets: ~/.microsoft/usersecrets/<id>/secrets.json (Windows: %APPDATA%\Microsoft\UserSecrets\<id>\secrets.json). No dotnet call.
// Argument: the UserSecretsId, or a .csproj (or a folder with exactly one) to read it from. Nested JSON is flattened with ':'.
var sp = Secrets.UserSecrets("simplesign365-dev");
var clientSecret = sp["Deploy:Azure:ClientSecret"];

// Named keys from a dotenv file. Use a separate file (.env.secrets): .env.ando / .env is still loaded and forwarded to every
// container command unless the run uses --no-env (a warning is logged when Secrets.EnvFile reads it). A file in a git repo that is
// not gitignored fails at evaluation. This call itself does NOT set the values in the process environment.
var cf = Secrets.EnvFile(".env.secrets", "CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID");
Cloudflare.UseCredentials(cf["CLOUDFLARE_API_TOKEN"], cf["CLOUDFLARE_ACCOUNT_ID"]);
```

### Two Path Types: BuildPath vs DirectoryRef

ANDO has two path types that serve different purposes:

| Type | Created By | Used For |
|------|-----------|----------|
| `BuildPath` | `Root`, `Temp`, path `/` operator | Path construction and string arguments |
| `DirectoryRef` | `Directory()` function | Operations that need a working directory (Npm, Cloudflare, Playwright, Ando.Build) |

```csharp
// BuildPath - for path construction and string arguments
var outputPath = Root / "dist";              // BuildPath
Dotnet.Publish(app, o => o.Output(outputPath)); // OK: accepts string/BuildPath

// DirectoryRef - for operations that need a working directory
var frontend = Directory("./frontend");      // DirectoryRef
Npm.Ci(frontend);                            // OK: requires DirectoryRef

// WRONG: Root is BuildPath, not DirectoryRef
// Npm.Ci(Root);                             // ERROR: type mismatch
// Use Directory(".") instead:
Npm.Ci(Directory("."));                      // OK
```

`DirectoryRef` also supports the `/` operator:
```csharp
var site = Directory("./frontend");
Cloudflare.PagesDeploy(site / "dist", "my-project");  // DirectoryRef / string = DirectoryRef
```

### Profiles

Profiles allow conditional execution. `DefineProfile()` takes a single argument (the name) and returns a `Profile` object that you **must capture in a variable**. The `Profile` object has implicit `bool` conversion — it evaluates to `true` when that profile is active (activated via `-p` CLI flag):

```csharp
// Define at the top of your script — capture the return value
var release = DefineProfile("release");     // Returns Profile object
var publish = DefineProfile("publish");

// The Profile variable evaluates to true/false in if statements
if (release) {
    Git.Tag("v1.0.0");         // Only runs when: ando -p release
}

if (publish) {
    Nuget.Push(app);            // Only runs when: ando -p publish
}

// Activate via CLI:
// ando -p release
// ando -p publish,release  (multiple profiles)
```

**Note:** There is no `HasProfile()`, `HasAnyProfile()`, or `Profile("name")` function. The only way to define and check profiles is `DefineProfile()` + `if (profile)`.

## Global Variables

### Path Globals

| Variable | Type | Description |
|----------|------|-------------|
| Root | BuildPath | Project root directory (where build.csando is). Supports `/` operator for path joining. Use for path construction, NOT for operations requiring DirectoryRef. |
| Temp | BuildPath | Temporary files directory (root/.ando/tmp). Supports `/` operator for path joining. |

### Operation Objects

| Variable | Type | Description |
|----------|------|-------------|
| Dotnet | DotnetOperations | .NET CLI operations (build, test, publish). |
| Ef | EfOperations | Entity Framework Core operations. |
| Npm | NpmOperations | npm operations (install, run, ci). Requires DirectoryRef arguments. |
| Node | NodeInstallOperations | Node.js installation. |
| Bun | BunOperations | Bun installation. |
| Azure | AzureOperations | Azure CLI authentication and `az` commands (`Azure.Cli`, `Azure.Vm.RunCommand`). |
| Shell | ShellCommandOperations | Run any command or bash script in the build container (`Shell.Run`, `Shell.Bash`). |
| Bicep | BicepOperations | Azure Bicep deployments. |
| AppService | AppServiceOperations | Azure App Service deployments. |
| Http | HttpOperations | HTTP health-check gating (wait for an endpoint to be healthy). |
| Functions | FunctionsOperations | Azure Functions deployments. |
| Cloudflare | CloudflareOperations | Cloudflare Pages deployments. Requires DirectoryRef arguments. |
| Nuget | NugetOperations | NuGet package operations (pack, push). |
| Docker | DockerOperations | Docker image building. |
| Docfx | DocfxOperations | DocFX API documentation generation. |
| Git | GitOperations | Git version control operations (tag, push). |
| GitHub | GitHubOperations | GitHub releases, PRs, and container registry. |
| Ando | AndoOperations | Build configuration, artifacts, and nested builds. |
| Archive | ArchiveOperations | Deterministic zip and tar.gz archives (`Archive.Zip`, `Archive.TarGz`). |
| Files | FilesOperations | Copy files and directories in the container (`Files.Copy`). |
| Log | LogOperations | Logging (Info, Warning, Error, Debug). |
| Playwright | PlaywrightOperations | Playwright E2E testing. Requires DirectoryRef arguments. |

## Global Functions

| Function | Signature | Returns | Description |
|----------|-----------|---------|-------------|
| Directory | Directory(path = ".") | DirectoryRef | Create a directory reference for use with operations like Npm, Cloudflare, Playwright, and Ando.Build. |
| Env | Env(name, required = true) | string? | Get environment variable. Throws if not set by default. Use `Env("NAME", required: false) ?? "default"` for optional with default. |
| DefineProfile | DefineProfile(name) | Profile | Define a build profile. Returns Profile with implicit bool conversion. Activate with `-p name`. |

## Common Patterns

### Path Operations
```csharp
var outputPath = Root / "artifacts" / "publish";
var distDir = Directory("./frontend") / "dist";
```

### .NET Build + Test + Publish
```csharp
var project = Dotnet.Project("./src/MyApp/MyApp.csproj");
Log.Info($"Building {project.Name} version {project.Version}");

Dotnet.Restore(project);
Dotnet.Build(project);
Dotnet.Test(project);
Dotnet.Publish(project, o => o.Output(Root / "artifacts"));
```

### Frontend Build
```csharp
var frontend = Directory("./frontend");

Node.Install("20");
Npm.Ci(frontend);
Npm.Run(frontend, "build");
```

### Azure Deployment
```csharp
Azure.EnsureAuthenticated();
Azure.SetSubscription("my-subscription-id");

AppService.DeployZip("my-app", Root / "artifacts" / "app.zip");
```

### Cloudflare Pages
```csharp
Cloudflare.EnsureAuthenticated();
Cloudflare.PagesDeploy(Directory("./website") / "dist", "my-project");
```

### Copy Artifacts to Host
```csharp
// Copy build outputs from container to host after build completes
Ando.CopyArtifactsToHost("dist", "./dist");

// Copy as compressed archive (faster for many small files)
Ando.CopyZippedArtifactsToHost("dist", "./output");              // Creates ./output/artifacts.tar.gz
Ando.CopyZippedArtifactsToHost("dist", "./dist/binaries.tar.gz"); // Specific .tar.gz filename
Ando.CopyZippedArtifactsToHost("dist", "./dist/binaries.zip");    // Zip format
```

### Set Docker Image
```csharp
// Use a specific Docker image for the build
Ando.UseImage("mcr.microsoft.com/dotnet/sdk:9.0");
```

### GHCR Publish Template (Copy/Paste)

```csharp
// Publish a multi-arch Docker image to GitHub Container Registry (GHCR).
// Requirements:
// - run with DIND enabled (CI: `ando run --dind ...`)
// - `GITHUB_TOKEN` available with `write:packages` scope for GHCR pushes

var version = Dotnet.Project("./src/MyApp/MyApp.csproj").Version;

// Prefer GitHub Actions vars when present; fall back to a fixed owner/name.
var owner = Env("GITHUB_REPOSITORY_OWNER", required: false) ?? "my-org";
var imageName = "my-app";

Docker.Install();
Docker.Build("./Dockerfile", o => o
    .WithPlatforms("linux/amd64", "linux/arm64")
    .WithTag($"ghcr.io/{owner}/{imageName}:{version}")
    .WithTag($"ghcr.io/{owner}/{imageName}:latest")
    .WithContext(".")
    .WithPush());
```

### Nested Builds
```csharp
// Run a child build in a subdirectory (own container, own .env.ando or .env)
Ando.Build(Directory("./website"));

// Run a specific build file
Ando.Build(Directory("./website") / "deploy.csando");

// With options
Ando.Build(Directory("./api"), o => o.WithDind().ColdStart());

// A variable that exists in the child process only
Ando.Build(Directory("./website"), o => o.WithEnv("CLOUDFLARE_API_TOKEN", Env("CLOUDFLARE_API_TOKEN")));
```

The child is the same CLI that runs the parent and inherits `--yes` and `--no-env`. With `--ref` the child gets the same `--ref` and runs from the matching folder under the directory you ran from (not the temporary worktree), so its artifacts, env file and run record stay in the project. The parent's run record gets `child record <path>` (the child's path relative to the directory you ran from, for example `child record website/build.csando`; ` #2`, ` #3` when the same path is built again) with the path of the child's run record.

### Full Example: .NET Tool with NuGet Publishing
```csharp
// build.csando - Build .NET tool with profiles for conditional publishing
// Usage:
//   ando              # Build and test only
//   ando -p publish      # Build, test, and push to NuGet.org + deploy docs

var publish = DefineProfile("publish");

var project = Dotnet.Project("./src/MyTool/MyTool.csproj");
var testProject = Dotnet.Project("./tests/MyTool.Tests/MyTool.Tests.csproj");
var distPath = Root / "dist";

// Install .NET SDK
Dotnet.SdkInstall();

// Restore dependencies
Dotnet.Restore(project);

// Build the project
Dotnet.Build(project);

// Run tests
Dotnet.Test(testProject);

// Publish for multiple platforms
var runtimes = new[] { "win-x64", "linux-x64", "osx-x64", "osx-arm64" };

foreach (var runtime in runtimes)
{
    Log.Info($"Publishing for {runtime}...");
    Dotnet.Publish(project, o => o
        .WithRuntime(runtime)
        .Output(distPath / runtime)
        .AsSelfContained()
        .AsSingleFile());
}

// Create NuGet package for the dotnet tool
Nuget.Pack(project);

// Push to NuGet.org (only with -p publish)
if (publish)
{
    Nuget.EnsureAuthenticated();
    Nuget.Push(project);

    // Build and deploy the documentation website
    Ando.Build(Directory("./website"));
}

// Copy the dist folder from container to host
Ando.CopyArtifactsToHost("dist", "./dist");
Ando.CopyZippedArtifactsToHost("dist", "./dist/binaries.zip");
```

## Step model and deployment gates

### Execution model

A build script runs in two phases:

1. Evaluation: ANDO runs your C# top to bottom. Every operation (`Dotnet.Build`, `AppService.SwapSlots`, `Shell.Run`, ...) only registers a step. Nothing runs yet.
2. Execution: ANDO runs the registered steps in order, stopping at the first failure.

Plain C# control flow therefore runs in phase 1. `try`/`finally` around a step call does not wrap the step's execution, and `if (output.Value == "x")` cannot see output that does not exist yet. Use these instead:

| Need | Use |
|------|-----|
| Group steps, handle failure, clean up | `Ando.Block(name, body).OnFailure(...).Finally(...)` |
| Run steps at the end of the run (or enclosing block), whatever happened | `Ando.Finally(body)` |
| Run C# at execution time, then run the steps it registers | `Ando.Defer(body)` |
| Run steps only if a runtime condition holds | `Ando.When(condition, then, otherwise?)` |
| Fail the build if a runtime condition is false | `Ando.Require(condition, message)` |
| Ask before continuing | `Ando.Confirm(string \| Func<string>)` |
| Record a value in the run record | `Ando.Report(key, string \| StepOutput \| Func<string>)` |

Steps that return `StepOutput` or `CommandStep` can be read only at execution time. Reading `Value`, `ExitCode`, `StatusCode` or `Json(...)` before the step ran throws.

### Ordering on failure and cancellation

- A failing step stops its scope (run, block or deferred body). The steps after it do not run.
- For a failed block, ANDO runs the block's `OnFailure` steps first, then its `Finally` steps. The block still fails, and the failure moves to the enclosing scope.
- With nested blocks the order is: inner `OnFailure`, inner `Finally`, outer `OnFailure`, outer `Finally`.
- `Finally` steps of one scope run last-registered first, like nested `try`/`finally`. Every one runs, even if an earlier one failed. Inside one `Finally` lambda all steps run even if one fails.
- Inside one `OnFailure` lambda the first failing step stops the remaining steps of that lambda. Other `OnFailure` calls on the same block still run.
- Finally steps belong to the enclosing `Ando.Block` (or the run). `Defer` and `When` bodies are transparent: a finally step registered inside one (including the removal registered by `AppService.TemporaryAccessRule`) runs when the enclosing block ends.
- Ctrl+C: the first Ctrl+C stops the running step (it is marked cancelled), stops any command it left running in the build container, then runs the on-failure and finally steps. Commands started after the first press ignore further Ctrl+C presses, so a second press only prints a warning. A third press exits immediately (exit code 130) and skips the remaining cleanup (it still tries, within 5 seconds, to remove the `--ref` worktree and to write the run record with `"aborted": true`; for warm containers the temporary Azure profile is removed at the start of the next run; `--cold` removes it with the container). Any run interrupted with Ctrl+C exits with 130 (a failure exits with 1). `OnFailure` steps run after Ctrl+C as well; read `Ando.Cancelled` to tell the two apart.

### Operations

- Ando.Block(name, body) - Returns a StepBlock. Body runs at evaluation time to capture its steps; the steps run in order at execution time. Chain `.OnFailure(Action)` (runs only if a step in the block failed or the run was canceled; may be called more than once) and `.Finally(Action)` (always runs).
- Ando.Finally(body) - Steps that always run at the end of the enclosing block, or of the run at top level.
- Ando.Defer(body) - Runs `body` at execution time, then runs the steps it registers.
- Ando.When(Func<bool> condition, Action then, Action? otherwise = null) - Chooses steps at execution time.
- Ando.Require(Func<bool> condition, string message) - Fails with `message` if the condition is false at execution time.
- Ando.Confirm(message) - Prompts `[y/N]`. Declining fails the build. `ando run --yes` accepts. Without `--yes` and without an interactive console the step fails.
- Ando.Confirm(Func<string> message) - Same, with the message computed when the step runs. `--dry-run` shows `(decided at run time)`. Example: `Ando.Confirm(() => $"Swap {manifest.Version} into production?");`
- Ando.StepTree(file, profiles = null) - Returns a CommandStep whose Value is the `--dry-run` tree of another script (one line per step, two spaces per level, `\n` line endings, secrets redacted). Runs on the host: starts the running CLI as `run --dry-run --no-env --no-color -f <file> [-p <profiles>]` (plus `--ref` when this run has one) from the directory you ran from, so no step of that script runs. A relative file is relative to that directory. A non-zero exit fails the step. WithTimeout (default Ando.CommandTimeout or 5 minutes), WithEnv and AllowFailure work. The dry-run child inherits the parent's whole process environment (plus any WithEnv values); this is unlike Ando.Build with WithEnv, whose containers get only the WithEnv keys. Example: `var tree = Ando.StepTree("deploy.csando", "eu"); Ando.Report("deploy tree", tree);`
- Ando.Report(key, string) / Ando.Report(key, StepOutput) / Ando.Report(key, Func<string>) - Adds a value to the run record and logs it.
- Ando.Cancelled - bool, true once the user pressed Ctrl+C. Read it at execution time (inside `Ando.When`, `Ando.Require`, `Ando.Defer`, `OnFailure` and `Finally` bodies); while the script is evaluated it is always false. Example: `.OnFailure(() => Ando.When(() => !Ando.Cancelled, () => AppService.SwapSlots(app, "staging", rg)))`.
- Ando.CommandTimeout(TimeSpan) - Default timeout for command steps registered after this call (built-in default 5 minutes). Operations with a longer default of their own, such as AppService zip deploy, keep it.
- Ando.CopyToContainer(hostPath, containerPath) - Copies a host file or directory into the build container. Relative host paths are relative to the directory you ran `ando` from (also with `--ref`), so gitignored files can be used. Relative container paths are relative to /workspace. A directory replaces an existing directory at the target.
- Ando.CopyToHost(containerPath, hostPath) - Mirror of `Ando.CopyToContainer`: copies a file or directory from the build container to the host as a step, in step order. Relative host paths are relative to the directory you ran `ando` from (also with `--ref`); relative container paths to /workspace. The existing destination is deleted first; the project folder and its parents are refused. Any error fails the step. Example: `Ando.CopyToHost("artifacts/manifest.json", "artifacts/manifest.json");`
- Ando.Lock(name) - Takes a named lock while the script is evaluated and holds it until the run ends (not a step; absent from --dry-run, which takes no lock). Another run holding it fails the run with exit code 9. The same name twice (or names mapping to the same lock file, `a/b` and `a_b`) is a no-op; child builds skip names their parent holds. Call it at the top level of the script: inside `Ando.Defer` a held lock fails that step (exit 1). Listed in the run record as `lock <name>`. Uses its own lock files under `~/.ando/locks` (`name-<name>.lock`); it does not exclude other tools or scripts that `flock` a different file on the same target, so use one locking mechanism per target. Example: `Ando.Lock("release");`
- Ando.InvocationRoot - Host directory `ando` was run from (string). Use it to read local files during evaluation, also with `--ref`.
- Ando.SourceRoot - Host directory of the source tree being built (string): the temporary worktree with `--ref`, otherwise the project directory.
- Ando.WriteManifest(directory, version, commit) - Step that writes `manifest.json` into a container directory with the version, commit, and size and SHA-256 of every file.
- Ando.ImportArtifacts(hostDirectory, containerDirectory = null) - Returns an `ArtifactManifest`. During evaluation it reads `manifest.json` in the host directory and verifies every file hash (missing, changed or extra files throw before any step runs). The registered step copies the directory into the container and verifies the hashes again there. Default container directory: the same relative path under /workspace.
- ArtifactManifest members: `Version`, `Commit`, `Files` (each has `Path`, `Size`, `Sha256`), `File(pathOrName)` (relative path, or a unique file name; throws if not found), `PathOf(pathOrName)` (container path of a file, or of a directory that contains files such as `PathOf("web")`; throws if nothing matches), `ContainerPath` (container path of the imported directory).

### StepOutput and CommandStep

`StepOutput` members: `Value` (trimmed stdout, or the response body for HTTP steps), `ExitCode`, `StatusCode` (HTTP steps only, otherwise throws), `HasValue`, and `Json(path)`. `Json` reads a dotted path with optional array indexes, for example `show.Json("siteConfig.ipSecurityRestrictions[0].name")`. Property names match case-insensitively. It returns the string value, raw JSON text for objects and arrays, or null when the path is missing or the value is JSON null.

`CommandStep` (returned by `Shell.Run`, `Shell.Bash`, `Azure.Cli`, `AppService.Show`, `AppService.GetHostName`, `AppService.AccessRestrictions`, the same `Functions.*` operations, and `Git.RevParse`, `Git.LatestTag`, `Git.ChangedFiles`) is a `StepOutput` with fluent configuration, applied when the step runs:
- `InDirectory(path)` - Working directory; relative paths are relative to /workspace.
- `WithTimeout(TimeSpan)` - Default 5 minutes or `Ando.CommandTimeout`.
- `WithEnv(name, value)` - Environment variable for this command only.
- `AllowFailure()` - Continue on non-zero exit; check `ExitCode` in a later `When` or `Require`.
- `Quiet()` - Capture the output without printing it.

### Example: slot deploy with gates and swap-back

This deploys previously built artifacts to the `release` slot of an App Service, opens a temporary access rule for the build machine, waits for the slot, asks for confirmation, swaps, and swaps back if anything after the swap fails.

```csharp
// ando-doc-snippet-test
// build.csando (run with: ando run --ref v1.4.0 --yes)
var app = "my-web-app";
var rg = "my-rg";

Ando.UseImage("mcr.microsoft.com/dotnet/sdk:10.0");
Ando.CommandTimeout(TimeSpan.FromMinutes(10));

// Evaluation-time checks: fail before any step runs.
Git.RequireClean("src", "web");
var manifest = Ando.ImportArtifacts("artifacts");
Log.Info($"Deploying {manifest.Version} ({manifest.Commit})");

Azure.EnsureAuthenticated();

var releaseHost = AppService.GetHostName(app, rg, "release");
var prodHost = AppService.GetHostName(app, rg);

Ando.Block("deploy", () =>
{
    // Adds an Allow rule for this machine's IPv4 and removes it again when
    // this block ends, whatever happened.
    AppService.TemporaryAccessRule(app, rg, "release", "deploy-gate");

    AppService.DeployFolder(app, manifest.PathOf("web"), rg, o => o.WithDeploymentSlot("release"));

    Http.WaitForHealthy(
        () => new[] { $"https://{releaseHost.Value}/healthz", $"https://{releaseHost.Value}/healthz/db" },
        o => o.ConsecutiveSuccesses(3).MinGapSeconds(10).WithTimeoutSeconds(600).ExpectJson("version", manifest.Version));

    Ando.Confirm("Swap release into production?");

    Ando.Block("swap", () =>
    {
        AppService.SwapSlots(app, "release", rg);
        Http.WaitForHealthy(() => $"https://{prodHost.Value}/healthz", o => o.ConsecutiveSuccesses(2));
    })
    .OnFailure(() => AppService.SwapSlots(app, "release", rg)); // swap back
})
.Finally(() => AppService.Stop(app, rg, "release"));

var health = Http.Get(() => $"https://{prodHost.Value}/healthz");
Ando.Report("version", manifest.Version);
Ando.Report("healthz", health);
```

If the post-swap health check fails, the order is: swap-back (inner `OnFailure`), inner `Finally` (none), outer `OnFailure` (none), then the outer `Finally` steps in reverse registration order (stop the `release` slot, then remove and verify removal of the `deploy-gate` rule). The build fails and the run record shows the cleanup steps with `cleanup: true`.

### Example: reading step output at execution time

```csharp
// ando-doc-snippet-test
var rg = "my-rg";

var pending = Shell.Bash("dotnet ef migrations list --no-build | grep -c Pending || true")
    .InDirectory("src/Api")
    .WithTimeout(TimeSpan.FromMinutes(2));
Ando.Require(() => pending.Value == "0", "The database has pending migrations");

var show = Azure.Cli("webapp", "show", "-g", rg, "-n", "my-web-app", "--slot", "release", "-o", "json").Quiet();
Ando.When(
    () => show.Json("state") == "Running",
    () => Log.Info("release slot is running"),
    () => Log.Warning("release slot is not running"));

var probe = Shell.Run("test", "-f", "dist/index.html").AllowFailure();
Ando.Defer(() =>
{
    if (probe.ExitCode != 0)
    {
        Log.Warning("dist/index.html is missing");
    }
});
```

## All Operations

### Globals
Bare globals, NOT members of the Ando object (write `Env("X")`, never `Ando.Env("X")`). Page: https://andobuild.com/providers/globals.md
- Root - The root path of the project (where build.csando is located). A BuildPath; use Directory(".") where a DirectoryRef is needed.
- Temp - Temporary files directory (root/.ando/tmp)
- Directory(path = ".") - Creates a DirectoryRef
- Env(name, required = true) - Get environment variable. Throws if not set by default. Pass required: false to return null.
- DefineProfile(name) - Define a build profile; returns a Profile that converts to bool
- Log.Info(message), Log.Warning(message), Log.Error(message), Log.Debug(message) - Log messages (these are steps and print in step order)
- The operation objects (Dotnet, Npm, Git, ...) are also globals, listed under Operation Objects above.

### Ando
- Ando.UseImage(image) - Set the Docker image for the build container
- Ando.CopyArtifactsToHost(containerPath, hostPath) - Copy files from container to host after build. A failed copy now makes the run exit 1 (run record `success: false`, `artifact-copy-failed` report).
- Ando.CopyZippedArtifactsToHost(containerPath, hostPath) - Create archive and copy from container to host. Supports .tar.gz (default) and .zip. If hostPath is a directory, creates artifacts.tar.gz.
- Ando.Build(directory, options?) - Run a nested build in a subdirectory (new container, isolated context). Its step runs ON THE HOST and starts a separate child `ando` build process, which creates its own container: the exception to "steps run in the container". `--yes`, `--no-env` and `--no-color` of the parent run are forwarded to the child.
- Ando.Block, Ando.Finally, Ando.Defer, Ando.When, Ando.Require, Ando.Cancelled, Ando.Confirm, Ando.Report, Ando.CommandTimeout, Ando.CopyToContainer, Ando.CopyToHost, Ando.Lock, Ando.InvocationRoot, Ando.SourceRoot, Ando.WriteManifest, Ando.ImportArtifacts - Step model, gates and artifact import; see "Step model and deployment gates"

### Tool installation
Six installers put a tool into the build container (skipped when already present). Page: https://andobuild.com/tools.md
- Bun.Install(version = "latest", sha256 = null) - see Bun
- Node.Install(version = "22") - see Node
- Docker.Install() - see Docker
- Dotnet.SdkInstall(version = "9.0") - see Dotnet
- Docfx.Install() - see Docfx
- Playwright.Install(DirectoryRef directory) - see Playwright

### Node
- Node.Install(version?) - Install Node.js globally (default: v22)

### Dotnet
- Dotnet.SdkInstall(version?) - Install .NET SDK globally (default: 9.0). Use for base images without .NET.
- Dotnet.ReadVersion(path = "Directory.Build.props") - EVALUATED WHEN THE SCRIPT LOADS, on the host; not a step. Returns the version string, relative to the source root (the --ref worktree when set). The file needs exactly one `<Version>` directly in a `<PropertyGroup>`; the literal property is read (no MSBuild evaluation, imports, conditions or `$(...)`); throws on a missing file or an empty/ambiguous version. Example: `var version = Dotnet.ReadVersion();`
- Dotnet.Project(path) - Create a .NET project reference from a .csproj path. Returns ProjectRef with Path, Name, Directory, and Version properties.
- Dotnet.Restore(project) - Restore NuGet packages: `dotnet restore <proj> [--no-cache] [-r <rid>]`
- Dotnet.Build(project) - Compile a project: `dotnet build <proj> [-c <cfg>] [--no-restore] [-p:SourceRevisionId=<sha>]` (no -c unless set: Release is NOT the default)
- Dotnet.Test(project) - Run unit tests: `dotnet test <proj> [-c <cfg>] [--no-restore] [--no-build] [--filter <f>] [-p:SourceRevisionId=<sha>]`
- Dotnet.Publish(project, options?) - Create deployment artifacts: `dotnet publish <proj> [-c <cfg>] [-o /workspace/<out>] [--no-restore] [--no-build] [--self-contained | --no-self-contained] [-r <rid>] [-p:PublishSingleFile=true] [--nologo] [-p:SourceRevisionId=<sha>]`; a relative `Output("out/web")` string resolves against /workspace in the container (`-o /workspace/out/web`, also with --ref); container-absolute paths and `Root / "x"` are kept; Release is NOT the default. Exactly `dotnet publish p -c Release -o out --nologo`: `Dotnet.Publish(p, o => o.WithConfiguration(Configuration.Release).Output("out").WithNoLogo())`
- Dotnet.Tool(name, version?) - Reference a .NET CLI tool

### Ef
- Ef.DbContextFrom(project, contextName?) - Reference a DbContext
- Ef.DatabaseUpdate(context, connectionString?) - Apply pending migrations
- Ef.DatabaseUpdate(context, outputRef) - Apply migrations with connection from deployment output
- Ef.Script(context, outputPath, fromMigration?, toMigration?) - Generate an idempotent SQL migration script. `from`/`to` are positional `dotnet ef` arguments; with `to` set and no `from`, `0` (empty database) is passed as the start. Options form: `Ef.Script(context, outputPath, o => o.From(() => applied.Value).To(() => latest.Value))`; `From`/`To` take a string or a `Func<string?>` that resolves when the step runs (null or empty means not set).

### Npm
- Npm.Install(directory) - Run npm install. Uses the standard 5-minute command timeout.
- Npm.Ci(directory) - Run npm ci (clean install). Uses the standard 5-minute command timeout.
- Npm.Run(directory, script) - Run an npm script. Uses the standard 5-minute command timeout.
- Npm.Test(directory) - Run npm test. Uses the standard 5-minute command timeout.
- Npm.Build(directory) - Run npm run build. Uses the standard 5-minute command timeout.

### Azure
- Azure.InstallCli(version) - Installer: installs exactly this azure-cli version (`X.Y.Z`) from Microsoft's signed apt repo (key /etc/apt/keyrings/microsoft.gpg, codename from /etc/os-release; package `azure-cli=<v>-1~<codename>`). Skips if az already reports that version; fails and lists the 15 newest available versions if the version is not published; installs with --allow-downgrades, runs `apt-mark hold azure-cli`, logs `az version`. The automatic az install never replaces it. Put it BEFORE the first Azure/AppService/Functions/Bicep step (an az installed automatically earlier is replaced). Debian/Ubuntu images only. Example: `Azure.InstallCli("2.90.0");` If Microsoft has no repo for the OS codename it falls back like Microsoft's installer (Debian to bookworm, Ubuntu to UBUNTU_CODENAME or jammy) and logs it. Every failure ends with "azure-cli <v> is not available: ...".
- Azure.EnsureAuthenticated(clientId?, clientSecret?, tenantId?, requireServicePrincipal?) - Authenticate using best available method. Pass explicit SP credentials to avoid env reliance, and requireServicePrincipal: true (or set ANDO_REQUIRE_SERVICE_PRINCIPAL) to force SP auth and never fall back to an existing az login session. Default unchanged (fallback allowed)
- Azure.EnsureLoggedIn() - DEPRECATED (compile warning): use Azure.EnsureAuthenticated() instead. Verify logged in to Azure CLI
- Azure.ShowAccount() - Display current account info
- Azure.LoginWithServicePrincipal(clientId?, secret?, tenantId?) - Login with SP. Credentials reach the container through environment variables, never on the `docker exec` command line; with a client secret, `az login` still receives the secret as an argument inside the container for the few seconds the login runs (visible to host `ps`). If `AZURE_CLIENT_CERTIFICATE_PATH` is set (a PEM file with key and certificate inside the build container, for example after `Ando.CopyToContainer`), the certificate is used instead of the secret (needs an az version with `--certificate`, e.g. 2.67+; the auto-installed az is current). Certificate login is the only way to keep the credential out of every argv
- Azure.LoginWithManagedIdentity(clientId?) - Login with managed identity
- Azure.SetSubscription(subscriptionId?) - Set active subscription
- Azure.CreateResourceGroup(name, location) - Create resource group
- Azure.Cli(params string[] args) - Run `az` with the given arguments as the build's identity, in the build container. Returns a CommandStep (read `Value` or `Json(path)` at execution time).
- Azure.Vm.RunCommand(resourceGroup, vmName, script, timeout?) - Run a shell script as root on a Linux VM with `az vm run-command invoke`. Fails the step when the script exits non-zero (run-command itself exits 0). Returns a StepOutput whose Value is the script's stdout. Default timeout 30 minutes. BY DEFAULT ONLY THE LAST COMMAND'S EXIT CODE COUNTS: the script runs without `set -e`, so a failing command in the middle passes silently when a later one succeeds. Pass `exitOnError: true` (starts the script with `set -e`; signature `RunCommand(resourceGroup, vmName, script, timeout = null, exitOnError = false)`) or end commands with `|| exit 1`. With `set -e` a failing simple command ends the script, but failures inside pipelines (except the last command), `&&`/`||` lists and `if` conditions do not; add `set -o pipefail` (bash) for pipelines.

The Azure CLI is installed automatically inside the build container (Debian and Ubuntu images only) before the first `az` step if the image does not include it. Without service principal credentials, `Azure.EnsureAuthenticated()` reuses an existing az session in the container or runs `az login --use-device-code` inside the container; it does not check or prompt on the host.
Every run gets a private AZURE_CONFIG_DIR inside the build container (/tmp/ando-azure-<guid>), which is deleted when the run ends (leftovers of killed runs are removed at the start of the next run, every `ando-azure-*` folder regardless of age, so run only one build per repository container at a time; after a third Ctrl+C the folder stays until the next run starts). The host's ~/.azure profile is never read or modified, so a build cannot overwrite a developer's personal az login session and az steps cannot fall back to it. Azure login tokens do not persist in a warm container between runs.

### Bicep
- Bicep.DeployToResourceGroup(rg, template, options?) - Deploy to resource group, returns BicepDeployment
- Bicep.DeployToSubscription(location, template, options?) - Deploy at subscription scope, returns BicepDeployment
- Bicep.Validate(rg, template, options?) - `az deployment group validate`; a non-zero exit fails the step. az's JSON (with all parameter values) is not logged; success logs `Validation succeeded`
- Bicep.ValidateSubscription(location, template, options?) - `az deployment sub validate --location` (no --mode at subscription scope). az's JSON is not logged; the step logs `Validation succeeded` or the error
- Bicep.WhatIf(rg, template, options?) - `az deployment group what-if --no-pretty-print`; returns BicepWhatIfResult
- Bicep.WhatIfSubscription(location, template, options?) - `az deployment sub what-if --location`; returns BicepWhatIfResult
- Bicep.Build(template, output?) - Compile Bicep to ARM JSON

BicepDeployment objects provide typed access to deployment outputs:
- deployment.Output("name") - Returns OutputRef that resolves at execution time
- deployment.GetOutput("name") - Gets output value directly (call during step execution)

BicepWhatIfResult (returned by WhatIf and WhatIfSubscription) is filled when the step runs; reading it earlier throws InvalidOperationException, so read it inside Ando.Require, Ando.Confirm(Func) or Ando.When:
- Changes - list of changes: ResourceId, ChangeType (as az reports it: Create, Delete, Modify, NoChange, Ignore, Deploy, Unsupported), PropertyChanges (count)
- Summary - for example "2 Create, 1 Modify, 30 NoChange"
- HasChanges(params string[] types) - any change of these types; with no types, any change except NoChange and Ignore (only az's `changes`, not `potentialChanges`)
- OfType(type) - the changes of one type
- Json - raw az output
The step logs the summary and one line per change that is not NoChange or Ignore. A what-if with status Failed or an error fails the step. az's raw JSON is not logged (it can echo parameter values).
Example gate: `var plan = Bicep.WhatIf("rg", "main.bicep"); Ando.Require(() => !plan.HasChanges("Delete"), "The plan deletes resources."); Ando.Confirm(() => $"Deploy ({plan.Summary})?");`

### Cloudflare
- Cloudflare.UseCredentials(apiToken, accountId?) - Not a step; call at evaluation. Every Cloudflare step registered after it gets these credentials as per-command environment variables (by name, never on argv) and the values are redacted. EnsureAuthenticated then does not prompt. accountId null means $CLOUDFLARE_ACCOUNT_ID as before. Example: `var cf = Secrets.EnvFile(".env.secrets", "CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"); Cloudflare.UseCredentials(cf["CLOUDFLARE_API_TOKEN"], cf["CLOUDFLARE_ACCOUNT_ID"]);`
- Cloudflare.EnsureAuthenticated() - Verify the Cloudflare API token with Cloudflare's token verification endpoint
- Cloudflare.EnsurePagesProject(projectName) - Only VERIFIES that the credentials can read an existing Pages project (creates nothing; fails if the project does not exist). PagesDeploy registers it automatically, so call it yourself only to fail early. To create a project use PagesCreateProject.
- Cloudflare.PagesDeploy(directory, projectName, options?) - Deploy to Pages; automatically verifies project access first
- Cloudflare.PagesListProjects() - List all Pages projects
- Cloudflare.PagesCreateProject(name, branch?) - CREATES a Pages project (first-time setup; PagesDeploy does not create it). To only verify access to an existing project use EnsurePagesProject.
- Cloudflare.PagesListDeployments(projectName?) - List deployments
- Cloudflare.PurgeCache(zoneIdOrDomain?) - Purge entire cache

### Functions
Functions and AppService have the same operations with the same signatures (DeployZip, DeployWithSwap, SwapSlots, Restart, Start, Stop, Show, GetHostName, AccessRestrictions, TemporaryAccessRule, ListSlots, CreateSlot, DeleteSlot). Apart from the az subcommand, the zip deploy differs: AppService always uses OneDeploy (`az webapp deploy`), Functions.DeployZip defaults to config-zip for plan compatibility. Use Functions for Azure Functions apps (`az functionapp`) and AppService for web apps (`az webapp`); passing the wrong resource type fails. Only here: Functions.Publish (func CLI); AppService.DeployFolder.
- Functions.DeployZip(name, zipPath, rg?, options?) - Default (all plans, incl. Linux Consumption via storage upload + WEBSITE_RUN_FROM_PACKAGE, and Flex): `az functionapp deployment source config-zip --name N [--resource-group RG] --src ZIP [--slot S] [--timeout <seconds>] --output none`. Opt-in `WithOneDeploy()`: `az functionapp deploy --src-path ZIP --type zip [--slot S] --restart false|true --async false|true [--timeout <ms>]` (preview, posts to /api/publish; fits dedicated/Premium/Flex, not guaranteed on Linux Consumption). `WithRestart()` (--restart true; default false) and `WithNoWait()` (--async true) REQUIRE `WithOneDeploy()` and throw otherwise (behavior change). `WithDeploymentSlot` and `WithTimeout(TimeSpan)` (default 20 minutes) work on both paths. Transient 5xx/connection errors are retried 3 times on both paths; after a timeout only OneDeploy checks `az functionapp log deployment show`. Examples: `Functions.DeployZip(app, "out/func.zip", rg, o => o.WithDeploymentSlot("release").WithTimeout(TimeSpan.FromMinutes(30)));` and `Functions.DeployZip(app, "out/func.zip", rg, o => o.WithOneDeploy().WithRestart());`
- Functions.Publish(name, projectPath?, options?) - Publish using the func CLI (`func azure functionapp publish`)
- Functions.DeployWithSwap(name, zipPath, slot?, rg?) - Deploy (config-zip) then swap
- Functions.SwapSlots(name, sourceSlot, rg?, targetSlot?) - Swap slots. Returns a CommandStep. Default timeout 30 minutes.
- Functions.Restart(name, rg?, slot?) - Restart function app. Returns a CommandStep.
- Functions.Start(name, rg?, slot?) - Start function app. Returns a CommandStep.
- Functions.Stop(name, rg?, slot?) - Stop function app. Returns a CommandStep.
- Functions.Show(name, rg = null, slot = null) - Returns a quiet CommandStep with the `az functionapp show` JSON. Read fields with `Json("state")` at execution time. (Behavior change: it used to print; it now returns a quiet CommandStep.)
- Functions.GetHostName(name, rg = null, slot = null) - Returns a CommandStep whose Value is the default host name (`az functionapp show --query defaultHostName -o tsv`). Example: `var h = Functions.GetHostName(app, rg, "release"); Http.WaitForHealthy(() => $"https://{h.Value}/api/health");`
- Functions.AccessRestrictions(name, rg = null, slot = null) - Returns a quiet CommandStep with the `az functionapp config access-restriction show` JSON.
- Functions.TemporaryAccessRule(name, resourceGroup, slot = null, ruleName = "ando-deploy", ip = null, priority = 50) - Adds an Allow rule for one IPv4 address (default: this machine's public IPv4) and removes it in a finally step ("Functions.RemoveAccessRule") when the enclosing block or run ends. Same behavior as AppService.TemporaryAccessRule.
- Functions.ListSlots(name, rg = null) - List deployment slots
- Functions.CreateSlot(name, slot, rg = null, configurationSource = null) - Create a slot
- Functions.DeleteSlot(name, slot, rg = null) - Delete a slot

### AppService
Same operations and signatures as Functions (DeployZip, DeployWithSwap, SwapSlots, Restart, Start, Stop, Show, GetHostName, AccessRestrictions, TemporaryAccessRule, ListSlots, CreateSlot, DeleteSlot); apart from the az subcommand, AppService always uses OneDeploy (`az webapp deploy`) for zip deploys while Functions.DeployZip defaults to config-zip. Use AppService for web apps (`az webapp`) and Functions for Azure Functions apps (`az functionapp`).
- AppService.DeployZip(name, zipPath, rg?, options?) - Deploy via zip deploy
- AppService.DeployFolder(name, folderPath, rg?, options?) - Zip a published folder (contents at root) and deploy
- AppService.DeployWithSwap(name, zipPath, slot?, rg?) - Deploy then swap
- AppService.SwapSlots(name, sourceSlot, rg?, targetSlot?) - Swap slots. Returns a CommandStep (chain `.WithTimeout(...)`). Default timeout 30 minutes, or `Ando.CommandTimeout` when that is longer; an explicit `.WithTimeout` always wins.
- AppService.CreateSlot(name, slotName, rg?, configSource?) - Create slot
- AppService.DeleteSlot(name, slotName, rg?) - Delete slot
- AppService.ListSlots(name, rg?) - List deployment slots
- AppService.Restart(name, rg?, slot?) - Restart app service. Returns a CommandStep.
- AppService.Start(name, rg?, slot?) - Start app service. Returns a CommandStep.
- AppService.Stop(name, rg?, slot?) - Stop app service. Returns a CommandStep.
- AppService.Show(name, rg?, slot?) - Returns a CommandStep with the `az webapp show` JSON (quiet). Read fields with `Json("state")` at execution time.
- AppService.GetHostName(name, rg?, slot?) - Returns a CommandStep whose Value is the default host name, e.g. `myapp-release.azurewebsites.net`.
- AppService.AccessRestrictions(name, rg?, slot?) - Returns a CommandStep with the `az webapp config access-restriction show` JSON (quiet).
- AppService.TemporaryAccessRule(name, rg, slot? = null, ruleName = "ando-deploy", ip? = null, priority = 50) - Adds an Allow rule for one IPv4 address (default: this machine's public IPv4; a bare address gets /32) to the app or slot, replacing a rule with the same name. Registers a finally step in the enclosing block (or run) that removes the rule and verifies it is gone. Also works inside `Ando.When`/`Ando.Defer`: the removal still runs when the enclosing block ends.

DeployZip and DeployFolder support `WithDeploymentSlot`. Deploys use `az webapp deploy --type zip`. Without `WithRestart()` ANDO passes `--restart false` (`az webapp deploy` restarts the site by default, which could start a stopped slot); `WithRestart()` passes `--restart true`. They wait for the deployment (`--async false`; `WithNoWait()` passes `--async true`). `WithTimeout` is also passed to az as `--timeout`. DeployFolder zips the folder in the container and apt-installs `zip` if it is missing; for reproducible builds zip at build time and use DeployZip.
### Http
- Http.WaitForHealthy(url, options?) - Poll a URL until it returns the expected status (default 200) or the timeout elapses; gates a deploy on a health check. Options: WithExpectedStatus(int), WithTimeoutSeconds(int), WithIntervalSeconds(int), WithRequestTimeoutSeconds(int), ConsecutiveSuccesses(int), MinGapSeconds(int), ExpectJson(path, expected)
- Http.WaitForHealthy(IEnumerable<string> urls, options?) - Poll several URLs together; a check passes only when every URL passes.
- Http.WaitForHealthy(Func<string> url, options?) and Http.WaitForHealthy(Func<IEnumerable<string>> urls, options?) - URLs computed at execution time, for example from `AppService.GetHostName(...).Value`.
- Http.Get(url, Action<HttpGetOptions> configure) and Http.Get(Func<string> url, Action<HttpGetOptions> configure) - GET with options: `AllowAnyStatus()`, `ExpectContentType(prefix)`, `ExpectBodyContains(text)`, `ExpectBodyMatches(regex)`. Example: `Http.Get("https://x/", o => o.ExpectContentType("text/html").ExpectBodyContains("<title>"));`
- Http.Get(url, allowAnyStatus = false) and Http.Get(Func<string> url, allowAnyStatus = false) - GET request. Returns a StepOutput: `Value` is the body, `StatusCode` the status. Fails on a non-2xx status unless allowAnyStatus is true.
- Http.PublicIpV4() - Returns a StepOutput whose Value is this machine's public IPv4 address.

Response expectations (HttpHealthCheckOptions for WaitForHealthy and HttpGetOptions for Get): `ExpectContentType(prefix)` (case-insensitive prefix of Content-Type), `ExpectBodyContains(text)` (ordinal), `ExpectBodyMatches(regex)` (.NET regex, 2 second timeout). On a mismatch Get fails the step (Value still has the body); WaitForHealthy treats it as a failed check whose message shows the content type and the first 200 characters of the body.

Health check option details: `ConsecutiveSuccesses(n)` needs n passing checks in a row (a failure resets the count; with several URLs one check means all URLs passed). `MinGapSeconds(s)` waits at least s seconds between counted passing checks. `ExpectJson(path, expected)` requires the JSON body to have that dotted-path value (numbers and booleans compare by their JSON text); it applies to every URL of the call, so use a separate call for URLs that return something else. Polling runs on the host.

### Nuget
- Nuget.EnsureAuthenticated() - Ensure API key is available (prompts if NUGET_API_KEY not set)
- Nuget.Pack(project, options?) - Create NuGet package (default: Release config, outputs to bin/Release)
- Nuget.Push(project, options?) - Push packages from bin/Release/*.nupkg (default: nuget.org, skips duplicates)
- Nuget.Push(path, options?) - Push package from path/glob (default: nuget.org, skips duplicates)

### Archive
Deterministic archives; steps run in the container and return a CommandStep whose Value is the SHA-256 (hex) of the archive. Page: https://andobuild.com/providers/archive.md
- Archive.Zip(sourceDir, zipPath, options?) - Create a zip
- Archive.TarGz(sourceDir, tarGzPath, options?) - Create a tar.gz
- Options: `WithTimestamp(long unixSeconds)` (default 315532800 = 1980-01-01 UTC; Zip rejects earlier values and stores 2-second resolution) and `WithCompressionLevel(1..9)` (default 6).
- Byte-identical output for the same tree and image: entries sorted by path (LC_ALL=C), directory entries included, no ./ prefix; every mtime set to the timestamp; dirs 755, files 755 if any execute bit is set else 644; zip -X (no extra fields, no uid/gid); tar --format=gnu --sort=name, owner/group 0:0 numeric, gzip -n. Names with dashes, spaces, quotes and backslashes are safe, newline names are rejected; symlinks and special files fail with a message listing up to 5; Zip needs a path ending in .zip; the output may not equal the source or sit inside it (checked on resolved paths); hardlinks are dereferenced (bytes equal a copied tree); the output may not be inside the source; the source is never modified (staged in a temp copy); zip/tar/gzip are installed with apt if missing. Identity holds for the same zip/gzip builds (same image).
- Example: `Archive.Zip("artifacts/web", "artifacts/web.zip", o => o.WithTimestamp(Git.CommitTime));`

### Files
Page: https://andobuild.com/providers/files.md
- Files.Copy(source, destination, optional = false) - Step in the container (relative paths are relative to /workspace). File source: copied to the destination path (overwrite); a destination ending in "/" or an existing directory puts the file into that directory under its own name, otherwise the destination is the target path. Directory source: its CONTENTS are copied into the destination, like `cp -a src/. dst/` (created if missing, merged, same-named files overwritten, the source directory name is not added). Parent directories are created; cp -a keeps modes, times and symlinks. A missing source fails ("source not found"); with optional: true it is skipped with an info log. Example: `Files.Copy("public", "artifacts/web", optional: true);`

### Docker
- Docker.Install() - Install Docker CLI in container (required for Docker.Build with --dind). Automatically handled on the CI server; recommended in scripts for portability.
- Docker.IsAvailable() - EVALUATED WHEN THE SCRIPT LOADS, on the host; not a step (absent from --dry-run, runs before the container exists). Returns a bool: whether the Docker CLI and daemon are accessible.
- Docker.Build(dockerfile, options?) - Build Docker image using buildx. Supports single or multi-platform builds with optional push to registry. **Recommended**: Use WithPush() for atomic build+push to ensure both version and latest tags point to the same manifest. Auto-handles ghcr.io auth when pushing.

#### GHCR Publishing Rules (Read This First)

**Pushes only happen when BOTH are true:**
1. You call `WithPush()`
2. At least one `WithTag(...)` includes a registry hostname (e.g., `ghcr.io/org/app:tag`)

Truth table:
| Build Script | Result |
|------------|--------|
| `WithPush()` + tag contains `ghcr.io/...` | Pushes to GHCR (and ANDO auto-auths) |
| No `WithPush()` | Builds locally only (nothing is pushed anywhere) |
| `WithPush()` + tags without registry hostname | Docker may attempt Docker Hub or fail; usually unintended |

#### GHCR Auth (Do This, Not That)

- Do not run `docker login` yourself in `build.csando`. Use `WithTag("ghcr.io/...")` + `WithPush()`. ANDO handles auth for GHCR pushes.
- Token sources (in order):
  - `GITHUB_TOKEN` environment variable (preferred)
  - `gh auth token` (requires `gh` CLI to be installed and authenticated)
  - Note: `gh` itself also supports `GH_TOKEN`, but ANDO's primary mechanism is `GITHUB_TOKEN`.

### Docfx
- Docfx.Install() - Install DocFX as a dotnet global tool (skips if already installed)
- Docfx.IsInstalled() - EVALUATED WHEN THE SCRIPT LOADS, on the host; not a step (absent from --dry-run, runs before the container exists). Returns a bool: whether DocFX is installed as a dotnet global tool on the host.
- Docfx.GenerateDocs(configPath?) - Generate API documentation from docfx.json (runs metadata + build)
- Docfx.CopyToDirectory(sourceDir, targetDir) - Copy generated docs to target directory
- Docfx.BuildAndCopy(configPath, outputDir, targetDir) - Generate docs, copy, and cleanup in one step
- Docfx.Cleanup(outputDir?) - Remove intermediate DocFX files (api/ and output directories)

### Playwright
- Playwright.Install(directory) - Install browsers AND system dependencies (runs `npx playwright install --with-deps`)
- Playwright.Test(directory, options?) - Run Playwright tests (default: `npx playwright test`)

PlaywrightTestOptions:
- Project - Run specific project (e.g., "chromium")
- Headed - Run with visible browser
- UI - Run in interactive UI mode
- Workers - Number of parallel workers
- Reporter - Reporter to use (e.g., "html", "list")
- Grep - Filter tests by pattern
- UpdateSnapshots - Update visual snapshots
- UseNpmScript - Use `npm run` instead of `npx playwright test`
- NpmScriptName - Custom script name when UseNpmScript is true

To run the suite once per database, give each variant an npm script that sets an env var (for example `"test:postgres": "E2E_DB_PROVIDER=postgres playwright test"`) and call `Playwright.Test(dir, o => { o.UseNpmScript = true; o.NpmScriptName = "test:postgres"; })`.

### Git
- Git.Tag(tagName, options?) - Create a git tag (annotated by default). `o.WithMessage(string)` or `o.WithMessage(Func<string>)`; the function runs when the step runs, so it can read earlier step Values.
- Git.Install() - Step "Git.Install". Runs IN THE BUILD CONTAINER (unlike the other Git operations, which run on the host). Skips with an info log if `git` is on PATH; otherwise `apt-get update && apt-get install -y --no-install-recommends git ca-certificates` (apt) or `apk add --no-cache git` (apk); any other image fails with "unsupported image". Logs `git --version`. Use before container commands that need git, e.g. tests creating git repositories. Example: `Git.Install();`
- Git.Push(options?) - Push the current branch to the remote. Does not push tags (use Git.PushTags).
- Git.PushTag(tagName, remote?) - Step "Git.PushTag". Pushes only `refs/tags/<tagName>`; fails if the tag does not exist locally. Other tags are not pushed. Example: `Git.PushTag($"v{version}");`
- Git.RemoteTags(pattern = "*", remote = "origin") - Step "Git.RemoteTags" (context = pattern): `git ls-remote --tags --refs <remote> refs/tags/<pattern>`. Returns a CommandStep whose Value is the newline-separated tag names without `refs/tags/`. Example: `var remote = Git.RemoteTags("v*");`
- Git.PushTags(remote?) - Push tags (not the branch; use Git.Push) to the remote, skipping tags that already exist remotely (default: origin). Tags are pushed individually.

Evaluated when the script loads (on the host, NOT steps; absent from --dry-run, they run before the container exists and do not see changes made by earlier steps):
- Git.Commit - Full SHA of the commit being built (HEAD, or the commit given with `--ref`). Property. Step-based counterpart: Git.RevParse.
- Git.ShortCommit - Short SHA of the commit being built. Property. Step-based counterpart: Git.RevParse(shortSha: true).
- Git.CommitTime - Commit time of the commit being built as a `long` of unix seconds. Property, cached. Example: `o.WithTimestamp(Git.CommitTime)`.
- Git.RequireClean(params string[] paths) - Also evaluated at script load. Throws before any step runs if tracked files are modified, staged or deleted, or non-ignored untracked files exist, under the paths (whole repository if none). Always passes with `--ref`. `.ando/runs/` is ignored, so run records never trip it.
- Git.ChangedSince(sinceRef, params string[] paths) - True if any file under the paths differs between sinceRef and the commit being built (committed changes only). Step-based counterpart: Git.ChangedFiles.
- Git.LastTag(pattern = "*") - Most recent tag reachable from the commit being built that matches the glob (for example `"v*"`), or null. Step-based counterpart: Git.LatestTag.

Git.Commit, ShortCommit, CommitTime, RequireClean, ChangedSince and LastTag run git on the host while the script is evaluated, so their values can be used directly in `if` and string interpolation.

Step variants (these ARE steps: they run on the host in the source root, the --ref worktree when set, in order with the other steps like Git.Tag/Git.Push, and appear in --dry-run). Each returns a CommandStep whose Value is the trimmed stdout; read it at execution time (Ando.When, Ando.Defer, Ando.Report, Func<> overloads), not at the top level of the script:
- Git.RevParse(string rev = "HEAD", bool shortSha = false) - Step "Git.RevParse": `git rev-parse [--short] <rev>`. Example: `var sha = Git.RevParse(shortSha: true);` Eager counterparts: Git.Commit, Git.ShortCommit. Honors the CommandStep methods WithTimeout, WithEnv, Quiet and AllowFailure; do not use InDirectory (it resolves to a container path, but git runs on the host).
- Git.LatestTag(string pattern = "*") - Step "Git.LatestTag": `git describe --tags --abbrev=0 --match <pattern> HEAD`. If no tag matches, Value is empty and the build continues (allowed failure). Example: `var t = Git.LatestTag("v*");` Eager counterpart: Git.LastTag. Ignores all the CommandStep fluent methods.
- Git.ChangedFiles(Func<string> sinceRef, params string[] paths) - Same step, but the ref is resolved when the step runs (can use an earlier step Value); an empty resolved ref fails the step with a clear "sinceRef is empty" error. Example: `var c = Git.ChangedFiles(() => t.Value, "src/Worker"); Ando.When(() => c.Value != "", () => Log.Info("Worker changed"));` No context in --dry-run.
- Git.ChangedFiles(string sinceRef, params string[] paths) - Step "Git.ChangedFiles": `git diff --name-only <sinceRef> HEAD -- <paths>`. Value is a newline-separated list, empty when nothing changed; an unknown ref fails the step. Example: `var c = Git.ChangedFiles("v1.0.0", "src/Worker");` Eager counterpart: Git.ChangedSince. Honors the CommandStep methods WithTimeout, WithEnv, Quiet and AllowFailure; do not use InDirectory (it resolves to a container path, but git runs on the host).

### Shell
- Shell.Run(command, params string[] args) - Escape hatch for one-off commands that have no ANDO operation; prefer a first-party operation when one exists. Run a command in the build container. Arguments are passed as a list, with no shell parsing. Fails on non-zero exit unless `AllowFailure()`. Returns a CommandStep.
- Shell.Bash(script) - Run a script with `bash -euo pipefail -c` in the build container (pipes, redirection, sourcing). Returns a CommandStep.

Note: hook scripts have a different `Shell` global (`Shell.RunAsync`). The `Shell.Run` and `Shell.Bash` described here are for build.csando.

### Bun
- Bun.Install(version = "latest", sha256 = null) - Install Bun into /usr/local/bin so later steps (including MSBuild targets run by Dotnet.Publish) find `bun` on PATH. Skips the download if that version is already installed. Installs curl and unzip with apt when missing; needs a Debian or Ubuntu image. With `sha256`, `version` must be exact (not "latest"): the release zip `bun-linux-x64.zip` or `bun-linux-aarch64.zip` (chosen by `uname -m`) is downloaded from GitHub, verified against the hash (the step fails on a mismatch), installed, and `bun --version` must equal the version. The hash is of the zip for the container's architecture; x64 and aarch64 hashes differ. The standard x64 build needs AVX2; on CPUs without AVX2 use the installer path without `sha256` (no hash check). With a hash the step always downloads and verifies. Examples: `Bun.Install("1.2.23");` `Bun.Install("1.2.23", sha256: "<sha256 of bun-linux-x64.zip>");`

### GitHub
- GitHub.CreatePr(options) - Create a pull request (requires gh CLI)
- GitHub.CreateRelease(options) - Create a GitHub release with optional file uploads (use WithFiles() to attach assets, supports path#name syntax)
- GitHub.PushImage(imageName, options?) - **Deprecated**: Use Docker.Build with WithPush() instead for atomic builds.

### Profiles
Profiles allow conditional execution of build steps. `DefineProfile()` returns a `Profile` object — capture it in a variable. It evaluates to `true` when that profile is active:
```csharp
// Capture the Profile in a variable
var release = DefineProfile("release");

Dotnet.Build(app);
Dotnet.Test(tests);

// Profile evaluates to true when activated via -p flag
if (release) {
    Git.Tag("v1.0.0");
    GitHub.CreateRelease(o => o
        .WithTag("v1.0.0")
        .WithGeneratedNotes()
        .WithFiles("dist/app#app-linux", "dist/app.exe#app-windows.exe"));
}
```

Activate with CLI: `ando -p release` or `ando -p publish,release`

## Options Reference

### Dotnet.Restore Options
- WithRuntime(string) - Target runtime identifier (e.g., "linux-x64", "win-x64")
- NoCache - Bypass NuGet cache, force fresh downloads

### Dotnet.Build Options
- Configuration - Debug or Release
- NoRestore - Skip implicit restore
- WithSourceRevision(sha) - Add `-p:SourceRevisionId=<sha>` (overrides the automatic value)
- WithoutSourceRevision() - Suppress the automatic -p:SourceRevisionId (ANDO's value otherwise overrides a project-level <SourceRevisionId>)

### Dotnet.Test Options
- Configuration - Build configuration
- NoRestore - Skip restore
- NoBuild - Skip build (implies NoRestore)
- Filter - Test filter expression (e.g., "Category=Unit", "Name=MyTest")
- WithSourceRevision(sha) - Add `-p:SourceRevisionId=<sha>` (overrides the automatic value)
- WithoutSourceRevision() - Suppress the automatic -p:SourceRevisionId (ANDO's value otherwise overrides a project-level <SourceRevisionId>)

### Dotnet.Publish Options
- Output(path) - Output directory for artifacts
- WithConfiguration(Configuration) - Debug or Release
- WithRuntime(string) - Target runtime (e.g., "linux-x64", "linux-arm64", "win-x64", "osx-arm64")
- AsSelfContained(bool) - Include .NET runtime (default: true when called)
- AsSingleFile(bool) - Bundle into single executable
- SkipRestore() - Skip restore before publishing
- SkipBuild() - Skip build before publishing
- WithNoLogo() - Pass --nologo
- WithSourceRevision(sha) - Add `-p:SourceRevisionId=<sha>`; ANDO adds the full commit being built automatically (nothing outside a git repository) unless you set this or use NoBuild
- WithoutSourceRevision() - Suppress the automatic -p:SourceRevisionId (ANDO's value otherwise overrides a project-level <SourceRevisionId>)

### Nuget.Pack Options
- Output(path) - Output directory for .nupkg
- WithConfiguration(Configuration) - Build configuration
- WithVersion(string) - Explicit package version
- WithVersionSuffix(string) - Pre-release suffix (e.g., "beta", "rc1")
- WithSourceRevision(sha) - Add `-p:SourceRevisionId=<sha>`; ANDO adds the full commit being built automatically (nothing outside a git repository) unless you set this or use SkipBuild
- WithoutSourceRevision() - Suppress the automatic -p:SourceRevisionId (ANDO's value otherwise overrides a project-level <SourceRevisionId>)
- WithSymbols(bool) - Generate .snupkg for debugging
- WithSource(bool) - Include source files in symbols
- SkipRestore() - Skip restore
- SkipBuild() - Skip build

### Nuget.Push Options
- ToSource(string) - NuGet feed URL
- ToNuGetOrg() - Push to nuget.org (default)
- WithApiKey(string) - API key (or use NUGET_API_KEY env var)
- SkipDuplicates(bool) - Skip if version exists (default: true)
- WithoutSymbols(bool) - Don't push .snupkg

### Docker.Build Options
- WithTag(string) - Add image tag (can call multiple times). Use full registry path for push (e.g., "ghcr.io/org/app:v1")
- WithPlatform(string) - Single target platform (e.g., "linux/amd64")
- WithPlatforms(params string[]) - Multiple target platforms for multi-arch builds (e.g., "linux/amd64", "linux/arm64")
- WithContext(string) - Build context directory
- WithBuildArg(key, value) - Pass build argument to Dockerfile
- WithPush() - **Recommended**: Push images to registry atomically during build. Ensures all tags point to same manifest.
- WithNoCache() - Disable build cache
- WithoutLoad() - Disable loading image into local docker (useful when only pushing)

### Git.Tag Options
- WithMessage(string) / WithMessage(Func<string>) - Tag message for annotated tags (the function runs when the step runs)
- AsLightweight() - Create lightweight tag instead of annotated
- WithSkipIfExists() - Skip if tag exists (warn instead of fail)

Note: Annotated tags require a git identity (user.name/user.email). The ANDO CI Server configures this automatically. For CLI builds, the host git config is used.

### Git.Push Options
- ToRemote(string) - Remote name (default: origin)
- ToBranch(string) - Branch to push
- WithUpstream() - Set upstream tracking (-u flag)

### GitHub.CreateRelease Options
- WithTag(string) - Tag name (e.g., "v1.0.0")
- WithTitle(string) - Release title
- WithNotes(string) - Markdown release notes
- WithGeneratedNotes() - Auto-generate notes from commits since last release
- AsDraft() - Create as draft (not visible until published)
- AsPrerelease() - Mark as pre-release
- WithoutPrefix() - Don't add 'v' prefix to tag
- WithFiles(params string[]) - Files to upload as release assets

### GitHub.CreatePr Options
- WithTitle(string) - PR title
- WithBody(string) - PR description (markdown)
- WithBase(string) - Target branch (e.g., "main")
- WithHead(string) - Source branch
- AsDraft() - Create as draft PR

### Bicep Options (deploy, validate, what-if)
- WithName(string) - Custom deployment name
- WithParameterFile(string) - Path to a .json or .bicepparam file. Call it repeatedly for .json files; each file becomes `--parameters @file` in call order, later files override earlier values. A .bicepparam file must be the only parameter file (az allows only inline KEY=VALUE next to it); combining it with another file or WithSecureParameter throws at registration
- WithParameter(name, value) - Inline parameter, passed on the az command line (visible in process listings): non-secret values only
- WithParameter(name, Func<string>) - Like WithParameter(name, value), resolved when the step runs (for example `o.WithParameter("key", () => sshKey.Value)`). Non-secret values only: it goes on the az command line
- WithSecureParameter(name, Func<string>) - Like WithSecureParameter(name, value), resolved when the step runs (for example `() => sshKey.Value` with `var sshKey = Azure.Cli("vm", "show", ...).Quiet();`); registered for redaction (with its JSON-escaped forms) when resolved, before any command runs. Redaction starts only when the Bicep step resolves the value, so the step that produced it may already have logged it: keep that step quiet (`Azure.Cli(...).Quiet()` does; `Azure.Vm.RunCommand` logs every stdout line and cannot be quieted). Not with a .bicepparam file
- WithSecureParameter(name, value) - Secret parameter. Registered for redaction at the call. When the step runs, all secure parameters go into one temporary parameters file in the container (/tmp/ando-bicep-<guid>.json, mode 0600), passed as the last `--parameters @file` and deleted afterwards, also on failure. The value (and its JSON-escaped form) is never on a command line or in logs. Works for deploy, validate and what-if at both scopes, but not with a .bicepparam file
- WithMode(DeploymentMode) - Incremental (default) or Complete. Complete works at resource group scope only; at subscription scope (DeployToSubscription, ValidateSubscription, WhatIfSubscription) it throws at registration because az has no --mode there
- WithDeploymentSlot(string) - App Service slot

### Cloudflare.PagesDeploy Options
- WithProjectName(string) - Pages project name
- WithBranch(string) - Git branch for deployment
- WithCommitHash(string) - Commit hash for tracking
- WithCommitMessage(string) - Commit message for tracking

### AppService.DeployZip Options
- WithDeploymentSlot(string) - Deploy to specific slot
- WithNoWait() - Don't wait for completion
- WithRestart() - Pass `--restart true` to `az webapp deploy` so the app restarts after the deployment
- WithTimeout(TimeSpan) - Max time to wait for zip deploy before reconciling/retrying (default 20 minutes)

AppService.DeployZip is resilient to flaky Azure uploads: if the deploy command times out it reconciles against the latest Kudu deployment status (treating a completed deployment as success), and it retries transient failures (5xx, Service Unavailable, connection resets) with backoff up to 3 attempts within the WithTimeout budget.

### Functions.DeployZip Options
- WithDeploymentSlot(string) - Deploy to specific slot (--slot)
- WithOneDeploy() - Use OneDeploy (`az functionapp deploy --type zip`, preview) instead of the default config-zip
- WithNoWait() - OneDeploy only (throws without WithOneDeploy): --async true
- WithRestart() - OneDeploy only (throws without WithOneDeploy): --restart true; default --restart false
- WithTimeout(TimeSpan) - Maximum wait before retrying; passed to az as --timeout (seconds for config-zip, milliseconds for OneDeploy; default 20 minutes). Works on both paths

### Functions.Publish Options
- WithDeploymentSlot(string) - Publish to specific slot
- WithConfiguration(string) - Build configuration
- WithForceRestart() - Force restart after publishing
- WithNoWait() - Don't wait for completion

### Ando.Build Options
- WithVerbosity(string) - Output verbosity (Quiet, Minimal, Normal, Detailed)
- ColdStart(bool) - Force fresh container
- WithDind(bool) - Enable Docker-in-Docker
- WithImage(string) - Override Docker image
- WithProfile(string) - Activate profiles for child build (e.g., "publish" or "test,release")
- WithEnv(string name, string value, bool secret = false) - Set an environment variable in the child process only (repeatable). The child forwards exactly these variables into its containers, not the keys it inherits from the parent (also with `--no-env`). Redacted in both builds when the name looks secret or `secret: true`

## Tips for Writing Build Scripts

1. Build scripts are C# - use C# syntax including var, lambdas, string interpolation
2. No semicolons needed at end of lines (but they work if included)
3. Operations execute in the order they are called, but only after the whole script was evaluated (see "Step model and deployment gates" for blocks, cleanup and conditions)
4. Use Dotnet.Project() for .csproj files, Directory() for folders
5. The `/` operator concatenates paths: Root / "src" / "app"
6. Options are configured via fluent lambdas: o => o.Output(...).WithRuntime(...)
7. Call EnsureAuthenticated() early when you want to validate cloud credentials; Cloudflare.PagesDeploy() also verifies Pages project access automatically
8. Use `ando verify` to check scripts without executing

## Common Mistakes

| Mistake | Error | Fix |
|---------|-------|-----|
| `Ando.Env("NAME")` | CS1061: 'AndoOperations' does not contain 'Env' | Use `Env("NAME")` — it's a global function |
| `Env("NAME", "default")` | CS1503: cannot convert from 'string' to 'bool' | Use `Env("NAME", required: false) ?? "default"` |
| `DefineProfile("name", "desc")` | CS1501: No overload takes 2 arguments | Use `DefineProfile("name")` — single argument only |
| `HasProfile("name")` | CS0103: 'HasProfile' does not exist | Use `var p = DefineProfile("name"); if (p) { ... }` |
| `Ando.SetEnv("NAME", "value")` | CS1061: 'AndoOperations' does not contain 'SetEnv' | Set env vars via `.env.ando` files or OS environment |
| `Npm.Ci(Root)` | CS1503: cannot convert 'BuildPath' to 'DirectoryRef' | Use `Npm.Ci(Directory("."))` |
| `Profile("name")` | CS0119: 'Profile' is a type | Use `DefineProfile("name")` to create profiles |
| `try { AppService.SwapSlots(...); } finally { AppService.Stop(...); }` | No error; the `finally` code runs while the script is evaluated, not after the steps | Use `Ando.Block(...).Finally(...)` or `Ando.Finally(...)` |
| `Git.GetVersion()`, `Git.BumpVersion()`, `Git.CommitCount()`, `Git.ShortSha()` | CS1061: 'GitOperations' does not contain a definition | Use `Git.LastTag("v*")`, `Git.ShortCommit`, `Git.RevParse(...)`; bump versions with `ando bump` |
| `Dotnet.Pack(...)` | CS1061: 'DotnetOperations' does not contain 'Pack' | Use `Nuget.Pack(project, o => o.WithVersion(...))` |
| `Dotnet.Build(project, o => o.WithProperty("Version", v))` | CS1061: 'DotnetBuildOptions' does not contain 'WithProperty' | Set MSBuild properties in the project file or `Directory.Build.props`; `Nuget.Pack` has `WithVersion` |
| `Docker.Push(...)`, `Docker.Tag(...)`, `Docker.Build(dir, "tag")`, `Docker.ComposeUp()` | CS1061 / CS1501 | Use `Docker.Build("Dockerfile", o => o.WithTag("...").WithPush())`; run `docker compose` with `Shell.Run("docker", "compose", ...)` |
| `Cloudflare.WorkersDeploy(...)` | CS1061: 'CloudflareOperations' does not contain 'WorkersDeploy' | Run Wrangler through an npm script: `Npm.Run(dir, "deploy")` |
| `if (show.Value == "x") { ... }` at the top level | InvalidOperationException: output not available yet | Read outputs inside `Ando.When(() => ..., ...)` or `Ando.Defer(() => ...)` |

## API Documentation

For detailed C# API documentation including all classes, methods, properties, and XML doc comments, see the API reference:

- https://andobuild.com/apidocs/api/Ando.html - Main Ando namespace (CLI, Operations, Workflow)
- https://andobuild.com/apidocs/api/Ando.Operations.html - All operation classes (DotnetOperations, DockerOperations, etc.)
- https://andobuild.com/apidocs/api/Ando.Workflow.html - Workflow execution (WorkflowRunner, BuildStep, StepRegistry)
- https://andobuild.com/apidocs/api/Ando.Context.html - Build context (BuildPath, PathsContext, VarsContext)
- https://andobuild.com/apidocs/api/Ando.References.html - Project references (ProjectRef, DirectoryRef, EfContextRef)
- https://andobuild.com/apidocs/api/Ando.Logging.html - Logging interfaces (IBuildLogger, ConsoleLogger)
- https://andobuild.com/apidocs/api/Ando.Execution.html - Command execution (ProcessRunner, ContainerExecutor, DockerManager)
- https://andobuild.com/apidocs/api/Ando.Scripting.html - Roslyn scripting (ScriptHost, ScriptGlobals, BuildOperations)
- https://andobuild.com/apidocs/api/Ando.Profiles.html - Build profiles (ProfileRegistry, Profile)
- https://andobuild.com/apidocs/api/Ando.Utilities.html - Utility classes (VersionResolver, GitHubAuthHelper)

The API docs are generated from C# XML documentation comments using DocFX and provide complete type information, method signatures, and usage examples.

## Markdown Versions

All pages are available in markdown format for LLM consumption:

### Main Pages
- https://andobuild.com/index.md - Homepage and overview
- https://andobuild.com/about.md - About ANDO
- https://andobuild.com/cli.md - CLI reference
- https://andobuild.com/tools.md - Tool installation: Bun, Node.js, Docker, .NET SDK, DocFX and Playwright installers
- https://andobuild.com/hooks.md - Pre-build and post-build hooks
- https://andobuild.com/llm-prompt.md - LLM prompt for adding ANDO to projects
- https://andobuild.com/skills.md - Downloadable quick-start skill file for LLMs
- https://andobuild.com/server.md - CI Server installation, configuration (SQL Server or PostgreSQL), backup/restore, and API tokens
- https://andobuild.com/server-truenas.md - CI Server installation on TrueNAS SCALE (SQL Server or Postgres app)
- https://andobuild.com/changelog.md - Release history
- https://andobuild.com/license.md - License information

### Provider Documentation
- https://andobuild.com/providers/ando.md - The Ando object: build configuration, artifacts, nested builds, step model (Block, Finally, Defer, When, Require, Confirm, Report)
- https://andobuild.com/providers/appservice.md - Azure App Service deployments
- https://andobuild.com/providers/archive.md - Deterministic zip and tar.gz archives
- https://andobuild.com/providers/azure.md - Azure CLI authentication and az commands
- https://andobuild.com/providers/bicep.md - Azure Bicep deployments
- https://andobuild.com/providers/bun.md - Bun installation
- https://andobuild.com/providers/cloudflare.md - Cloudflare Pages deployments
- https://andobuild.com/providers/docfx.md - DocFX API documentation generation
- https://andobuild.com/providers/docker.md - Docker image building
- https://andobuild.com/providers/dotnet.md - .NET build, test, publish
- https://andobuild.com/providers/ef.md - Entity Framework Core migrations
- https://andobuild.com/providers/files.md - Copy files and directories in the container
- https://andobuild.com/providers/functions.md - Azure Functions deployments
- https://andobuild.com/providers/globals.md - Bare globals: Root, Temp, Env, Directory, DefineProfile, Log
- https://andobuild.com/providers/git.md - Git version control operations
- https://andobuild.com/providers/github.md - GitHub releases and container registry
- https://andobuild.com/providers/http.md - HTTP health-check gating (wait for an endpoint to be healthy)
- https://andobuild.com/providers/node.md - Node.js installation
- https://andobuild.com/providers/npm.md - npm operations
- https://andobuild.com/providers/nuget.md - NuGet package operations
- https://andobuild.com/providers/playwright.md - Playwright E2E testing
- https://andobuild.com/providers/shell.md - Run commands and bash scripts in the build container

### Examples
- https://andobuild.com/examples/index.md - All examples by category

**.NET**
- https://andobuild.com/examples/dotnet-tool.md - .NET CLI tool with NuGet publishing
- https://andobuild.com/examples/ef-migrations.md - EF Core database migrations
- https://andobuild.com/examples/git-versioning.md - Git tag versioning and semantic versioning
- https://andobuild.com/examples/docfx-api-docs.md - DocFX API documentation generation
- https://andobuild.com/examples/monorepo-build.md - Monorepo orchestration with Ando.Build
- https://andobuild.com/examples/nuget-publishing.md - NuGet.org package publishing

**Frontend**
- https://andobuild.com/examples/astro.md - Astro + Cloudflare Pages
- https://andobuild.com/examples/cloudflare-workers.md - Cloudflare Workers serverless deployment
- https://andobuild.com/examples/react-spa.md - React/Vue SPA with Vite

**Full Stack**
- https://andobuild.com/examples/fullstack-deploy.md - .NET API + JS frontend deployment

**Azure**
- https://andobuild.com/examples/azure-app-service.md - Azure App Service deployment
- https://andobuild.com/examples/azure-functions.md - Azure Functions deployment
- https://andobuild.com/examples/bicep-infrastructure.md - Bicep infrastructure as code

**Docker**
- https://andobuild.com/examples/container-github-registry.md - Docker to GitHub Container Registry
- https://andobuild.com/examples/docker-compose.md - Docker Compose multi-container apps

**GitHub**
- https://andobuild.com/examples/github-releases.md - GitHub releases with auto-generated notes
- https://andobuild.com/examples/nuget-github-packages.md - NuGet to GitHub Packages

**Testing**
- https://andobuild.com/examples/playwright-e2e-tests.md - Playwright E2E tests

**Hooks**
- https://andobuild.com/examples/pre-hook-cleanup.md - Pre-build cleanup hook
- https://andobuild.com/examples/post-release-hook.md - Post-release auto-update hook