cdnscli

command module
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

cdnscli

Go Version License Build Status Go Report Card

Note: This tool is under active development.

Cloud DNS CLI - manage DNS records across multiple providers!

What is it?

cdnscli is a powerful cross-platform utility for managing DNS records and zones across multiple DNS providers, written in Go. It provides convenient tools for both task automation and manual management through the terminal.

The utility supports two modes of operation:

  • Classic CLI: Perfect for use in scripts, automation, and executing standalone commands.
  • TUI (Text User Interface): An interactive text-based interface for more convenient management.
Key Features
  • Manage zones and resource records: add, modify, and delete them.
  • Retrieve detailed information about zones and records.
  • Search DNS records by various parameters.
  • Export and import resource record sets in a convenient format.
  • Easy-to-use interface, ideal for administrators and developers.

Usage

cdnscli help
Receiving a token

Login to CloudFlare dash.
Go to My Account -> API Tokens and create a new token.

Configuration

Create a configuration file ~/.cdnscli.yaml in your home directory:

Tip: You can copy the example configuration file from the repository:

cp cdnscli.yaml.example ~/.cdnscli.yaml

Then edit the file with your credentials:

default-provider: cloudflare
client-timeout: 10s
output-format: text
debug: false

providers:
  cloudflare:
    type: cloudflare
    credentials:
      api-token: your-cloudflare-api-token-here
    # Alternative authentication (api-key + email):
    # credentials:
    #   api-key: your-api-key
    #   email: your-email@example.com
Multiple Providers

You can configure multiple providers of the same type (e.g., multiple CloudFlare accounts) by giving them different names:

default-provider: cf-production
client-timeout: 10s
output-format: text
debug: false

providers:
  cf-production:
    type: cloudflare
    credentials:
      api-token: production-account-token
  cf-staging:
    type: cloudflare
    credentials:
      api-token: staging-account-token
  cf-personal:
    type: cloudflare
    credentials:
      api-token: personal-account-token

To switch between providers, change the default-provider value in the config file, or use the default provider specified in the config.

You can also use environment variables instead of a config file:

export CLOUDFLARE_API_TOKEN=your-cloudflare-api-token-here
# or
export CDNSCLI_PROVIDERS_CLOUDFLARE_CREDENTIALS_API_TOKEN=your-cloudflare-api-token-here
# Note: environment variables use underscores, not dashes
Multiple Providers with Environment Variables

For multiple providers, you can use environment variables with the provider name:

# Set default provider
export CDNSCLI_DEFAULT_PROVIDER=cf-production

# Configure each provider
export CDNSCLI_PROVIDERS_CF_PRODUCTION_CREDENTIALS_API_TOKEN=production-account-token
export CDNSCLI_PROVIDERS_CF_STAGING_CREDENTIALS_API_TOKEN=staging-account-token
export CDNSCLI_PROVIDERS_CF_PERSONAL_CREDENTIALS_API_TOKEN=personal-account-token

Environment variables follow the pattern: CDNSCLI_PROVIDERS_<PROVIDER_NAME>_CREDENTIALS_<CREDENTIAL_KEY>

Examples

Add or change resource records

cdnscli rr add -t A -n www -z example.com -c 192.0.2.2
cdnscli rr change --name example.com --zone example.com --type SOA --content "ns1.example.com. admins.example.com. 1970010100 1800 900 604800 86400"

Delete resource record

cdnscli rr del -t A -n www -z example.com

Installation

Download the latest release from GitHub Releases and extract the binary for your platform.

macOS (Intel):

curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Darwin_x86_64.tar.gz | tar -xz
sudo mv cdnscli /usr/local/bin/

macOS (Apple Silicon):

curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Darwin_arm64.tar.gz | tar -xz
sudo mv cdnscli /usr/local/bin/

Linux:

# For amd64
curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Linux_x86_64.tar.gz | tar -xz
# For arm64
curl -L https://github.com/mixanemca/cdnscli/releases/latest/download/cdnscli_Linux_arm64.tar.gz | tar -xz
sudo mv cdnscli /usr/local/bin/

Windows: Download the appropriate cdnscli_Windows_x86_64.zip or cdnscli_Windows_arm64.zip from the releases page and extract the cdnscli.exe file.

Go Install

Install directly from source:

go install github.com/mixanemca/cdnscli@latest

Note: You can also install a specific version by replacing @latest with @v0.99.0 (or any other version tag).

Build from Source
git clone https://github.com/mixanemca/cdnscli.git
cd cdnscli
make
make install

Testing (WIP)

make test

License

Apache 2.0

Documentation

Overview

The cdnscli program.

Directories

Path Synopsis
Package cmd holds cdnscli command and it sub-commands.
Package cmd holds cdnscli command and it sub-commands.
internal
app
Package app represent cdnscli application for work with providers API's.
Package app represent cdnscli application for work with providers API's.
config
Package config holds configuration structures and loading logic.
Package config holds configuration structures and loading logic.
models
Package models holds an internal structs for DNS zones and records and also queries params.
Package models holds an internal structs for DNS zones and records and also queries params.
prettyprint
Package prettyprint holds pretty printer for internal models.
Package prettyprint holds pretty printer for internal models.
providers
Package providers holds DNS providers and interface for works with its.
Package providers holds DNS providers and interface for works with its.
ui
Package ui holds cdnscli UI.
Package ui holds cdnscli UI.
ui/popup
Package popup holds cdnscli UI elements for editing.
Package popup holds cdnscli UI elements for editing.
ui/theme
Package theme holds the bubble tea UI settings.
Package theme holds the bubble tea UI settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL