-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclaude_code_plugin.py
More file actions
52 lines (48 loc) · 2.05 KB
/
Copy pathclaude_code_plugin.py
File metadata and controls
52 lines (48 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""shadow-stack v3 — Claude Code Plugin
Enables /shadow-stack commands inside Claude Code sessions.
Install:
/plugin marketplace add shadowhunter89/shadow-stack
/plugin install shadow-stack
Then inside any Claude Code terminal session:
/shadow-stack scan
/shadow-stack inject --only payments ai auth
/shadow-stack audit
/shadow-stack fix-wiring
/shadow-stack upgrade
/shadow-stack providers
"""
import subprocess, sys
from pathlib import Path
PLUGIN_MANIFEST = {
"name": "shadow-stack",
"version": "3.0.0",
"description": "Inject production modules AI-adapted to your code. BSL Licensed.",
"author": "shadowhunter89",
"homepage": "https://github.com/shadowhunter89/shadow-stack",
"commands": {
"shadow-stack": {
"description": "shadow-stack v3 module injection system",
"subcommands": {
"scan": "Scan project — health score + missing modules",
"inject": "Inject missing modules (AI-adapted to your conventions)",
"upgrade": "Upgrade installed modules to latest version",
"audit": "Security audit of all modules",
"fix-wiring": "Auto-add missing router registrations to main.py",
"sync": "Re-inject modules after git clone",
"list": "List all available modules",
"status": "Show .shadowstack.yml summary",
"install": "Install community module from GitHub",
"providers": "Show AI provider status",
}
}
}
}
def handle_command(command: str, args: list[str], cwd: str) -> str:
cmd = [sys.executable, "-m", "cli.main", command] + args
try:
result = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True, timeout=120)
return result.stdout + (result.stderr if result.returncode != 0 else "")
except subprocess.TimeoutExpired:
return "Error: Command timed out after 120 seconds"
except Exception as e:
return f"Error running shadow-stack: {e}"