AI-Driven Code Assistant — Built for Cursor, VSCode & CLI
NPM Package: perplexity-code
The power of Perplexity, reimagined for developers.
Ask questions. Generate code. Debug. Refactor. All from your favorite terminal or editor.
Perplexity-Code is an open-source, NPM-installable CLI tool for AI-enhanced software development.
It integrates seamlessly with your terminal, Cursor, or VSCode workflow and helps you:
- Search technical topics
- Explain or debug code
- Convert between programming languages
- Refactor and optimize code snippets
Powered by Perplexity (or configurable LLM APIs), this tool turns your terminal into a coding knowledge copilot.
npm install -g perplexity-code
You can now run the CLI using
perplexity-code
orpxc
.
npx perplexity-code "What is the difference between var, let and const?"
pxc "How do I write a GraphQL resolver in Node.js?"
pxc /explain "./src/hooks/useAuth.ts"
pxc /convert "Convert this Python dict to a TypeScript interface"
pxc /debug "Cannot read property 'length' of undefined"
You can also pipe code:
cat main.py | pxc /refactor
Create a .perplexityrc
or perplexity.config.json
in your project or home directory:
{
"apiKey": "sk-XXXXXX",
"model": "perplexity-codellama",
"language": "typescript",
"editor": "vscode"
}
Or pass options via CLI:
pxc "Explain async/await" --model perplexity-codellama --language javascript
- Open Cursor → Settings → Plugins
- Add path to
perplexity-code
binary - Use inline queries like
/explain
or/debug
in the editor
- Native extension with slash commands and inline answers
- Chat-style interface with syntax-aware suggestions
- 💬 Slash-based commands:
/explain
,/debug
,/convert
,/optimize
,/summarize
- 🧠 Context-aware answers with code formatting
- 🧪 Multi-model support (Perplexity, Gemini, OpenAI)
- 📂 File-based input and stdin piping
- 🛠️ Works inside tmux, iterm, Warp, or Cursor
- VSCode extension release
- Git diff-aware prompts (
/review
) - Multi-language translation mode
- Plugins:
/test
,/doc
,/summarize
- Local LLM fallback (offline mode)
We’d love your input, ideas, and PRs. Start with:
git clone https://github.com/holasoymalva/perplexity-code.git
cd perplexity-code
npm install
npm link # for local CLI testing
Want to contribute a command? Check out
/src/commands
.
To publish a new version to NPM:
npm version patch
npm publish
Ensure you are logged in to NPM with correct credentials.
MIT License © 2025 @holasoymalva
- GitHub: https://github.com/holasoymalva/perplexity-code
- NPM: https://npmjs.com/package/perplexity-code
- Twitter: @holasoymalva
Built for the curious. Made for developers. Ready for your terminal. ⚡️