Available Packages
The primary Plexor Labs CLI tool. Chat with AI models through intelligent routing, analyze code files and directories, and sync Claude MAX OAuth tokens.
Installation
Install the plexr CLI globally using npm to access it from anywhere in your terminal.
npm install -g @plexor-dev/plexr
plexr --version
# Output: plexr v2.0.9
node --version.
plexr CLI Reference
The plexr CLI provides several commands for interacting with Plexor Labs? Labs' AI gateway.
Run plexr --help to see all available commands.
Usage: plexr [options] [command] Options: -V, --version output the version number -h, --help display help for command Commands: prompt Send a prompt to Plexor Labs LLM gateway models List available models usage Show usage statistics sync Sync Claude MAX token to Plexor Labs API status Show current authentication status watch Watch for token changes and sync automatically clear-cache Clear stored credentials help [command] display help for command
Quick Command Reference
| Command | Description |
|---|---|
plexr prompt |
Interactive AI chat with intelligent routing |
plexr models |
List all available AI models (Claude, GPT, DeepSeek, Gemini, Grok, Mistral) |
plexr usage |
Display your API usage statistics and cost savings |
plexr sync |
Sync Claude MAX OAuth token to Plexor Labs |
plexr status |
Show current authentication and connection status |
plexr watch |
Auto-sync tokens when they change |
plexr clear-cache |
Clear stored credentials and cache |
Prompt Command
The prompt command is the primary way to interact with AI models through
Plexor Labs' intelligent routing gateway.
Usage: plexr prompt [options] <text> Send a prompt to Plexor Labs LLM gateway Arguments: text The prompt message (required) Options: -m, --model <model> Model to use (e.g., claude-sonnet-4-20250514) -s, --stream Stream the response -o, --optimize Apply prompt optimization/compression --max-tokens <n> Maximum tokens in response (default: 4096) -t, --temperature <n> Temperature (0.0-1.0, default: 0.7) --system <prompt> System prompt --json Output raw JSON response -f, --file <path> Include file content in prompt for analysis -d, --dir <path> Include directory contents (recursive, max 50 files) -h, --help display help for command
Basic Usage
# Set your API key (one time) export PLEXOR_API_KEY=plx_your_api_key # Send a simple prompt plexr prompt "What is the capital of France?" # Output: Model: deepseek-chat (DeepSeek) | Classification: FACTUAL The capital of France is Paris.
# Enable streaming for real-time output
plexr prompt --stream "Explain quantum computing in simple terms"
# Use a specific model plexr prompt --model claude-sonnet-4-20250514 "Write a haiku about coding" # Use prompt optimization for cost savings plexr prompt --optimize "Explain the theory of relativity in detail" # Add a system prompt for context plexr prompt --system "You are a helpful coding assistant" "How do I sort an array in Python?"
Code Analysis
Use the --file and --dir options to include code in your prompts
for code reviews, bug fixes, refactoring suggestions, and more.
Analyzing a Single File
# Code review plexr prompt --file ./src/utils.ts "Review this code for bugs and improvements" # Find security issues plexr prompt --file ./api/auth.py "Check for security vulnerabilities" # Explain code plexr prompt --file ./lib/parser.js "Explain what this code does" # Suggest optimizations plexr prompt --file ./services/db.go "How can I optimize this for performance?"
Analyzing a Directory
# Analyze entire src directory plexr prompt --dir ./src "Summarize the architecture of this codebase" # Review a component folder plexr prompt --dir ./components/auth "Review this authentication component" # Find patterns plexr prompt --dir ./tests "What testing patterns are used here?"
--dir, files are read recursively up to a reasonable depth.
Binary files, node_modules, and common build directories are automatically excluded.
Very large directories may be truncated to fit within token limits.
Combining File and Prompt
# Use a powerful model for complex code review plexr prompt --model claude-sonnet-4-20250514 --file ./core/engine.py \ "This function is causing memory leaks. Help me find the issue." # Stream code refactoring suggestions plexr prompt --stream --file ./legacy/handler.js \ "Refactor this to use modern async/await patterns"
Token Synchronization
If you have a Claude MAX subscription, you can sync your OAuth token to Plexor Labs to use your existing subscription through Plexor Labs' intelligent routing.
# One-time sync of Claude MAX token plexr sync # Check current sync status plexr status # Watch for token changes and auto-sync plexr watch # Clear cached credentials plexr clear-cache
Configuration
Configure plexr using environment variables or command-line options.
Environment Variables
| Variable | Description | Default |
|---|---|---|
PLEXOR_API_KEY |
Your Plexor Labs API key | None (required) |
PLEXOR_API_URL |
API endpoint URL | https://api.plexor.dev |
# Add to ~/.bashrc or ~/.zshrc export PLEXOR_API_KEY=plx_your_api_key_here # Then reload your shell source ~/.bashrc
Getting Your API Key
To get a Plexor Labs API key:
- Create an account at plexor.dev
- Go to the API Keys page in your dashboard
- Click "Create API Key" and copy the generated key
- Set it as
PLEXOR_API_KEYenvironment variable
Next Steps
- Claude Code Integration - Use Plexor Labs with Claude Code CLI
- HTTP API Reference - Direct API integration
- Dashboard - Monitor your usage and savings
- API Keys - Manage your API keys