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

tf-ai

v0.1.7

Published

AI-powered terminal assistant that explains errors and suggests fixes

Readme

tf-ai 🤖

The AI-powered cheap copy of thefuck- explains errors, fixes commands, and troubleshoots the terminal.

tf-ai is a CLI tool that uses a LLM to analyze your terminal commands and their output.

Run a command, fail, type fuck, and let AI give you it's insight.

✨ Features

  • 🧠 Context-Aware Analysis: Understanding not just what failed, but where (PowerShell vs Bash, Node.js vs Python project, etc).
  • 📝 Plain English Explanations: Deciphers cryptic error codes and log spew into clear, actionable insights.
  • ⚡ Real-Time Streaming: It's not 2024 anymore. No waiting for the full response.
  • 🛠️ Smart Suggestions: Offers corrected commands that match your specific shell syntax.
  • 🔌 Provider Agnostic: Works with Anthropic (Claude), OpenAI (GPT-4), Google (Gemini), or any Vercel AI SDK compatible provider.

📦 Installation

# Install globally via npm
npm install -g tf-ai

# Or run directly
npx tf-ai --help

⚙️ Configuration

  1. Set your API Key (Required)

    export ANTHROPIC_API_KEY="sk-ant-..."
    # OR
    export OPENAI_API_KEY="sk-..."
  2. Advanced Config (Optional)

    Create ~/.tf-ai/config.json:

    {
      "model": "gpt-5.2",
      "confirmBeforeRun": true,
      "verbose": false
    }

🚀 Usage

1. Setup Shell Integration (Recommended)

To use the fuck alias, run the setup command for your shell:

tf-ai --setup

Follow the instructions to add the function to your shell profile:

  • Windows: PowerShell ($PROFILE)
  • Linux/macOS: Bash (.bashrc) or Zsh (.zshrc)

2. The "Fuck" Workflow

# 1. Mess up a command
PS> git pussh origin main
git: 'pussh' is not a git command.

# 2. Summon the AI
PS> fuck

# 3. Get help instantly
🤖 tf-ai
   It looks like you made a typo. 'pussh' is not a valid git command.

💡Suggested command:
   ➜ git push origin main

   [Enter] Run  [e] Edit  [Esc] Cancel

Flags

| Flag | Description | |------|-------------| | fuck | Analyze the last command (default - doesn't re-run it) | | fuck -r | Re-run the last command to capture its output, then analyze |

Tip: Use fuck -r when the error output is important for diagnosis. The default mode is faster and works well for typos and common mistakes.

3. Direct Usage

You can also use it manually to analyze specific errors:

# Analyze a specific failure
tf-ai --command "npm install" --output "EBADENGINE Unsupported engine"

# Just get an explanation without fixes
tf-ai --command "ls -la" --explain

🛠️ Development

git clone https://github.com/yourusername/thefuckai.git
cd thefuckai
pnpm install

# Run locally
pnpm dev -- --command "echo test" --output "error"

📄 License

MIT