Skip to content

goGenerateCFToken

Introduction

goGenerateCFToken is a simple CLI tool for generating Cloudflare API tokens with Zone:Zone:Read and Zone:DNS:Edit permissions. It also provides some limited token lifecycle management support, such as listing and deleting tokens.

Features

  • Token Generation — Create API tokens with zone read and DNS write permissions
  • Token Management — List and revoke existing tokens
  • Credential Storage — Securely store API keys in the OS keyring
  • Configuration — XDG-compliant config file support

Quick Start

While a Docker image is available for use, goGenerateCFToken is primarily intended for installation and use via bare-metal.

  1. Install the gogeneratecftoken binary:

    tmp=$(mktemp)
    curl -sSfL https://raw.githubusercontent.com/nicholas-fedor/goGenerateCFToken/main/scripts/install.sh -o "$tmp" && sh "$tmp"
    rm -f "$tmp"

    See Getting Started for packages, Docker, and building from source.

  2. Initialize the configuration and follow the prompt:

    gogeneratecftoken config init
  3. Add your master API token:

    gogeneratecftoken credentials set
  4. Validate your credentials:

    gogeneratecftoken credentials validate
  5. Generate a token:

    gogeneratecftoken token generate myservice
  6. List your tokens:

    gogeneratecftoken token list

CLI Reference

See the CLI Reference section for the full CLI reference.