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

plexcode

v0.1.0

Published

Perplexity AI terminal assistant — CLI coding and research tool

Readme

npm version Node.js License: MIT Playwright PRs Welcome

PlexCode


What is PlexCode?

PlexCode is an open-source terminal UI (TUI) that brings your Perplexity Pro session to the command line. Instead of switching browser tabs, you can search, research, and write code — all without leaving the terminal.

It works by driving Perplexity's web interface via Playwright in headless mode, using your existing login session. No API key, no extra subscription.

⚡ Agentic mode teaches Perplexity to autonomously read your local files before answering — like a lightweight coding assistant that actually knows your codebase.


Features

  • Full Perplexity access — Deep Research, Model Council, Create, Learn modes
  • Model switching — Sonar, Claude Sonnet/Opus, GPT-5.4, Gemini, Nemotron
  • Agentic mode — AI reads local files via whitelisted shell tools (/agent)
  • Session persistence — log in once, runs headless forever after
  • Fast startup — uses your existing Chrome installation to dodge bot detection
  • Zero API cost — your Perplexity Pro session, your data

Quick Start

Install

npm install -g plexcode

First run (browser login)

plexcode

A Chrome window opens. Log in to Perplexity, then press Enter in the terminal. Your session is saved — future runs are fully headless.

One-shot prompt

plexcode "explain the CAP theorem in simple terms"

Slash Commands

| Command | Description | |---------|-------------| | /agent | Toggle agentic mode — AI can read your local files | | /mode | Switch search mode (Deep Research, Create, Learn…) | | /model | Switch AI model | | /new | Start a new conversation | | /help | Show all commands | | /logout | Clear saved session | | /quit | Exit PlexCode |

Keyboard Shortcuts

| Key | Action | |-----|--------| | Enter | Send message | | Escape | Interrupt AI generation | | Ctrl+C | Quit |


Agentic Mode

Type /agent to enable the Shadow Agentic Loop — PlexCode injects a hidden system prompt teaching Perplexity how to request local file reads. As the AI answers your question, it can autonomously run whitelisted commands to gather context:

> /agent
⚡ Agentic mode ON — I can now read your local files.

> what does browser.ts do?
  [⚡ Tool 1/4: ls src/lib/]
  [⚡ Tool 2/4: cat src/lib/browser.ts]
  → Full code-aware explanation

Allowed commands: cat, ls, head, tail, grep, find, wc, pwd, file, tree

Shell injection, pipes, and write-capable commands are blocked.


How It Works

Your prompt
    │
    ▼
PlexCode (Ink TUI)
    │  Playwright (headless Chrome)
    ▼
perplexity.ai  ←──────────────────────────────────────────────┐
    │  Response stream                                          │
    ▼                                                           │
Detect <TOOL> tag?                                             │
    ├── Yes → executeTool() → [Tool Result] message ───────────┘
    └── No  → clean response → display in TUI

PlexCode parses the Perplexity DOM response, intercepts <TOOL> XML tags emitted by the model, executes the command locally (up to 4 iterations), and feeds results back — all without any native function-calling API.


Configuration

Settings are persisted via conf at ~/.config/plexcode/:

| Setting | Description | Default | |---------|-------------|---------| | defaultModel | Model ID on startup | sonar | | defaultMode | Search mode on startup | default |


Requirements

  • Node.js ≥ 18
  • Google Chrome installed locally (recommended — avoids bot detection)
  • A Perplexity Pro account

Development

git clone https://github.com/efekurucay/plexcode
cd plexcode
npm install
npm run dev
npm run build   # compile TypeScript → dist/

Project Structure

src/
├── cli.tsx              # CLI entry point (Commander)
├── app.tsx              # Main React/Ink app
├── types.ts             # Types, models, modes
├── theme.ts             # Color palette
├── components/
│   ├── Header.tsx
│   ├── MessageList.tsx
│   ├── Message.tsx
│   ├── InputArea.tsx
│   ├── Spinner.tsx
│   ├── ModelPicker.tsx
│   ├── ModePicker.tsx
│   └── LoginScreen.tsx
└── lib/
    ├── browser.ts       # Playwright engine + agentic loop
    ├── toolExecutor.ts  # Whitelisted local command runner
    ├── config.ts        # Persistent settings
    └── markdown.ts      # ANSI markdown renderer

Known Limitations

| Limitation | Notes | |------------|-------| | Sequential requests | One request at a time (browser-based) | | Selector fragility | Perplexity UI updates may break DOM parsing | | Long context | Very deep threads may get truncated by Perplexity | | Rate limits | Perplexity's own web rate limits still apply | | ToS | Automating the web UI may violate Perplexity's ToS — personal use only |


Contributing

PRs and issues are welcome! If Perplexity updates their UI and PlexCode breaks, the relevant selectors are in src/lib/browser.ts:

const INPUT_SELECTORS = [
  "[role='textbox']",
  'textarea#ask-input',
  'textarea',
  "[contenteditable='true']",
];

Use Chrome DevTools on perplexity.ai to find updated selectors.


License

MIT © Efe Kurucay