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

prompt-formatter

v1.1.6

Published

Transform casual prompts into well-formatted prompts optimized for Claude Code

Readme

prompt-formatter

Transform casual prompts into well-formatted prompts optimized for AI coding assistants.

Installation

Homebrew (macOS/Linux)

brew tap elec7rik/prompt-formatter
brew install prompt-formatter

npm (requires Node.js 18+)

npm install -g prompt-formatter

Standalone Binary

Download from GitHub Releases:

# macOS (Apple Silicon)
curl -L https://github.com/elec7rik/prompt-fmt/releases/latest/download/prompt-formatter-darwin-arm64.tar.gz | tar xz
sudo mv prompt-formatter /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/elec7rik/prompt-fmt/releases/latest/download/prompt-formatter-darwin-x64.tar.gz | tar xz
sudo mv prompt-formatter /usr/local/bin/

# Linux (x64)
curl -L https://github.com/elec7rik/prompt-fmt/releases/latest/download/prompt-formatter-linux-x64.tar.gz | tar xz
sudo mv prompt-formatter /usr/local/bin/

Quick Start

# Format a prompt (copies result to clipboard)
prompt-formatter "fix the login bug"

# Interactive mode - prompts for input
prompt-formatter

On first run, you'll be guided through provider selection and API key setup.

Usage

prompt-formatter [prompt] [options]

Options

| Option | Description | |--------|-------------| | -p, --provider <provider> | LLM provider: google, anthropic, or openai | | --api-key <key> | API key (overrides environment variable) | | --detailed | Detailed mode with numbered steps and edge cases | | --concise | Concise mode - brief but clear (default) | | --no-copy | Don't copy result to clipboard |

Examples

# Basic usage
prompt-formatter "add user authentication"

# Detailed output with numbered steps
prompt-formatter "refactor the database layer" --detailed

# Use a specific provider
prompt-formatter "optimize this query" --provider anthropic

# Don't copy to clipboard
prompt-formatter "add tests" --no-copy

Project Context

Run prompt-formatter init to enable project-aware prompts. This scans your project and creates .prompt-formatter.json with detected language, framework, test runner, and directory structure.

cd my-project
prompt-formatter init

Re-running init in an existing project checks for changes and prompts to update:

Project config exists. Checking for changes...

Detected updates:

  + dependency: axios
  ~ framework: react → next.js

Update config? (Y/n)

Use --force to reinitialize without prompts:

prompt-formatter init --force

Supported Languages & Frameworks

| Language | Frameworks | Test Runner | |----------|------------|-------------| | TypeScript/JavaScript | Next.js, Remix, Nuxt, React, Vue, Angular, Svelte, Solid, Express, NestJS, Fastify, Hono, Koa, Electron, React Native, Expo | Vitest, Jest, Mocha, AVA, Jasmine | | Python | Django, FastAPI, Flask, Tornado, aiohttp | pytest, unittest | | Swift | SwiftUI, Vapor, RxSwift | XCTest | | Java | Spring Boot, Spring, Quarkus, Micronaut | JUnit | | Kotlin | Android, Ktor, Spring Boot | JUnit, Android Test | | Go | Gin, Echo, Fiber, Chi | go test | | Rust | Actix-web, Axum, Rocket, Warp, Tauri | cargo test | | C# | ASP.NET Core, MAUI, Blazor, WPF, Xamarin | xUnit, NUnit, MSTest | | Ruby | Rails, Sinatra, Hanami | RSpec, Minitest | | PHP | Laravel, Symfony, Slim, CodeIgniter | PHPUnit, Pest | | Elixir | Phoenix | ExUnit | | Scala | Play, Akka HTTP, http4s | ScalaTest | | Dart | Flutter | flutter test | | C/C++ | Qt | Google Test, Catch2 |

Configuration

# Show current configuration and project context
prompt-formatter config --show

# Set default provider
prompt-formatter config --set-provider google

# Set default verbosity
prompt-formatter config --set-verbosity detailed

API Keys

Secure Storage (Recommended)

Store your API key securely in the config file:

# Set API key for current provider (prompts securely, validates before saving)
prompt-formatter config --set-api-key

# Set API key for a specific provider
prompt-formatter config --set-api-key google

This avoids exposing keys in shell history and validates the key before saving.

Environment Variables

Alternatively, set your API key as an environment variable:

# Google Gemini (default, free tier available)
export GOOGLE_GENERATIVE_AI_API_KEY=your-key

# Anthropic Claude
export ANTHROPIC_API_KEY=your-key

# OpenAI
export OPENAI_API_KEY=your-key

Key Priority

  1. Stored config (via config --set-api-key)
  2. Environment variable
  3. Interactive prompt (first-time setup)

Commands

| Command | Description | |---------|-------------| | prompt-formatter [prompt] | Format a prompt | | prompt-formatter init | Initialize project context | | prompt-formatter config --show | Show current configuration | | prompt-formatter config --set-api-key [provider] | Set API key securely | | prompt-formatter config --set-provider <name> | Set default provider | | prompt-formatter help | Show help information |

License

MIT