cflare config & profile

Configuration & Profiles

Auth

Manage API tokens, account defaults, and effortlessly switch between production, staging, and personal accounts.

$ cflare config <get|set|delete|list> [options] cflare profile <list|use|add|remove> [name]

📖 Full Explanation

Managing multiple clients, environments, and personal Cloudflare accounts is frictionless with the profile manager. \1 isolates credentials, account IDs, and preferred formatting flags so you never accidentally execute destructive operations on production infrastructure.

⚙️ Command Options & Flags

Option / Flag Description Default
config set Interactively or programmatically store API token and default account -
config get <key> Retrieve stored configuration key value -
profile add <name> Create a named profile with isolated credentials and account ID -
profile use <name> Switch active profile context globally -

🔬 Technical Corollary & Edge Mechanics

Profile configurations reside in \1. Each profile maintains independent account caching and zone ID resolution tables, preventing cross-tenant cache contamination. In high-security environments, API tokens can be configured with minimal scopes (e.g. Zone:Read, DNS:Edit) rather than Global API Keys.

🎯 Real-World DevOps Use Cases

Production vs Staging Context Switching

Instantly switch from staging to production before deploying DNS overrides.

$ cflare profile use production cflare dns list prod.namishkumar.in

Headless Service Account Provisioning

Store a dedicated CI/CD bot token with minimal read-only permissions.

$ cflare config set --token cf_ci_bot_token_abc123

💻 Live Output Simulation

$ cflare profile list
┌─────────────┬──────────────────────────┬─────────────────┬────────┐
│ Profile     │ Account ID               │ Default Format  │ Active │
├─────────────┼──────────────────────────┼─────────────────┼────────┤
│ production  │ 912384719283749182374918 │ table           │   ★    │
│ staging     │ 583920182746192847192834 │ json            │        │
│ personal    │ 392817492817491827491827 │ table           │        │
└─────────────┴──────────────────────────┴─────────────────┴────────┘