@plexor-dev/claude-code-plugin 0.1.0-beta.19 → 0.1.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/plexor-setup.md +134 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +3 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: First-time setup wizard for Plexor with Claude Code (user)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Plexor Setup Wizard
|
|
6
|
+
|
|
7
|
+
Guide users through first-time Plexor setup, handling both Claude MAX subscribers and API key users.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
**Step 1: Check if already configured**
|
|
12
|
+
|
|
13
|
+
Use the Read tool to check if `~/.plexor/config.json` exists and has valid configuration.
|
|
14
|
+
|
|
15
|
+
If configured, show:
|
|
16
|
+
```
|
|
17
|
+
Plexor Setup
|
|
18
|
+
============
|
|
19
|
+
Already configured!
|
|
20
|
+
|
|
21
|
+
API URL: [apiUrl from config]
|
|
22
|
+
Mode: [mode from config]
|
|
23
|
+
Status: [Enabled/Disabled]
|
|
24
|
+
|
|
25
|
+
Run /plexor-status to see your usage.
|
|
26
|
+
Run /plexor-settings to modify configuration.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Step 2: Ask about Claude MAX subscription**
|
|
30
|
+
|
|
31
|
+
Use the AskUserQuestion tool:
|
|
32
|
+
|
|
33
|
+
Question: "Do you have a Claude MAX subscription (Pro/Team/Enterprise)?"
|
|
34
|
+
Header: "Subscription"
|
|
35
|
+
Options:
|
|
36
|
+
1. **Yes, I have Claude MAX** - I'm already logged into Claude Code with OAuth
|
|
37
|
+
2. **No, I'll use a Plexor API key** - I want to use Plexor's provider routing
|
|
38
|
+
|
|
39
|
+
**Step 3A: Claude MAX User Setup**
|
|
40
|
+
|
|
41
|
+
If user selected "Yes, I have Claude MAX":
|
|
42
|
+
|
|
43
|
+
1. Use the Write tool to create `~/.plexor/config.json`:
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"version": 1,
|
|
47
|
+
"auth": {
|
|
48
|
+
"mode": "oauth_passthrough",
|
|
49
|
+
"authenticated_at": "[current ISO timestamp]"
|
|
50
|
+
},
|
|
51
|
+
"settings": {
|
|
52
|
+
"enabled": true,
|
|
53
|
+
"apiUrl": "https://api.plexor.dev",
|
|
54
|
+
"mode": "balanced",
|
|
55
|
+
"localCacheEnabled": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Show the user:
|
|
61
|
+
```
|
|
62
|
+
Plexor Setup - Claude MAX User
|
|
63
|
+
==============================
|
|
64
|
+
Your Claude MAX subscription will be used with Plexor optimization.
|
|
65
|
+
|
|
66
|
+
Add this to your shell profile (~/.bashrc or ~/.zshrc):
|
|
67
|
+
|
|
68
|
+
export ANTHROPIC_BASE_URL="https://api.plexor.dev/gateway/anthropic"
|
|
69
|
+
|
|
70
|
+
Then restart your terminal or run: source ~/.bashrc
|
|
71
|
+
|
|
72
|
+
How it works:
|
|
73
|
+
- Claude Code sends your OAuth token through Plexor
|
|
74
|
+
- Plexor optimizes prompts and tracks usage
|
|
75
|
+
- You keep your MAX benefits ($0 cost, 20x rate limits)
|
|
76
|
+
|
|
77
|
+
Run /plexor-status to verify setup.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Step 3B: API Key User Setup**
|
|
81
|
+
|
|
82
|
+
If user selected "No, I'll use a Plexor API key":
|
|
83
|
+
|
|
84
|
+
1. Ask for their Plexor API key:
|
|
85
|
+
"Please provide your Plexor API key (starts with 'plx_')."
|
|
86
|
+
"Get one at: https://plexor.dev/dashboard"
|
|
87
|
+
|
|
88
|
+
2. Once they provide the key, use the Write tool to create `~/.plexor/config.json`:
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"version": 1,
|
|
92
|
+
"auth": {
|
|
93
|
+
"api_key": "[user's API key]",
|
|
94
|
+
"mode": "api_key",
|
|
95
|
+
"authenticated_at": "[current ISO timestamp]"
|
|
96
|
+
},
|
|
97
|
+
"settings": {
|
|
98
|
+
"enabled": true,
|
|
99
|
+
"apiUrl": "https://api.plexor.dev",
|
|
100
|
+
"preferred_provider": "auto",
|
|
101
|
+
"mode": "balanced",
|
|
102
|
+
"localCacheEnabled": true
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
3. Show the user:
|
|
108
|
+
```
|
|
109
|
+
Plexor Setup - API Key User
|
|
110
|
+
===========================
|
|
111
|
+
Your Plexor API key has been configured.
|
|
112
|
+
|
|
113
|
+
Add these lines to your shell profile (~/.bashrc or ~/.zshrc):
|
|
114
|
+
|
|
115
|
+
export ANTHROPIC_BASE_URL="https://api.plexor.dev/gateway/anthropic"
|
|
116
|
+
export ANTHROPIC_API_KEY="[their plexor key]"
|
|
117
|
+
|
|
118
|
+
Then restart your terminal or run: source ~/.bashrc
|
|
119
|
+
|
|
120
|
+
How it works:
|
|
121
|
+
- Requests route through Plexor gateway
|
|
122
|
+
- Plexor picks the best provider (can save up to 90%)
|
|
123
|
+
- Your Plexor key goes in ANTHROPIC_API_KEY (this is correct!)
|
|
124
|
+
|
|
125
|
+
Run /plexor-status to verify setup.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Step 4: Offer to auto-configure shell (optional)**
|
|
129
|
+
|
|
130
|
+
Ask: "Would you like me to add this to your shell profile automatically?"
|
|
131
|
+
|
|
132
|
+
If yes, use the Edit tool to append the export lines to `~/.bashrc` (or `~/.zshrc` if it exists).
|
|
133
|
+
|
|
134
|
+
**IMPORTANT**: After completing setup, STOP. Do not run additional commands.
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -121,9 +121,11 @@ function main() {
|
|
|
121
121
|
console.log('');
|
|
122
122
|
console.log(' Next steps:');
|
|
123
123
|
console.log(' 1. Open Claude Code');
|
|
124
|
-
console.log(' 2. Run /plexor-
|
|
124
|
+
console.log(' 2. Run /plexor-setup to configure (handles MAX + API key users)');
|
|
125
125
|
console.log(' 3. Start saving on LLM costs!');
|
|
126
126
|
console.log('');
|
|
127
|
+
console.log(' Have Claude MAX? Just set: export ANTHROPIC_BASE_URL="https://api.plexor.dev/gateway/anthropic"');
|
|
128
|
+
console.log('');
|
|
127
129
|
console.log(' Documentation: https://plexor.dev/docs');
|
|
128
130
|
console.log('');
|
|
129
131
|
|