---
slug: "pi-producthunt"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/eiei114/pi-producthunt@main/README.md"
repo: "https://github.com/eiei114/pi-producthunt"
source_file: "README.md"
branch: "main"
---
# Pi Product Hunt

[![CI](https://github.com/eiei114/pi-producthunt/actions/workflows/ci.yml/badge.svg)](https://github.com/eiei114/pi-producthunt/actions/workflows/ci.yml)
[![Publish](https://github.com/eiei114/pi-producthunt/actions/workflows/publish.yml/badge.svg)](https://github.com/eiei114/pi-producthunt/actions/workflows/publish.yml)
[![npm version](https://img.shields.io/npm/v/pi-producthunt.svg)](https://www.npmjs.com/package/pi-producthunt)
[![npm downloads](https://img.shields.io/npm/dm/pi-producthunt.svg)](https://www.npmjs.com/package/pi-producthunt)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Pi package](https://img.shields.io/badge/pi-package-purple.svg)](https://pi.dev/packages)
[![Trusted Publishing](https://img.shields.io/badge/npm-Trusted%20Publishing-blue.svg)](docs/release.md)
<a href="https://buymeacoffee.com/ekawano114m"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" width="217" height="60"></a>

> Product Hunt research and digest workflows inside Pi.

## What this is

Pi Product Hunt is a read-only Pi extension package for Product Hunt market research. It calls the Product Hunt GraphQL API directly, adds interactive `/producthunt:*` commands for humans, and exposes structured tools for agents to gather launches, post details, comments, and digest-ready research notes.

## Features

- Daily Product Hunt launch scans.
- Product/post search for competitor and trend research.
- Post detail and comment collection for user-reaction analysis.
- Digest-ready Markdown with sections for signals, reactions, and topic watchlists.
- Compact topic watchlists with bounded rationale for products worth revisiting.
- Bounded markdown product cards for pasting launches into research notes.
- Persistent login that stores your Product Hunt token in the Pi agent directory.
- Agent tools with typed parameters for autonomous Product Hunt research.

## Install

Install the published npm package with Pi:

```bash
pi install npm:pi-producthunt
```

Pin a specific version when you want reproducible installs:

```bash
pi install npm:pi-producthunt@0.3.2
```

Install into the current project instead of your user Pi settings:

```bash
pi install npm:pi-producthunt -l
```

Or install from GitHub:

```bash
pi install git:github.com/eiei114/pi-producthunt
```

Try without installing permanently:

```bash
pi -e npm:pi-producthunt
```

For local development from a checkout:

```bash
pi -e .
```

## Quick start

1. Install the package:

```bash
pi install npm:pi-producthunt
```

2. Authenticate with Product Hunt:

```txt
/producthunt:login
```

3. Fetch today's launches:

```txt
/producthunt:today
```

Or search for a topic:

```txt
/producthunt:search
```

Agents can fetch Product Hunt data directly with typed tools:

```txt
producthunt_get_posts({ limit: 5 })
producthunt_search_posts({ query: "AI coding agent", limit: 10 })
```

## Authentication

Product Hunt access comes from one of two sources:

1. **Environment variable** `PRODUCTHUNT_ACCESS_TOKEN`
2. **Stored login** written by `/producthunt:login` to `~/.pi/agent/pi-producthunt-auth.json`

**Precedence:** when both are set, the environment variable wins. The stored login file is ignored until you unset the environment variable or start Pi without it.

Use the interactive login command:

```txt
/producthunt:login
```

Remove the stored token with:

```txt
/producthunt:logout
```

`/producthunt:logout` only clears the stored login file. It does not change `PRODUCTHUNT_ACCESS_TOKEN` in your shell.

Set a token through the environment when you prefer shell-based configuration:

```bash
export PRODUCTHUNT_ACCESS_TOKEN=...
```

Check auth without exposing secrets:

```txt
/producthunt:status
```

`/producthunt:status` reports the active token source (environment vs stored login), validates the token against the Product Hunt API when possible, and prints concise recovery steps for common failures:

- missing token
- unreadable or invalid stored login file
- rejected or invalid API token
- transient validation errors

Token values are always redacted from status output, logs, and error messages.

## Commands

Commands are human-facing and require no fixed inline arguments. If input is needed, Pi asks interactively.

```txt
/producthunt:status
/producthunt:login
/producthunt:logout
/producthunt:today
/producthunt:search
/producthunt:post
/producthunt:comments
/producthunt:digest
/producthunt:research
/producthunt:watchlist
/producthunt:cards
```

Example flows:

```txt
/producthunt:today      # today's launch list
/producthunt:search     # asks for a search query
/producthunt:post       # asks for slug, ID, or URL
/producthunt:comments   # asks for slug, ID, or URL
/producthunt:digest     # asks for today / yesterday / custom date
/producthunt:research   # asks for a research topic
/producthunt:watchlist  # asks for a topic and returns a compact revisit list
/producthunt:cards      # asks for a topic and returns paste-ready product cards
```

## Agent tools

Agents can call these typed tools directly:

```txt
producthunt_status
producthunt_get_posts
producthunt_search_posts
producthunt_get_post
producthunt_get_post_comments
producthunt_research_topic
producthunt_topic_watchlist
producthunt_research_product_cards
producthunt_digest
```

Examples:

```txt
producthunt_search_posts({ query: "AI coding agent", limit: 10 })
producthunt_get_post({ ref: "example-product-slug" })
producthunt_get_post_comments({ ref: "example-product-slug", limit: 10 })
producthunt_digest({ date: "2026-06-01", limit: 10 })
producthunt_topic_watchlist({ query: "AI coding agent", limit: 5 })
producthunt_research_product_cards({ query: "AI coding agent", limit: 5 })
```

See [`docs/watchlist.md`](https://github.com/eiei114/pi-producthunt/blob/HEAD/docs/watchlist.md) for when to use a watchlist vs a full digest or research pack.
See [`docs/research-pack.md`](https://github.com/eiei114/pi-producthunt/blob/HEAD/docs/research-pack.md) for when to prefer product cards over raw tool output.

## Package contents

| Path | Purpose |
|---|---|
| `extensions/` | Pi extension entrypoint and command/tool registration |
| `lib/` | Product Hunt API client, auth store, formatters, schemas, helpers |
| `docs/` | Release notes, usage examples, and watchlist guidance |

## Development

```bash
npm install
npm run ci
```

`npm run ci` runs:

- TypeScript typecheck
- Node tests
- `npm pack --dry-run`

## Release

This package is set up for npm Trusted Publishing, so no `NPM_TOKEN` is required.

```bash
npm version patch
git push
```

See [`docs/release.md`](https://github.com/eiei114/pi-producthunt/blob/HEAD/docs/release.md) for setup details.

## Security

Pi packages execute with your local permissions. Review source before installing third-party packages.

Product Hunt tokens are never committed by this package. `/producthunt:login` stores the token locally in `~/.pi/agent/pi-producthunt-auth.json`; `/producthunt:logout` deletes that stored file. `PRODUCTHUNT_ACCESS_TOKEN` is never modified by logout.

For vulnerability reporting, see [`SECURITY.md`](https://github.com/eiei114/pi-producthunt/blob/HEAD/SECURITY.md).

## Links

- npm: https://www.npmjs.com/package/pi-producthunt
- GitHub: https://github.com/eiei114/pi-producthunt
- Issues: https://github.com/eiei114/pi-producthunt/issues

## License

MIT
