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

droid-switch

v1.3.1

Published

A tool for switching between Factory API keys

Readme

Droid Switch

A command-line tool for switching between Factory API keys.

Commands

  • ds list - List all keys with usage information and switch interactively
  • ds current - Show the currently active key with its usage
  • ds add - Add API keys interactively (enter keys separated by spaces)
  • ds del - Delete API keys interactively (supports multi-selection)
  • ds - Show help information

Installation

npm install -g droid-switch

Prerequisites

Before using this tool, you need to create a ~/.factory/keys.json file with your API keys:

[
  "fk-xxxxxxxxx",
  "fk-yyyyyyyyy"
]

Usage

List and Select Keys

Run ds list to interactively select and switch between keys:

ds list

This command will:

  • Fetch the latest usage information for all keys
  • Show a list of your keys with their usage information (总量/剩余)
  • Allow you to select one using arrow keys
  • Update the environment variable in ~/.zshrc after selection

Show Current Key

Display the currently active key:

ds current

Add New Keys

Add API keys to your key list interactively:

ds add

When prompted, you can:

  • Enter a single key: fk-xxxxxxxxx
  • Enter multiple keys separated by spaces: fk-xxxxxxxxx fk-yyyyyyyyy fk-zzzzzzzzz

The command will:

  • Prompt you to enter API keys
  • Accept multiple keys separated by spaces in a single input
  • Validate that keys start with "fk-"
  • Skip duplicate keys if they already exist
  • Display the number of keys successfully added

Delete Keys

Interactively delete keys from your list:

ds del

This command will:

  • Show all your keys in an interactive checkbox list
  • Allow you to select multiple keys using the space bar
  • Protect the currently active key from deletion (shown as disabled)
  • Ask for confirmation before deleting selected keys
  • Ensure you always have at least one working key

Features

  • 🔑 Interactive key selection with arrow keys
  • 📊 Real-time usage statistics (total and remaining tokens)
  • ✅ Visual indicator for the currently active key
  • 🔒 Secure key masking (shows only partial key)
  • 💾 Automatic environment variable configuration in ~/.zshrc
  • 📋 v1.2.0: Automatically copies source ~/.zshrc command to clipboard
  • ⌨️ NEW v1.3.0: Pre-fills source ~/.zshrc command in terminal - just press Enter!

Note

Auto-fill Command (v1.3.0+) - Recommended

After switching keys with ds list:

  1. The source ~/.zshrc command is automatically typed in your terminal
  2. Just press Enter to execute - that's it!
  3. The command is also copied to clipboard as backup

Clipboard Method (v1.2.0+)

If auto-fill doesn't work in your terminal:

  1. The command is copied to your clipboard
  2. Paste it (Cmd+V on Mac, Ctrl+V on Linux/Windows)
  3. Press Enter to execute

Manual Method

If both auto features fail:

source ~/.zshrc

Or simply open a new terminal window for the changes to take effect.