npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aalexis.dev/cfx

v1.0.2

Published

Ultra-lightweight multi-account Cloudflare Wrangler wrapper CLI with encrypted local storage

Downloads

48

Readme

⚡ cfx (@aalexis.dev/cfx)

Ultra-lightweight, secure CLI wrapper for managing multiple Cloudflare accounts with Wrangler.

🔒 Encrypted local storage with AES-256-GCM | ⚡ 0 runtime dependencies | 🌐 Cross-platform (Windows, macOS, Linux).


🚀 Features

  • Multi-Account Switching: Switch between Cloudflare accounts instantly using --acc=<name> or -a <name>.
  • Batch Execution: Run commands sequentially across all registered accounts with --all.
  • Transparent Wrangler Proxy: Forwards all arguments, flags, and real-time outputs (stdio: inherit) directly to the wrangler binary.
  • Zero Runtime Dependencies: Built exclusively on Node.js native modules (node:crypto, node:child_process, node:readline, node:fs, node:os).
  • Cryptographic Security: Credentials (accountId and apiToken) are encrypted locally with AES-256-GCM using a 256-bit master key with strict permissions (0600 / 0700).
  • Cross-Platform: Works seamlessly across Windows (CMD, PowerShell, Windows Terminal), macOS, and Linux.

🛠️ Global Installation (Recommended)

Install globally once to use the clean and short cfx command anywhere in your terminal:

# With pnpm
pnpm add -g @aalexis.dev/cfx

# With npm
npm install -g @aalexis.dev/cfx

Once installed globally, you can simply run:

cfx --add
cfx --list
cfx --acc=production deploy

📦 Direct Execution (Without Installation)

You can also run @aalexis.dev/cfx directly using your preferred package manager:

# With pnpm dlx
pnpm dlx @aalexis.dev/cfx --add
pnpm dlx @aalexis.dev/cfx --list
pnpm dlx @aalexis.dev/cfx --acc=production deploy

# With npx
npx @aalexis.dev/cfx --acc=staging tail

📖 Command Reference

1. Register an Account (--add)

Starts an interactive prompt to enter the account identifier name, Cloudflare Account ID, and Cloudflare API Token (the token input is securely masked in the terminal):

cfx --add
# or
cfx add

2. List Registered Accounts (--list)

Displays a formatted list of all configured accounts:

cfx --list
# or
cfx list
# or
cfx ls

3. Remove an Account (--remove)

Deletes an account from your local encrypted storage:

cfx --remove <name>
# or
cfx rm <name>

4. Run Wrangler on a Specific Account (--acc or -a)

Decrypts credentials in memory, injects CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, and invokes wrangler:

# Deploy a Worker
cfx --acc=production deploy

# Stream real-time logs
cfx -a staging tail

# Inspect current authenticated user and permissions
cfx --acc=client1 whoami

# Generate Cloudflare Worker / D1 / KV types
cfx --acc=prod types

5. Run Across All Accounts (--all)

Sequentially executes the specified command on every registered account and presents a summary table:

cfx --all deploy
cfx --all whoami

🔐 Security & Storage

  • Storage Location: ~/.cfx/accounts.json
  • Master Encryption Key: ~/.cfx/.key (generated locally with crypto.randomBytes(32) and protected with 0600 permissions on Unix systems).
  • Algorithm: AES-256-GCM with a unique 16-byte initialization vector (iv) and 16-byte authentication tag (authTag) per encrypted value.
  • Credentials are never transmitted over the network or stored in plain text.

💻 Local Development & Publishing

1. Clone and Install Dev Dependencies

git clone https://github.com/your-username/cfx.git
cd cfx
pnpm install

2. Build the Project (TypeScript)

pnpm build

3. Run Automated Tests

pnpm test

4. Link Locally for Testing

pnpm link --global

You can now test the cfx command directly from any terminal window.

5. Publish to the NPM Registry

# 1. Log in to your npm account (if not already authenticated)
pnpm login

# 2. Publish package with public access
pnpm publish --access public

📄 License

MIT © 2026