Table of Contents

Class CloudflareOperations

Namespace
Ando.Operations
Assembly
ando.dll

Provides Cloudflare CLI operations for build scripts. Methods register steps in the workflow rather than executing immediately.

public class CloudflareOperations : OperationsBase
Inheritance
CloudflareOperations
Inherited Members

Constructors

CloudflareOperations(StepRegistry, IBuildLogger, Func<ICommandExecutor>)

public CloudflareOperations(StepRegistry registry, IBuildLogger logger, Func<ICommandExecutor> executorFactory)

Parameters

registry StepRegistry
logger IBuildLogger
executorFactory Func<ICommandExecutor>

Methods

EnsureAuthenticated()

Registers a step to verify Cloudflare credentials are configured. If environment variables are not set, prompts the user for values interactively.

public void EnsureAuthenticated()

GetWranglerInstallInstructions()

Gets installation instructions for wrangler CLI.

public static string GetWranglerInstallInstructions()

Returns

string

Installation command.

IsWranglerAvailable()

Checks if wrangler CLI is available on the system.

public static bool IsWranglerAvailable()

Returns

bool

True if wrangler is available (via npx or globally), false otherwise.

PagesCreateProject(string, string)

Registers a step to create a new Cloudflare Pages project.

public void PagesCreateProject(string projectName, string productionBranch = "main")

Parameters

projectName string

Name for the new project.

productionBranch string

Production branch name (defaults to "main").

PagesDeploy(DirectoryRef, Action<CloudflarePagesDeployOptions>)

Registers a step to deploy a directory to Cloudflare Pages. Use this overload when you need additional options like branch or commit metadata.

public void PagesDeploy(DirectoryRef directory, Action<CloudflarePagesDeployOptions> configure)

Parameters

directory DirectoryRef

Directory to deploy (the build output folder).

configure Action<CloudflarePagesDeployOptions>

Configuration for deployment options (must include project name).

PagesDeploy(DirectoryRef, string)

Registers a step to deploy a directory to Cloudflare Pages. The directory should be the build output (e.g., website / "dist").

public void PagesDeploy(DirectoryRef directory, string projectName)

Parameters

directory DirectoryRef

Directory to deploy (the build output folder).

projectName string

Cloudflare Pages project name.

PagesListDeployments(string?)

Registers a step to list deployments for a Cloudflare Pages project.

public void PagesListDeployments(string? projectName = null)

Parameters

projectName string

Project name. If null, uses CLOUDFLARE_PROJECT_NAME env var.

PagesListProjects()

Registers a step to list all Cloudflare Pages projects.

public void PagesListProjects()

PurgeCache(string?)

Registers a step to purge the entire Cloudflare cache for a zone. Accepts either a Zone ID or a domain name (e.g., "example.com"). If a domain name is provided, it will be resolved to a Zone ID via the API.

public void PurgeCache(string? zoneIdOrDomain = null)

Parameters

zoneIdOrDomain string

Zone ID or domain name. If null, uses CLOUDFLARE_ZONE_ID env var.