perplexity-local-dev-loop

Featured

Configure Perplexity local development with mocking, testing, and hot reload. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Perplexity Sonar API. Trigger with phrases like "perplexity dev setup", "perplexity local development", "perplexity dev environment", "develop with perplexity", "mock perplexity".

AI & Automation 2,940 stars 439 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Perplexity Local Dev Loop ## Overview Set up a fast, cost-effective local development workflow for Perplexity Sonar API. Key challenge: every real API call performs a web search and costs money, so mocking and caching are essential for development. ## Prerequisites - Completed `perplexity-install-auth` setup - Node.js 18+ with npm/pnpm - `vitest` for testing ## Instructions ### Step 1: Project Structure ``` my-perplexity-project/ ├── src/ │ ├── perplexity/ │ │ ├── client.ts # OpenAI client wrapper for Perplexity │ │ ├── search.ts # Search functions with citation handling │ │ └── types.ts # Response type extensions │ └── index.ts ├── tests/ │ ├── fixtures/ # Saved API responses for mocking │ │ └── sonar-response.json │ ├── perplexity.test.ts │ └── setup.ts ├── .env.local # API key (git-ignored) ├── .env.example # Template └── package.json ``` ### Step 2: Type-Safe Client Wrapper ```typescript // src/perplexity/client.ts import OpenAI from "openai"; export interface PerplexityResponse extends OpenAI.ChatCompletion { citations?: string[]; search_results?: Array<{ title: string; url: string; snippet: string; }>; related_questions?: string[]; } export type PerplexityModel = "sonar" | "sonar-pro" | "sonar-reasoning-pro" | "sonar-deep-research"; export function createClient(apiKey?: string): OpenAI { return new OpenAI({ apiKey: apiKey || process.env.PERPLEXITY_API_KEY, ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category