{"id":29128024,"url":"https://github.com/sagar290/cf","last_synced_at":"2026-04-24T11:33:51.386Z","repository":{"id":301686359,"uuid":"1005892320","full_name":"sagar290/cf","owner":"sagar290","description":"CLI tool to update Cloudflare DNS records using Go","archived":false,"fork":false,"pushed_at":"2025-08-12T16:29:33.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-12T18:24:55.507Z","etag":null,"topics":["cli","cloudflare","devops","dns","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagar290.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-21T03:12:30.000Z","updated_at":"2025-08-12T16:27:11.000Z","dependencies_parsed_at":"2025-06-28T08:18:53.489Z","dependency_job_id":"e16522f6-0915-4833-8b35-823f0a4a4dbe","html_url":"https://github.com/sagar290/cf","commit_stats":null,"previous_names":["sagar290/cf"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sagar290/cf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagar290%2Fcf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagar290%2Fcf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagar290%2Fcf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagar290%2Fcf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagar290","download_url":"https://codeload.github.com/sagar290/cf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagar290%2Fcf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32221524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cloudflare","devops","dns","go"],"created_at":"2025-06-30T01:02:17.579Z","updated_at":"2026-04-24T11:33:51.381Z","avatar_url":"https://github.com/sagar290.png","language":"Go","readme":"# Cloudflare DNS Updater (CLI Tool)\n\nA CLI tool written in Go using Cobra to update or insert **A records** (or other types) for a domain in Cloudflare via the Cloudflare API.\n\n---\n\n## 🚀 Features\n\n- Update existing DNS records\n- Insert (upsert) DNS records if not found\n- Add optional comment to records\n- Supports TTL and Cloudflare proxy settings\n- Reads Cloudflare API token from `--apiToken` flag or `CF_API_TOKEN` environment variable\n\n---\n\n## 🔧 Installation\n\n1. Clone the repo:\n   ```bash\n   git clone https://github.com/sagar290/cf.git\n   cd cloudflare-dns-updater\n   ```\n\n2. Build the binary:\n   ```bash\n   go build -o cf\n   ```\n\n## 📦 Download Binaries\n\nPrebuilt binaries for all major platforms are available on the [Releases](https://github.com/sagar290/cf/releases) page.\n\n| Platform      | File Name                   |\n|---------------|-----------------------------|\n| Linux (amd64) | `cf-linux-amd64`            |\n| Linux (arm64) | `cf-linux-arm64`            |\n| macOS         | `cf-darwin-amd64`           |\n| Windows       | `cf-windows-amd64.exe`      |\n| Windows (ARM) | `cf-windows-arm64.exe`      |\n\n---\n\n## 📥 Quick Download Example (Linux)\n\n```bash\ncurl -L -o cf https://github.com/sagar290/cf/releases/latest/download/cf-linux-amd64\nchmod +x cf\n./cf --help\n```\n\n---\n\n## ✅ Usage\n\n```bash\ncf update:dns [domain] [type] [key] [value] [comment (optional)]\n```\n\n### Arguments:\n\n| Argument | Description                                  | Required |\n|----------|----------------------------------------------|----------|\n| domain   | Your domain name (e.g., example.com)         | ✅       |\n| type     | DNS record type (e.g., A, CNAME)             | ✅       |\n| key      | DNS key to update (e.g., `@`, `www`)         | ✅       |\n| value    | New value (e.g., IP address or CNAME target) | ✅       |\n| comment  | Optional comment for the DNS record          | ❌       |\n\n---\n\n### 🔁 Example\n\n```bash\ncf update:dns example.com A @ 123.123.123.123 \"Main site IP\"\n```\n\nThis updates or inserts the A record for `example.com` with a comment.\n\n---\n\n## ⚙️ Flags\n\n| Flag         | Default | Description                                  |\n|--------------|---------|----------------------------------------------|\n| `--proxied`  | true    | Whether the record should be proxied         |\n| `--ttl`      | 3600    | Time To Live for the DNS record (in seconds) |\n| `--upsert`   | false   | Create the record if it doesn't exist        |\n\n---\n\n## 🔐 Authentication\n\nSet your Cloudflare API token as an environment variable:\n\n```bash\nexport CF_API_TOKEN=your_token_here\n```\n\n---\n\n## 📦 Sample Output\n\n```\n✅ Inserted www to 123.123.123.123\nResponse: {...}\n```\nor\n```\n✅ Updated www to 123.123.123.123\nResponse: {...}\n```\n\n---\n\n## 📝 Notes\n\n- If `--upsert` is not enabled, a missing record will cause an error.\n- Use `@` to target the root domain.\n- Comments are supported and visible in Cloudflare dashboard.\n\n---\n\n\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagar290%2Fcf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagar290%2Fcf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagar290%2Fcf/lists"}