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

@raptrx/askai

v1.1.0

Published

Simplified AI prompt deep-linking for ChatGPT, Claude, Gemini, Grok, Perplexity and more

Downloads

139

Readme

askai

Add "Ask AI" buttons to your app in seconds. No dependencies. You own the code.

Send content to ChatGPT, Claude, Gemini, Grok, Perplexity and 5 more AI services with one click.

Quick Start

npx @raptrx/askai init
npx @raptrx/askai add button

That's it. You now have an AI button in your project.

How It Works

This is NOT a dependency. Like shadcn/ui, we copy the code directly into your project:

your-project/
├── askai.json                    # Config
├── src/
│   ├── lib/askai.ts             # AI services (you own this)
│   └── components/askai/
│       └── ask-ai-button.tsx    # Components (you own this)

You own the code. Customize it however you want.

Usage

Button

import { AskAIButton } from '@/components/askai/ask-ai-button';

<AskAIButton
  service="chatgpt"
  goal="Explain this code"
  content={codeString}
/>

Link (SSR-friendly)

import { AskAILink } from '@/components/askai/ask-ai-link';

<AskAILink
  service="claude"
  goal="Review this"
  content={codeString}
>
  Ask Claude
</AskAILink>

Dropdown (multiple services)

import { AskAIDropdown } from '@/components/askai/ask-ai-dropdown';

<AskAIDropdown
  goal="Explain this code"
  content={codeString}
  services={['chatgpt', 'claude', 'gemini', 'perplexity']}
/>

Direct URL (vanilla JS)

import { buildPromptUrl, openInAI } from '@/lib/askai';

// Get URL
const url = buildPromptUrl('chatgpt', 'Explain this', code);

// Or open directly
openInAI('claude', 'Review this', code);

CLI Commands

# Initialize in your project
npx @raptrx/askai init

# Add components
npx @raptrx/askai add button      # AskAIButton
npx @raptrx/askai add link        # AskAILink
npx @raptrx/askai add dropdown    # AskAIDropdown

# Help
npx @raptrx/askai --help

Supported AI Services

| Service | ID | URL | |---------|-------|-----| | ChatGPT | chatgpt | chat.openai.com | | Claude | claude | claude.ai | | Gemini | gemini | gemini.google.com | | Grok | grok | grok.x.ai | | Perplexity | perplexity | perplexity.ai | | DeepSeek | deepseek | chat.deepseek.com | | Mistral | mistral | chat.mistral.ai | | Copilot | copilot | copilot.microsoft.com | | Kagi | kagi | kagi.com | | Google AI Studio | google | aistudio.google.com |

Configuration

After running init, you'll have an askai.json:

{
  "typescript": true,
  "srcDir": "src",
  "utilsPath": "./src/lib/askai",
  "componentsPath": "./src/components/askai"
}

Customization

Since you own the code, you can:

  • Add your own AI services
  • Change the button styles
  • Modify the URL building logic
  • Add analytics/tracking
  • Integrate with your design system

Example - add a new AI service:

// In src/lib/askai.ts
export const services = {
  // ... existing services
  myai: {
    name: 'My AI',
    url: 'https://myai.com',
    buildUrl: (prompt) => `https://myai.com/chat?q=${encodeURIComponent(prompt)}`,
  },
};

Why askai?

  • Zero runtime dependencies - Code is copied to your project
  • Full control - Customize everything
  • Type-safe - Full TypeScript support
  • 10 AI services - ChatGPT, Claude, Gemini, and more
  • Framework agnostic - Works with React, Next.js, Remix, etc.

Examples

Code Explainer

function CodeBlock({ code, language }) {
  return (
    <div>
      <pre>{code}</pre>
      <AskAIDropdown
        goal={`Explain this ${language} code`}
        content={code}
        services={['chatgpt', 'claude']}
      />
    </div>
  );
}

Documentation Helper

function DocPage({ content }) {
  return (
    <article>
      {content}
      <AskAIButton
        service="perplexity"
        goal="Find more information about"
        content={content}
      >
        Research More
      </AskAIButton>
    </article>
  );
}

Error Assistant

function ErrorBoundary({ error }) {
  return (
    <div>
      <p>Something went wrong</p>
      <AskAIButton
        service="chatgpt"
        goal="Help me fix this error"
        content={error.stack}
      >
        Ask AI for Help
      </AskAIButton>
    </div>
  );
}

License

MIT