https://github.com/zed-extensions/perplexity
https://github.com/zed-extensions/perplexity
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zed-extensions/perplexity
- Owner: zed-extensions
- License: other
- Created: 2025-07-08T16:18:02.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-12-29T17:30:24.000Z (6 months ago)
- Last Synced: 2026-01-01T22:38:41.114Z (6 months ago)
- Language: Rust
- Size: 26.4 KB
- Stars: 8
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-zed-extensions - Perplexity
README
# Zed Perplexity Extension
This example extension adds the `/perplexity` [slash command](https://zed.dev/docs/assistant/commands) to the Zed AI assistant.
## Usage
Open the AI Assistant panel (`cmd-r` or `ctrl-r`) and enter:
```
/perplexity What's the weather in Boulder, CO tomorrow evening?
```
## Development Setup
1. Install the Rust toolchain and clone the zed repo:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
mkdir -p ~/code
cd ~/code
git clone https://github.com/zed-industries/zed
```
1. Open Zed
1. Open Zed Extensions (`cmd-shift-x` / `ctrl-shift-x`)
1. Click "Install Dev Extension"
1. Navigate to the "extensions/perplexity" folder inside the zed git repo.
1. Ensure your `PERPLEXITY_API_KEY` environment variable is set (instructions below)
```sh
env | grep PERPLEXITY_API_KEY
```
1. Quit and relaunch Zed
## PERPLEXITY_API_KEY
This extension requires a Perplexity API key to be available via the `PERPLEXITY_API_KEY` environment variable.
To obtain a Perplexity.ai API token, login to your Perplexity.ai account and go [Settings->API](https://www.perplexity.ai/settings/api) and under "API Keys" click "Generate". This will require you to have [Perplexity Pro](https://www.perplexity.ai/pro) or to buy API credits. By default the extension uses `sonar`, currently cheapest model available which is $0.008 per request (less than a penny) + a penny per 10,000 tokens. So most requests will cost $0.01 - $0.02 USD.
Take your API key and add it to your environment by adding `export PERPLEXITY_API_KEY="pplx-0123456789abcdef..."` to your `~/.zshrc` or `~/.bashrc`. Reload close and reopen your terminal session. Check with `env |grep PERPLEXITY_API_KEY`.