Skip to main content

wyrmctl-cloudflare

Cloudflare DNS provider plugin for Portwyrm through wyrmctl

Extend wyrmctl with Cloudflare-backed DNS record management for declarative workflows, provider discovery, and DNS-aware automation.

PyPI version Python versions CI SSOT governed Apache 2.0 License

wyrmctl-cloudflare package hits wyrmctl-cloudflare downloads

wyrmctl architecture infographic

wyrmctl-cloudflare is the Cloudflare DNS provider package for the Portwyrm wyrmctl CLI. Install it when you want desired-state DNS records or DNS diagnostics to resolve through Cloudflare instead of using only the base wyrmctl package.

Supported Python Versions

wyrmctl-cloudflare supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Why wyrmctl-cloudflare

  • Adds Cloudflare DNS provider discovery to wyrmctl
  • Lets DNS workflows live beside proxy and certificate desired state
  • Keeps Cloudflare API tokens out of the core CLI package
  • Supports operator diagnostics through wyrmctl dns doctor
  • Provides client helpers for Cloudflare DNS record workflows

FAQ

What is wyrmctl-cloudflare?

Answer: wyrmctl-cloudflare is a Portwyrm extension package that teaches wyrmctl how to talk to the Cloudflare DNS Records API for DNS record operations and DNS provider diagnostics.

When do I need wyrmctl-cloudflare?

Answer: You need wyrmctl-cloudflare when your wyrmctl workflow includes Cloudflare-managed DNS records or when you want wyrmctl to validate Cloudflare DNS connectivity and credentials.

Does wyrmctl-cloudflare work without wyrmctl?

Answer: No. wyrmctl-cloudflare is an extension package for wyrmctl, not a standalone CLI.

Can wyrmctl-cloudflare set DNS records?

Answer: Yes. The Cloudflare provider supports declarative A, AAAA, CNAME, TXT, MX, SRV, and CAA writes. MX records require priority.

What credentials are required?

Answer: Cloudflare API access requires CLOUDFLARE_API_TOKEN. For diagnostics, grant zone read and DNS read access. For record changes, grant DNS write access to the target zone.

Install

Install the base CLI and the Cloudflare provider package together:

pipx install wyrmctl
pipx inject wyrmctl wyrmctl-cloudflare
wyrmctl plugins list

With uv:

uv tool install wyrmctl
uv tool install wyrmctl-cloudflare
wyrmctl plugins list

Inside a virtual environment:

python -m venv .venv
. .venv/bin/activate
python -m pip install wyrmctl wyrmctl-cloudflare
wyrmctl plugins list

Configure Cloudflare

Set the required environment variable:

export CLOUDFLARE_API_TOKEN=your-cloudflare-api-token

Optional for tests, proxies, or alternate endpoints:

export CLOUDFLARE_API_BASE_URL=https://api.cloudflare.com/client/v4

Verify Plugin Discovery

Check that wyrmctl can discover the provider:

wyrmctl plugins list
wyrmctl dns doctor --provider cloudflare

Minimal DNS Workflow

Once the provider is installed and configured, wyrmctl can validate, plan, apply, or diagnose Cloudflare-backed DNS behavior through the base CLI:

wyrmctl validate desired-state/dns.yaml
wyrmctl plan desired-state/dns.yaml --owner site-a
wyrmctl apply desired-state/dns.yaml --owner site-a
wyrmctl dns providers
wyrmctl dns zones --provider cloudflare
wyrmctl dns records --provider cloudflare --zone example.com

Cloudflare API Surface

The provider follows the Cloudflare DNS Records API:

  • GET /zones: discover zones available to the token.
  • GET /zones/{zone_id}/dns_records: list DNS records in one zone.
  • POST /zones/{zone_id}/dns_records: create supported DNS records.
  • PUT /zones/{zone_id}/dns_records/{dns_record_id}: overwrite an existing record.
  • PATCH /zones/{zone_id}/dns_records/{dns_record_id}: partially update an existing record.
  • DELETE /zones/{zone_id}/dns_records/{dns_record_id}: delete a record.

Programmatic Record Operations

The wyrmctl DNS provider contract requires zones() and records(zone). This package also exposes client helpers for API-backed record mutation:

from wyrmctl_cloudflare import CloudflareClient, CloudflareConfig

client = CloudflareClient(CloudflareConfig.from_env())
record = client.create_record("example.com", type="A", name="www", value="192.0.2.10", ttl=300)
client.patch_record("example.com", str(record.record_id), value="192.0.2.11")
client.delete_record("example.com", str(record.record_id))

CNAME and other supported record types use the same method. MX records pass priority:

client.create_record("example.com", type="CNAME", name="app", value="target.example.net", ttl=300)
client.create_record("example.com", type="MX", name="@", value="mail.example.com", ttl=300, priority=10)

Safety Notes

  • Only operate on zones that are authoritative in Cloudflare.
  • Use least-privilege API tokens scoped to the intended zone.
  • Keep CLOUDFLARE_API_TOKEN out of desired-state files and logs.
  • Cloudflare prevents CNAME records from coexisting with A or AAAA records on the same name.
  • Use wyrmctl owner metadata for desired DNS records so apply remains owner-scoped.

More Documentation

Metadata

Release files for wyrmctl-cloudflare 0.4.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wyrmctl-cloudflare 0.4.9
File Size Uploaded Provenance Actions
wyrmctl_cloudflare-0.4.9.tar.gz 7.6 kB With provenance Details for wyrmctl_cloudflare-0.4.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wyrmctl-cloudflare 0.4.9
File Interpreter ABI Platform Actions
wyrmctl_cloudflare-0.4.9-py3-none-any.whl Python 3 none any Details for wyrmctl_cloudflare-0.4.9-py3-none-any.whl

Total release size: 17.5 kB

Release files / wyrmctl_cloudflare-0.4.9.tar.gz

Download URL wyrmctl_cloudflare-0.4.9.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dc8531cb5a04d77cd6f18701726c403c0eca38149fb690993cd1409fcf248855
BLAKE2b-256 checksum
How to use checksums
bbcfaa91af88d5b9b3cb2c5de9b2d43c54fa5bcbc6fb9d1dd62bb0bbf6f577e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / wyrmctl_cloudflare-0.4.9-py3-none-any.whl

Download URL wyrmctl_cloudflare-0.4.9-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a6d1af8dbf4e019d3a80a109c7c1f25eafba8fbb54abc3625030acda330b506
BLAKE2b-256 checksum
How to use checksums
9db4a0736701197255c86d9ed6d641ae45f892e55b17b369b2ee09ae82d3e7f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for wyrmctl-cloudflare 0.4.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wyrmctl_cloudflare-0.4.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.9 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page