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.
-
Install the
gogeneratecftokenbinary: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.
-
Initialize the configuration and follow the prompt:
gogeneratecftoken config init -
Add your master API token:
gogeneratecftoken credentials set -
Validate your credentials:
gogeneratecftoken credentials validate -
Generate a token:
gogeneratecftoken token generate myservice -
List your tokens:
gogeneratecftoken token list
CLI Reference
See the CLI Reference section for the full CLI reference.