@plexor-dev/claude-code-plugin 0.1.0-beta.12 → 0.1.0-beta.13

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.
@@ -12,7 +12,7 @@ Authenticate with your Plexor account to enable LLM cost optimization.
12
12
 
13
13
  Use the Read tool to read `~/.plexor/config.json`.
14
14
 
15
- If the file exists and has an `apiKey` field that starts with "plx_", the user is already authenticated. Show them:
15
+ If the file exists and has `auth.api_key` that starts with "plx_", the user is already authenticated. Show them:
16
16
  ```
17
17
  Plexor Login
18
18
  ============
@@ -35,20 +35,28 @@ Tell them: "Please provide your Plexor API key (starts with 'plx_'):"
35
35
 
36
36
  **Step 3: Save the configuration**
37
37
 
38
- Once the user provides an API key, use the Write tool to create/update `~/.plexor/config.json`:
38
+ Once the user provides an API key (or it was passed as an argument), use the Write tool to create/update `~/.plexor/config.json`:
39
39
 
40
40
  ```json
41
41
  {
42
- "enabled": true,
43
- "apiUrl": "https://api.plexor.dev",
44
- "apiKey": "[user's API key]",
45
- "mode": "balanced",
46
- "preferredProvider": "auto",
47
- "localCacheEnabled": true,
48
- "timeout": 5000
42
+ "version": 1,
43
+ "auth": {
44
+ "api_key": "[user's API key]",
45
+ "authenticated_at": "[current ISO timestamp]"
46
+ },
47
+ "settings": {
48
+ "enabled": true,
49
+ "apiUrl": "https://api.plexor.dev",
50
+ "preferred_provider": "auto",
51
+ "mode": "balanced",
52
+ "localCacheEnabled": true,
53
+ "timeout": 5000
54
+ }
49
55
  }
50
56
  ```
51
57
 
58
+ **IMPORTANT**: If the user provided the API key as an argument (e.g., `/plexor-login plx_abc123`), use that key directly instead of asking for it.
59
+
52
60
  **Step 4: Verify the key works**
53
61
 
54
62
  Make a test request to verify authentication:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexor-dev/claude-code-plugin",
3
- "version": "0.1.0-beta.12",
3
+ "version": "0.1.0-beta.13",
4
4
  "description": "LLM cost optimization plugin for Claude Code - Save up to 90% on AI costs",
5
5
  "main": "lib/constants.js",
6
6
  "scripts": {
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ # Plexor CLI - Claude Code with intelligent optimization
3
+
4
+ # Only show Plexor branding if ANTHROPIC_BASE_URL points to Plexor
5
+ if [[ "$ANTHROPIC_BASE_URL" == *"plexor"* ]]; then
6
+ # Colors
7
+ CYAN='\033[0;36m'
8
+ GREEN='\033[0;32m'
9
+ YELLOW='\033[0;33m'
10
+ DIM='\033[2m'
11
+ NC='\033[0m' # No Color
12
+
13
+ # Plexor ASCII art
14
+ echo -e "${CYAN}"
15
+ cat << 'EOF'
16
+ ____ __
17
+ / __ \/ /__ _ ______ _____
18
+ / /_/ / / _ \| |/_/ __ \/ ___/
19
+ / ____/ / __/> </ /_/ / /
20
+ /_/ /_/\___/_/|_|\____/_/
21
+
22
+ EOF
23
+ echo -e "${NC}"
24
+
25
+ # Show status
26
+ CONFIG_FILE="$HOME/.plexor/config.json"
27
+ if [ -f "$CONFIG_FILE" ]; then
28
+ ENABLED=$(jq -r '.settings.enabled // false' "$CONFIG_FILE" 2>/dev/null)
29
+ MODE=$(jq -r '.settings.mode // "balanced"' "$CONFIG_FILE" 2>/dev/null)
30
+
31
+ if [ "$ENABLED" = "true" ]; then
32
+ echo -e "${GREEN}●${NC} Optimization: ${GREEN}Active${NC} (${MODE} mode)"
33
+ else
34
+ echo -e "${YELLOW}○${NC} Optimization: ${DIM}Disabled${NC}"
35
+ fi
36
+ echo ""
37
+ fi
38
+ fi
39
+
40
+ # Launch claude with all arguments passed through
41
+ exec claude "$@"