I Have a Perplexity Pro Subscription. I Want to Turn it into a Terminal AI Like Claude Code
How I found an open-source repo that unlocked my 1-year perplexity subscription into a full-blown CLI chatbot, MCP server, and REST API
I Have a Perplexity Pro Subscription. I Want to Turn it into a Terminal AI Like Claude Code
How I found an open-source repo that unlocked my 1-year perplexity subscription into a full-blown CLI chatbot, MCP server, and REST API
There’s a specific kind of joy that comes from finding a tool that completely changes how you interact with something you already pay for.
For me, that moment happened when I stumbled across a GitHub repository called perplexity-scrape. What started as a curious afternoon experiment ended up reshaping my entire AI workflow, and it all started with a simple question: “Why am I only using Perplexity through a browser?”
A Bit of Background: What Is Perplexity?
Perplexity is an AI-powered search engine and answer engine that provides conversational responses to user queries by reading and synthesizing information from the live web [optus, 2025]
The Pro subscription is around $20/month, and lucky me, I got a 1-year trial.

The Problem with the Browser
Perplexity’s web interface is okay but limited, and if you live in your terminal the way I do, switching to a browser window breaks your flow. You lose context. You lose history. You can’t easily pipe answers into other tools or scripts. I wanted something like Claude Code or Codex CLI, the tools where we can open a terminal, type a question, and get a rich, contextual AI response without ever touching a GUI.
Building the CLI: Turning Perplexity Into a Terminal Companion
After forking the repo, I added a cli.py that brings together everything into a rich interactive experience. Here's what it ended up looking like:

screenshot of perplexity-cli
Starting the CLI
# Basic — starts with the default model (Claude 4.5 Sonnet Thinking)
python3 cli.py
# Pick a specific model
python3 cli.py --model gpt-5.2
# Load MCP tools (e.g., BurpSuite, filesystem access)
python3 cli.py --mcp ./mcp_tools.json
# Resume a previous conversation
python3 cli.py --load ~/.perplexity_cli/sessions/session_20250524.json
# Go incognito (doesn't appear in your Perplexity dashboard)
python3 cli.py --incognito
# Set a custom system prompt
python3 cli.py --system "You are a security researcher. Focus on vulnerability analysis."
Slash Commands Inside the CLI
Once you’re inside the CLI, a full set of slash commands gives you control over every aspect of your session:
/model <name> #Switch AI model mid-conversation
/models #Browse all available models
/mode <name> #Switch between copilot, search, reasoning, writing
/sessions #List all saved sessions
/tools #Show connected MCP tools
/status #Session info at a glance
The MCP Integrations
By providing a mcp_tools.json config file, you can connect the CLI to any MCP-compatible tool server, and the AI model will automatically use them when relevant.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
},
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
Then start the CLI with:
python3 cli.py --mcp ./mcp_tools.json
Now, when you ask “list the files in my project directory,” the model doesn’t just answer generically; it actually calls the filesystem tool and returns real results from your machine.

Screenshot of MCP tools integration with Perplexity-cli
Setting It Up: 10 Minutes to Your Own (perplexity) AI Terminal
1. Clone the repo :
git clone https://github.com/mrdzer0/perplexity-scrape.git
cd perplexity-scrape
git switch mcp-cli-enh
pip install -r requirements.txt
2. Get your Perplexity session token:
Log into Perplexity in your browser, then open DevTools → Application → Cookies → find perplexity.ai → copy the __Secure-next-auth.session-token value.
3. Create your .env file:
PERPLEXITY_SESSION_TOKEN=your_token_here
4. Launch:
# Interactive CLI
python3 cli.py
# Or the full unified server (REST API + MCP HTTP)
python unified_service.py
That’s it. Now I’m running Frontier AI models from the terminal using a subscription that I get from Perplexity.

Last but not least, enjoy the vibe coding :)
Tags: #AI #Perplexity #CLI #MCP #OpenSource #Terminal #Python #DeveloperTools #LLM
메타데이터
- post_id
- b103e3868d35
- slug
- i-have-a-perplexity-pro-subscription-i-want-to-turn-it-into-a-terminal-ai-like-claude-code-b103e3868d35
- url
- https://medium.com/@barengsinau45/i-have-a-perplexity-pro-subscription-i-want-to-turn-it-into-a-terminal-ai-like-claude-code-b103e3868d35
- canonical_url
- https://medium.com/@barengsinau45/i-have-a-perplexity-pro-subscription-i-want-to-turn-it-into-a-terminal-ai-like-claude-code-b103e3868d35
- author_url
- https://medium.com/@barengsinau45
- status
- ok
- fetched_at
- 2026-06-09 15:37:30