cfman
v0.4.0
Published
A beautiful CLI tool to manage multiple Cloudflare accounts and deploy Workers with ease
Maintainers
Readme
🌩️ cfman
A beautiful CLI tool to manage multiple Cloudflare accounts and deploy Workers/Pages with ease
✨ Features
- 🔐 Secure Token Management - Store multiple Cloudflare API tokens safely
- 🚀 One-Command Deployment - Deploy Workers or Pages to any account with a single command
- 🎨 Beautiful CLI - Colorful, intuitive interface with helpful prompts and emojis
- 🔄 Complete Wrangler Integration - Full overlay on top of Wrangler with account management
- 📄 Pages Support - Deploy Next.js and other static sites to Cloudflare Pages
- ⚡ Smart Fallback - Automatically uses
npx wranglerif global installation is not found - 🛡️ Type-Safe - Built with TypeScript for reliability
- ⚡ Fast & Lightweight - Single bundled executable
🚀 Quick Start
Installation
# Global installation (recommended)
npm install -g cfman
# Or use with npx (no installation needed)
npx cfman --helpSetup Your First Account
# Add your first Cloudflare account
cfman token add --name production --token your_cf_token_here
# Check status with beautiful output
cfman status
# Use any Wrangler command with account management
cfman wrangler --account production whoami📚 Usage
Token Management
# Add a new account token with guided prompts
cfman token add --name staging --token cf_abc123...
# List all configured accounts (tokens never shown)
cfman token list
# Remove an account with confirmation
cfman token remove staging
# Show config file locations and security info
cfman token infoUniversal Wrangler Commands
# Run ANY Wrangler command with account management
cfman wrangler --account myaccount whoami
cfman wrangler --account myaccount pages project list
cfman wrangler --account myaccount d1 list
cfman wrangler --account myaccount kv namespace list
# Examples for Pages
cfman wrangler --account myaccount pages deploy out
cfman wrangler --account myaccount pages deployment list
# Examples for Workers
cfman wrangler --account myaccount deploy
cfman wrangler --account myaccount tail my-worker
cfman wrangler --account myaccount secret put SECRET_KEY
# Works without global Wrangler installation (uses npx automatically)
cfman wrangler --account myaccount whoamiStatus & Setup
# Check current configuration with beautiful interface
cfman status
# Interactive setup wizard for new users
cfman setup🔧 Configuration
Token Storage
Tokens are securely stored in your system's config directory:
- macOS/Linux:
~/.config/cfman/tokens.json - Windows:
%APPDATA%/cfman/tokens.json
File permissions are set to 600 (owner read/write only) for security.
Wrangler Integration
cfman is a complete overlay on top of Wrangler supporting:
- Universal Commands - Run ANY Wrangler command with
cfman wrangler --account name <command> - Smart Fallback - Uses
npx wranglerautomatically if global Wrangler is not installed - Fallback Support - Uses
wrangler auth loginwhen no tokens are configured - Beautiful Interface - Enhanced with colors, emojis, and helpful prompts
Wrangler Installation:
- Recommended:
npm install -g wrangler(faster execution) - Automatic: cfman automatically uses
npx wrangleras fallback - No Setup Required: Works out of the box with Node.js installed
🎯 Why cfman?
Before cfman:
# Switch between accounts manually
export CLOUDFLARE_API_TOKEN=cf_token_for_client_a
wrangler deploy --env production
export CLOUDFLARE_API_TOKEN=cf_token_for_client_b
wrangler pages deploy outWith cfman (Universal Overlay):
# Clean, simple, safe - Works with ANY Wrangler command
cfman wrangler --account client-a deploy --env production
cfman wrangler --account client-b pages deploy out
cfman wrangler --account client-a d1 create my-database
cfman wrangler --account client-b kv namespace create my-kv
# Beautiful interface with helpful guidance
cfman status # See what's configured
cfman setup # Interactive setup wizard🛠️ Development
Prerequisites
- Node.js 18+
- pnpm (recommended) or npm
Setup
# Clone the repository
git clone https://github.com/novincode/cfman.git
cd cfman
# Install dependencies
pnpm install
# Build the project
pnpm build
# Test locally
./dist/index.js --helpBuild & Release
# Build for production
pnpm build
# Run in development mode with auto-reload
pnpm dev
# Publish to npm
npm publish🔒 Security
- 🛡️ Package Provenance: Published with cryptographic verification linking npm package to GitHub source code
- 🔐 Secure Token Storage: API tokens stored locally with secure file permissions (600)
- 👁️ Privacy: Tokens are never logged, printed, or transmitted
- 🔒 OS-Level Encryption: Each account's token is isolated and encrypted at rest by the OS
- ✅ Supply Chain Security: Verifiable build process through GitHub Actions and npm attestations
- Compatible with existing Wrangler authentication methods
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT © Shayan Moradi
🙏 Acknowledgments
- Built on top of Wrangler - the official Cloudflare Workers CLI
- Inspired by the need for better multi-account management in modern development workflows
