claude-all-config 2.0.0
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/LICENSE +21 -0
- package/LICENSE.md +70 -0
- package/README.md +133 -0
- package/VERSION +1 -0
- package/agents/accessibility-reviewer.md +96 -0
- package/agents/ai-prompt-optimizer.md +94 -0
- package/agents/api-tester.md +102 -0
- package/agents/code-generator.md +94 -0
- package/agents/code-reviewer.md +47 -0
- package/agents/component-generator.md +102 -0
- package/agents/doc-generator.md +91 -0
- package/agents/migration-generator.md +94 -0
- package/agents/performance-analyzer.md +90 -0
- package/agents/proactive-mode.md +91 -0
- package/agents/readme-generator.md +101 -0
- package/agents/security-auditor.md +86 -0
- package/agents/terraform-generator.md +94 -0
- package/agents/test-generator.md +76 -0
- package/bin/agentrouter.json +36 -0
- package/bin/ai-chat +20 -0
- package/bin/antigravity.json +76 -0
- package/bin/api-manager +340 -0
- package/bin/claude-launcher +19 -0
- package/bin/claude-master +15 -0
- package/bin/claude_master.py +295 -0
- package/bin/cohere.json +7 -0
- package/bin/deepseek.json +44 -0
- package/bin/gemini.json +56 -0
- package/bin/glm.json +21 -0
- package/bin/groq.json +41 -0
- package/bin/minimax.json +26 -0
- package/bin/mistral.json +7 -0
- package/bin/moonshot.json +7 -0
- package/bin/ollama.json +36 -0
- package/bin/openai.json +46 -0
- package/bin/openrouter.json +38 -0
- package/bin/perplexity.json +12 -0
- package/bin/qwen.json +7 -0
- package/bin/switch-provider +73 -0
- package/bin/test.json +7 -0
- package/bin/xai.json +41 -0
- package/claude-all +2707 -0
- package/claude-config.json +340 -0
- package/claude-suite/REFACTORING_SUMMARY.md +88 -0
- package/claude-suite/auth/.antigravity_proxy.py +78 -0
- package/claude-suite/auth/__pycache__/openai_auth.cpython-312.pyc +0 -0
- package/claude-suite/auth/gemini_auth.py +80 -0
- package/claude-suite/auth/openai_auth.py +138 -0
- package/claude-suite/backups/claude-all-before-refactor +1075 -0
- package/claude-suite/backups/claude-all.backup +840 -0
- package/claude-suite/backups/claude-all.original +840 -0
- package/claude-suite/models/add-model-manual.sh +588 -0
- package/claude-suite/models/add-model.sh +114 -0
- package/claude-suite/models/model-switcher.sh +69 -0
- package/claude-suite/providers/claude-glm +89 -0
- package/claude-suite/providers/claude-glm-wrapper.sh +55 -0
- package/claude-suite/providers/claude-minimax +12 -0
- package/claude-suite/providers/claude-smart +132 -0
- package/claude-suite/providers/xai_chat.sh +56 -0
- package/claude-suite/utils/__pycache__/claude_master.cpython-312.pyc +0 -0
- package/claude-suite/utils/antigravity_proxy_server.py +168 -0
- package/claude-suite/utils/claude-all-help.txt +83 -0
- package/claude-suite/utils/claude_master.py +408 -0
- package/commands/brainstorm.md +5 -0
- package/commands/execute-plan.md +5 -0
- package/commands/write-plan.md +5 -0
- package/docs/ANTIGRAVITY-SETUP.md +176 -0
- package/docs/AUTH_CREDENTIALS.md +54 -0
- package/docs/NPM-INSTALLATION.md +166 -0
- package/hooks/hooks.json +15 -0
- package/hooks/run-hook.cmd +19 -0
- package/hooks/session-start.sh +52 -0
- package/install.sh +155 -0
- package/mcp.json +34 -0
- package/model/perplexity.json +12 -0
- package/package.json +69 -0
- package/plugins/README.md +47 -0
- package/plugins/installed_plugins.json +317 -0
- package/plugins/known_marketplaces.json +10 -0
- package/plugins/marketplace-info/marketplace.json +517 -0
- package/postinstall.js +100 -0
- package/scripts/antigravity_proxy_server.py +168 -0
- package/scripts/get_gemini_api_key.py +96 -0
- package/scripts/setup_antigravity_auth.py +171 -0
- package/skills/api-development/SKILL.md +11 -0
- package/skills/api-development/openapi/api-documentation.yaml +108 -0
- package/skills/brainstorming/SKILL.md +54 -0
- package/skills/code-quality/SKILL.md +196 -0
- package/skills/condition-based-waiting/SKILL.md +120 -0
- package/skills/condition-based-waiting/example.ts +158 -0
- package/skills/database-development/SKILL.md +11 -0
- package/skills/database-development/migrations/migration.template.sql +49 -0
- package/skills/defense-in-depth/SKILL.md +127 -0
- package/skills/deployment/SKILL.md +11 -0
- package/skills/deployment/ci-cd/github-actions.yml +95 -0
- package/skills/deployment/docker/Dockerfile.template +39 -0
- package/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/documentation-generation/SKILL.md +8 -0
- package/skills/documentation-generation/templates/README.template.md +60 -0
- package/skills/error-handling/SKILL.md +267 -0
- package/skills/executing-plans/SKILL.md +76 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/frontend-design/frontend-design/SKILL.md +42 -0
- package/skills/integration-testing/SKILL.md +13 -0
- package/skills/integration-testing/examples/contract-test.py +317 -0
- package/skills/integration-testing/examples/e2e-test.js +147 -0
- package/skills/integration-testing/examples/test-isolation.md +94 -0
- package/skills/logging-monitoring/SKILL.md +66 -0
- package/skills/mobile-development/SKILL.md +11 -0
- package/skills/mobile-development/responsive/responsive.css +80 -0
- package/skills/performance-optimization/SKILL.md +9 -0
- package/skills/performance-optimization/profiling/profile.template.js +21 -0
- package/skills/receiving-code-review/SKILL.md +209 -0
- package/skills/refactoring/SKILL.md +11 -0
- package/skills/refactoring/code-smells/common-smells.md +115 -0
- package/skills/requesting-code-review/SKILL.md +105 -0
- package/skills/requesting-code-review/code-reviewer.md +146 -0
- package/skills/root-cause-tracing/SKILL.md +174 -0
- package/skills/root-cause-tracing/find-polluter.sh +63 -0
- package/skills/security-review/SKILL.md +11 -0
- package/skills/security-review/checklists/owasp-checklist.md +31 -0
- package/skills/sharing-skills/SKILL.md +194 -0
- package/skills/subagent-driven-development/SKILL.md +240 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +295 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +364 -0
- package/skills/testing-anti-patterns/SKILL.md +302 -0
- package/skills/testing-skills-with-subagents/SKILL.md +387 -0
- package/skills/testing-skills-with-subagents/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/ui-ux-review/SKILL.md +13 -0
- package/skills/ui-ux-review/checklists/ux-heuristics.md +61 -0
- package/skills/using-git-worktrees/SKILL.md +213 -0
- package/skills/using-superpowers/SKILL.md +101 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/writing-plans/SKILL.md +116 -0
- package/skills/writing-skills/SKILL.md +622 -0
- package/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/persuasion-principles.md +187 -0
- package/update.sh +36 -0
- package/utils/check-superpowers.sh +114 -0
- package/utils/claude-branding.md +166 -0
- package/utils/config.js +185 -0
- package/utils/custom-claude-config.sh +89 -0
- package/utils/custom-claude-hooks.md +129 -0
- package/utils/custom-claude-lib.js +222 -0
- package/utils/customize-claude-ui.sh +162 -0
- package/utils/fix-claude-integration.sh +133 -0
- package/utils/help.js +125 -0
- package/utils/install-curl.ps1 +135 -0
- package/utils/install-curl.sh +525 -0
- package/utils/install-superpowers.js +411 -0
- package/utils/install.js +298 -0
- package/utils/install.sh +182 -0
- package/utils/postinstall.js +63 -0
- package/utils/rename-claude.sh +96 -0
- package/utils/uninstall-superpowers.js +273 -0
- package/utils/uninstall.ps1 +136 -0
- package/utils/uninstall.sh +163 -0
- package/utils/update.sh +160 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
import json
|
|
5
|
+
import subprocess
|
|
6
|
+
import time
|
|
7
|
+
import signal
|
|
8
|
+
import shutil
|
|
9
|
+
import platform
|
|
10
|
+
import glob
|
|
11
|
+
|
|
12
|
+
# Constants
|
|
13
|
+
CONFIG_DIR = os.path.expanduser("~/.config/claude-master")
|
|
14
|
+
CONFIG_FILE = os.path.join(CONFIG_DIR, "config.json")
|
|
15
|
+
LITELLM_PORT = 8555
|
|
16
|
+
LITELLM_HOST = f"http://127.0.0.1:{LITELLM_PORT}"
|
|
17
|
+
CLAUDE_SESSIONS_DIR = os.path.expanduser("~/.claude/sessions") # Standard claude-code session path
|
|
18
|
+
|
|
19
|
+
# Colors
|
|
20
|
+
class Colors:
|
|
21
|
+
HEADER = '\033[95m'
|
|
22
|
+
BLUE = '\033[94m'
|
|
23
|
+
CYAN = '\033[96m'
|
|
24
|
+
GREEN = '\033[92m'
|
|
25
|
+
WARNING = '\033[93m'
|
|
26
|
+
FAIL = '\033[91m'
|
|
27
|
+
ENDC = '\033[0m'
|
|
28
|
+
BOLD = '\033[1m'
|
|
29
|
+
|
|
30
|
+
def clear_screen():
|
|
31
|
+
os.system('cls' if os.name == 'nt' else 'clear')
|
|
32
|
+
|
|
33
|
+
def ensure_config():
|
|
34
|
+
if not os.path.exists(CONFIG_DIR):
|
|
35
|
+
os.makedirs(CONFIG_DIR)
|
|
36
|
+
if not os.path.exists(CONFIG_FILE):
|
|
37
|
+
default_config = {
|
|
38
|
+
"default_provider": None,
|
|
39
|
+
"api_keys": {},
|
|
40
|
+
"system_prompt": None,
|
|
41
|
+
"last_model": {}
|
|
42
|
+
}
|
|
43
|
+
save_config(default_config)
|
|
44
|
+
|
|
45
|
+
def load_config():
|
|
46
|
+
ensure_config()
|
|
47
|
+
with open(CONFIG_FILE, 'r') as f:
|
|
48
|
+
return json.load(f)
|
|
49
|
+
|
|
50
|
+
def save_config(config):
|
|
51
|
+
with open(CONFIG_FILE, 'w') as f:
|
|
52
|
+
json.dump(config, f, indent=4)
|
|
53
|
+
|
|
54
|
+
def check_dependencies():
|
|
55
|
+
"""Check and install required dependencies with proper error handling"""
|
|
56
|
+
missing = []
|
|
57
|
+
installation_errors = []
|
|
58
|
+
|
|
59
|
+
# Check for npm
|
|
60
|
+
if not shutil.which("npm"):
|
|
61
|
+
missing.append("npm")
|
|
62
|
+
|
|
63
|
+
# Check for claude-code CLI
|
|
64
|
+
if not shutil.which("claude"):
|
|
65
|
+
print(f"{Colors.WARNING}claude-code not found. Attempting to install...{Colors.ENDC}")
|
|
66
|
+
try:
|
|
67
|
+
result = subprocess.run(["npm", "install", "-g", "@anthropic-ai/claude-code"],
|
|
68
|
+
capture_output=True, text=True, check=True)
|
|
69
|
+
print(f"{Colors.GREEN}✓ claude-code installed successfully{Colors.ENDC}")
|
|
70
|
+
except subprocess.CalledProcessError as e:
|
|
71
|
+
error_msg = f"Failed to install claude-code: {e.stderr}"
|
|
72
|
+
print(f"{Colors.FAIL}{error_msg}{Colors.ENDC}")
|
|
73
|
+
installation_errors.append(error_msg)
|
|
74
|
+
|
|
75
|
+
# Check and install Python dependencies
|
|
76
|
+
try:
|
|
77
|
+
import litellm
|
|
78
|
+
print(f"{Colors.GREEN}✓ litellm is available{Colors.ENDC}")
|
|
79
|
+
except ImportError:
|
|
80
|
+
print(f"{Colors.WARNING}litellm not found. Attempting to install...{Colors.ENDC}")
|
|
81
|
+
try:
|
|
82
|
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "litellm[proxy]"],
|
|
83
|
+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
84
|
+
print(f"{Colors.GREEN}✓ litellm installed successfully{Colors.ENDC}")
|
|
85
|
+
except subprocess.CalledProcessError as e:
|
|
86
|
+
error_msg = f"Failed to install litellm: {e}"
|
|
87
|
+
print(f"{Colors.FAIL}{error_msg}{Colors.ENDC}")
|
|
88
|
+
installation_errors.append(error_msg)
|
|
89
|
+
|
|
90
|
+
# Report critical issues
|
|
91
|
+
if missing:
|
|
92
|
+
print(f"{Colors.FAIL}Critical: Missing system dependencies: {', '.join(missing)}{Colors.ENDC}")
|
|
93
|
+
print("Please install the missing packages and try again.")
|
|
94
|
+
sys.exit(1)
|
|
95
|
+
|
|
96
|
+
if installation_errors:
|
|
97
|
+
print(f"{Colors.WARNING}Some installations failed. The program may not work correctly.{Colors.ENDC}")
|
|
98
|
+
for error in installation_errors:
|
|
99
|
+
print(f" - {error}")
|
|
100
|
+
|
|
101
|
+
def get_ollama_models():
|
|
102
|
+
"""Detect local ollama models"""
|
|
103
|
+
if not shutil.which("ollama"):
|
|
104
|
+
return []
|
|
105
|
+
try:
|
|
106
|
+
result = subprocess.run(["ollama", "list"], capture_output=True, text=True)
|
|
107
|
+
lines = result.stdout.strip().split('\n')[1:] # Skip header
|
|
108
|
+
models = [line.split()[0] for line in lines if line]
|
|
109
|
+
return models
|
|
110
|
+
except:
|
|
111
|
+
return []
|
|
112
|
+
|
|
113
|
+
def start_litellm(model_name, env_vars={}):
|
|
114
|
+
"""Starts LiteLLM proxy in background"""
|
|
115
|
+
print(f"{Colors.BLUE}Starting LiteLLM proxy for {model_name}...{Colors.ENDC}")
|
|
116
|
+
|
|
117
|
+
# Kill existing
|
|
118
|
+
subprocess.run(f"fuser -k {LITELLM_PORT}/tcp > /dev/null 2>&1", shell=True)
|
|
119
|
+
|
|
120
|
+
cmd = [sys.executable, "-m", "litellm", "--model", model_name, "--port", str(LITELLM_PORT), "--drop_params"]
|
|
121
|
+
|
|
122
|
+
# Merge current env with new vars
|
|
123
|
+
current_env = os.environ.copy()
|
|
124
|
+
current_env.update(env_vars)
|
|
125
|
+
|
|
126
|
+
process = subprocess.Popen(cmd, env=current_env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
127
|
+
|
|
128
|
+
# Wait for health check
|
|
129
|
+
print("Waiting for proxy...", end="", flush=True)
|
|
130
|
+
for _ in range(15):
|
|
131
|
+
try:
|
|
132
|
+
subprocess.check_call(["curl", "-s", f"{LITELLM_HOST}/health"], stdout=subprocess.DEVNULL)
|
|
133
|
+
print(f" {Colors.GREEN}Ready!{Colors.ENDC}")
|
|
134
|
+
return process
|
|
135
|
+
except:
|
|
136
|
+
time.sleep(1)
|
|
137
|
+
print(".", end="", flush=True)
|
|
138
|
+
|
|
139
|
+
print(f"\n{Colors.FAIL}LiteLLM failed to start.{Colors.ENDC}")
|
|
140
|
+
process.kill()
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
def run_claude(proxy_pid=None, session_id=None, system_prompt=None):
|
|
144
|
+
"""Runs the main claude CLI"""
|
|
145
|
+
env = os.environ.copy()
|
|
146
|
+
env["ANTHROPIC_BASE_URL"] = LITELLM_HOST
|
|
147
|
+
env["ANTHROPIC_API_KEY"] = "sk-litellm-proxy"
|
|
148
|
+
env["ANTHROPIC_MODEL"] = "claude-3-sonnet-20240229" # Dummy
|
|
149
|
+
|
|
150
|
+
cmd = ["claude"]
|
|
151
|
+
|
|
152
|
+
if session_id:
|
|
153
|
+
cmd.extend(["--resume", session_id])
|
|
154
|
+
|
|
155
|
+
if system_prompt:
|
|
156
|
+
cmd.extend(["--system-prompt", system_prompt])
|
|
157
|
+
|
|
158
|
+
try:
|
|
159
|
+
subprocess.run(cmd, env=env)
|
|
160
|
+
except KeyboardInterrupt:
|
|
161
|
+
pass
|
|
162
|
+
finally:
|
|
163
|
+
if proxy_pid:
|
|
164
|
+
print(f"\n{Colors.BLUE}Stopping proxy...{Colors.ENDC}")
|
|
165
|
+
proxy_pid.kill()
|
|
166
|
+
|
|
167
|
+
def menu_provider_selection(config):
|
|
168
|
+
providers = [
|
|
169
|
+
"Google Gemini",
|
|
170
|
+
"OpenAI",
|
|
171
|
+
"MiniMax (Direct)",
|
|
172
|
+
"Groq",
|
|
173
|
+
"ZhipuAI (GLM)",
|
|
174
|
+
"Ollama (Local)",
|
|
175
|
+
"Custom"
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
print(f"\n{Colors.HEADER}Select Provider:{Colors.ENDC}")
|
|
179
|
+
for i, p in enumerate(providers):
|
|
180
|
+
print(f"{i+1}) {p}")
|
|
181
|
+
|
|
182
|
+
try:
|
|
183
|
+
choice = int(input("\nChoice: ")) - 1
|
|
184
|
+
if 0 <= choice < len(providers):
|
|
185
|
+
return providers[choice]
|
|
186
|
+
except:
|
|
187
|
+
pass
|
|
188
|
+
return None
|
|
189
|
+
|
|
190
|
+
def configure_provider(provider, config):
|
|
191
|
+
env_vars = {}
|
|
192
|
+
model_name = ""
|
|
193
|
+
|
|
194
|
+
if provider == "Google Gemini":
|
|
195
|
+
key = config["api_keys"].get("GEMINI_API_KEY")
|
|
196
|
+
if not key:
|
|
197
|
+
print("Get Key: https://aistudio.google.com/app/apikey")
|
|
198
|
+
key = input("Enter Gemini API Key: ").strip()
|
|
199
|
+
config["api_keys"]["GEMINI_API_KEY"] = key
|
|
200
|
+
save_config(config)
|
|
201
|
+
env_vars["GEMINI_API_KEY"] = key
|
|
202
|
+
model_name = input("Model [default: gemini/gemini-1.5-flash]: ").strip() or "gemini/gemini-1.5-flash"
|
|
203
|
+
|
|
204
|
+
elif provider == "OpenAI":
|
|
205
|
+
key = config["api_keys"].get("OPENAI_API_KEY")
|
|
206
|
+
if not key:
|
|
207
|
+
print("Get Key: https://platform.openai.com/api-keys")
|
|
208
|
+
key = input("Enter OpenAI API Key: ").strip()
|
|
209
|
+
config["api_keys"]["OPENAI_API_KEY"] = key
|
|
210
|
+
save_config(config)
|
|
211
|
+
env_vars["OPENAI_API_KEY"] = key
|
|
212
|
+
model_name = input("Model [default: gpt-4o]: ").strip() or "gpt-4o"
|
|
213
|
+
|
|
214
|
+
elif provider == "Groq":
|
|
215
|
+
key = config["api_keys"].get("GROQ_API_KEY")
|
|
216
|
+
if not key:
|
|
217
|
+
key = input("Enter Groq API Key: ").strip()
|
|
218
|
+
config["api_keys"]["GROQ_API_KEY"] = key
|
|
219
|
+
save_config(config)
|
|
220
|
+
env_vars["GROQ_API_KEY"] = key
|
|
221
|
+
model_name = "groq/llama3-70b-8192"
|
|
222
|
+
|
|
223
|
+
elif provider == "Ollama (Local)":
|
|
224
|
+
models = get_ollama_models()
|
|
225
|
+
if models:
|
|
226
|
+
print("\nDetected Ollama Models:")
|
|
227
|
+
for i, m in enumerate(models):
|
|
228
|
+
print(f"{i+1}) {m}")
|
|
229
|
+
idx = int(input("Select model: ")) - 1
|
|
230
|
+
model_name = f"ollama/{models[idx]}"
|
|
231
|
+
else:
|
|
232
|
+
print(f"{Colors.WARNING}No models detected or Ollama not running.{Colors.ENDC}")
|
|
233
|
+
model_name = "ollama/llama3"
|
|
234
|
+
|
|
235
|
+
elif provider == "Custom":
|
|
236
|
+
model_name = input("Enter LiteLLM model string (e.g. azure/gpt-4): ")
|
|
237
|
+
|
|
238
|
+
elif provider == "MiniMax (Direct)":
|
|
239
|
+
# MiniMax uses direct endpoint for better performance and reliability
|
|
240
|
+
key = config["api_keys"].get("MINIMAX_API_KEY")
|
|
241
|
+
if not key:
|
|
242
|
+
print(f"{Colors.BLUE}Enter MiniMax API Key:{Colors.ENDC}")
|
|
243
|
+
print("Get it from: https://platform.minimax.io/")
|
|
244
|
+
key = input("API Key: ").strip()
|
|
245
|
+
if not key:
|
|
246
|
+
print(f"{Colors.FAIL}Error: API key is required{Colors.ENDC}")
|
|
247
|
+
return None, None
|
|
248
|
+
config["api_keys"]["MINIMAX_API_KEY"] = key
|
|
249
|
+
save_config(config)
|
|
250
|
+
|
|
251
|
+
# Set up environment for direct execution
|
|
252
|
+
os.environ["ANTHROPIC_BASE_URL"] = "https://api.minimax.io/anthropic"
|
|
253
|
+
os.environ["ANTHROPIC_API_KEY"] = key
|
|
254
|
+
|
|
255
|
+
try:
|
|
256
|
+
print(f"{Colors.GREEN}Connecting to MiniMax directly...{Colors.ENDC}")
|
|
257
|
+
result = subprocess.run(["claude"], check=True)
|
|
258
|
+
return None, None # Signal successful direct execution
|
|
259
|
+
except subprocess.CalledProcessError as e:
|
|
260
|
+
print(f"{Colors.FAIL}Error running claude: {e}{Colors.ENDC}")
|
|
261
|
+
return None, None
|
|
262
|
+
except FileNotFoundError:
|
|
263
|
+
print(f"{Colors.FAIL}Error: 'claude' command not found. Please install Claude Code CLI.{Colors.ENDC}")
|
|
264
|
+
return None, None
|
|
265
|
+
|
|
266
|
+
return model_name, env_vars
|
|
267
|
+
|
|
268
|
+
def doctor():
|
|
269
|
+
print(f"\n{Colors.HEADER}Running Diagnostics...{Colors.ENDC}")
|
|
270
|
+
print("1. Checking System...")
|
|
271
|
+
print(f" OS: {platform.system()} {platform.release()}")
|
|
272
|
+
print(f" Python: {sys.version.split()[0]}")
|
|
273
|
+
|
|
274
|
+
print("\n2. Checking Dependencies...")
|
|
275
|
+
for cmd in ["npm", "claude", "python3", "pip", "git", "ollama", "gcloud"]:
|
|
276
|
+
found = shutil.which(cmd)
|
|
277
|
+
status = f"{Colors.GREEN}OK{Colors.ENDC}" if found else f"{Colors.FAIL}Missing{Colors.ENDC}"
|
|
278
|
+
print(f" {cmd}: {status}")
|
|
279
|
+
|
|
280
|
+
print("\n3. Checking Termux Specifics...")
|
|
281
|
+
if "ANDROID_ROOT" in os.environ:
|
|
282
|
+
print(" Running in Termux environment.")
|
|
283
|
+
try:
|
|
284
|
+
import cryptography
|
|
285
|
+
print(f" Cryptography Lib: {Colors.GREEN}OK{Colors.ENDC}")
|
|
286
|
+
except ImportError:
|
|
287
|
+
print(f" Cryptography Lib: {Colors.FAIL}Missing/Broken{Colors.ENDC}")
|
|
288
|
+
print(f" {Colors.YELLOW}Tip: Run 'pkg install rust binutils libffi openssl build-essential'{Colors.ENDC}")
|
|
289
|
+
|
|
290
|
+
def list_sessions():
|
|
291
|
+
if not os.path.exists(CLAUDE_SESSIONS_DIR):
|
|
292
|
+
print("No sessions found.")
|
|
293
|
+
return None
|
|
294
|
+
|
|
295
|
+
# Simple logic: list folders in session dir
|
|
296
|
+
sessions = sorted(glob.glob(os.path.join(CLAUDE_SESSIONS_DIR, "*")), key=os.path.getmtime, reverse=True)
|
|
297
|
+
if not sessions:
|
|
298
|
+
print("No sessions found.")
|
|
299
|
+
return None
|
|
300
|
+
|
|
301
|
+
print(f"\n{Colors.HEADER}Recent Sessions:{Colors.ENDC}")
|
|
302
|
+
display_sessions = []
|
|
303
|
+
for s in sessions[:5]: # Last 5
|
|
304
|
+
sid = os.path.basename(s)
|
|
305
|
+
display_sessions.append(sid)
|
|
306
|
+
print(f"{len(display_sessions)}) {sid}")
|
|
307
|
+
|
|
308
|
+
try:
|
|
309
|
+
choice = int(input("Select session to resume (0 to cancel): "))
|
|
310
|
+
if choice > 0 and choice <= len(display_sessions):
|
|
311
|
+
return display_sessions[choice-1]
|
|
312
|
+
except:
|
|
313
|
+
pass
|
|
314
|
+
return None
|
|
315
|
+
|
|
316
|
+
def main():
|
|
317
|
+
check_dependencies()
|
|
318
|
+
config = load_config()
|
|
319
|
+
|
|
320
|
+
while True:
|
|
321
|
+
clear_screen()
|
|
322
|
+
print(f"{Colors.HEADER}╔════════════════════════════════════════╗{Colors.ENDC}")
|
|
323
|
+
print(f"{Colors.HEADER}║ CLAUDE MASTER CLI ║{Colors.ENDC}")
|
|
324
|
+
print(f"{Colors.HEADER}╚════════════════════════════════════════╝{Colors.ENDC}")
|
|
325
|
+
print("1. New Chat (Select Provider)")
|
|
326
|
+
print("2. Resume Last Session")
|
|
327
|
+
print("3. List Past Sessions")
|
|
328
|
+
print("4. Settings (Keys & Prompts)")
|
|
329
|
+
print("5. Doctor (Fix Issues)")
|
|
330
|
+
print("6. Exit")
|
|
331
|
+
|
|
332
|
+
choice = input(f"\n{Colors.BOLD}Select Option: {Colors.ENDC}")
|
|
333
|
+
|
|
334
|
+
if choice == "1":
|
|
335
|
+
provider = menu_provider_selection(config)
|
|
336
|
+
if provider:
|
|
337
|
+
model, env = configure_provider(provider, config)
|
|
338
|
+
if model: # If None, it means it was handled internally (MiniMax)
|
|
339
|
+
proc = start_litellm(model, env)
|
|
340
|
+
if proc:
|
|
341
|
+
run_claude(proc, system_prompt=config.get("system_prompt"))
|
|
342
|
+
input("\nPress Enter to return to menu...")
|
|
343
|
+
|
|
344
|
+
elif choice == "2":
|
|
345
|
+
# Resume functionality needs session ID logic from claude-code
|
|
346
|
+
# Since we can't easily get 'last' without parsing, we'll try running claude --resume
|
|
347
|
+
# which usually prompts interactively.
|
|
348
|
+
# But we need the proxy running FIRST.
|
|
349
|
+
# We need to know WHICH provider was used last.
|
|
350
|
+
print(f"{Colors.YELLOW}Resuming requires starting the AI Provider first.{Colors.ENDC}")
|
|
351
|
+
provider = menu_provider_selection(config)
|
|
352
|
+
if provider:
|
|
353
|
+
model, env = configure_provider(provider, config)
|
|
354
|
+
if model:
|
|
355
|
+
proc = start_litellm(model, env)
|
|
356
|
+
if proc:
|
|
357
|
+
# Pass --resume flag only
|
|
358
|
+
env = os.environ.copy()
|
|
359
|
+
env["ANTHROPIC_BASE_URL"] = LITELLM_HOST
|
|
360
|
+
env["ANTHROPIC_API_KEY"] = "sk-litellm-proxy"
|
|
361
|
+
env["ANTHROPIC_MODEL"] = "claude-3-sonnet-20240229"
|
|
362
|
+
try:
|
|
363
|
+
print("Launching Claude in Resume mode...")
|
|
364
|
+
# claude --resume interactive picker
|
|
365
|
+
subprocess.run(["claude", "--resume"], env=env)
|
|
366
|
+
finally:
|
|
367
|
+
proc.kill()
|
|
368
|
+
|
|
369
|
+
elif choice == "3":
|
|
370
|
+
sid = list_sessions()
|
|
371
|
+
if sid:
|
|
372
|
+
print(f"Resuming {sid}...")
|
|
373
|
+
# Same logic: need provider first
|
|
374
|
+
provider = menu_provider_selection(config)
|
|
375
|
+
if provider:
|
|
376
|
+
model, env = configure_provider(provider, config)
|
|
377
|
+
if model:
|
|
378
|
+
proc = start_litellm(model, env)
|
|
379
|
+
if proc:
|
|
380
|
+
run_claude(proc, session_id=sid)
|
|
381
|
+
|
|
382
|
+
elif choice == "4":
|
|
383
|
+
print(f"\n{Colors.HEADER}Settings{Colors.ENDC}")
|
|
384
|
+
print("1. Set System Prompt (Persona)")
|
|
385
|
+
print("2. Clear API Keys")
|
|
386
|
+
sc = input("Choice: ")
|
|
387
|
+
if sc == "1":
|
|
388
|
+
p = input("Enter new System Prompt (Enter to clear): ")
|
|
389
|
+
config["system_prompt"] = p if p.strip() else None
|
|
390
|
+
save_config(config)
|
|
391
|
+
elif sc == "2":
|
|
392
|
+
config["api_keys"] = {}
|
|
393
|
+
save_config(config)
|
|
394
|
+
print("Keys cleared.")
|
|
395
|
+
time.sleep(1)
|
|
396
|
+
|
|
397
|
+
elif choice == "5":
|
|
398
|
+
doctor()
|
|
399
|
+
input("\nPress Enter to continue...")
|
|
400
|
+
|
|
401
|
+
elif choice == "6":
|
|
402
|
+
sys.exit(0)
|
|
403
|
+
|
|
404
|
+
if __name__ == "__main__":
|
|
405
|
+
try:
|
|
406
|
+
main()
|
|
407
|
+
except KeyboardInterrupt:
|
|
408
|
+
print("\nGoodbye!")
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Google AntiGravity Setup Guide
|
|
2
|
+
|
|
3
|
+
**Google AntiGravity** is Google's internal AI service that provides access to experimental and unreleased AI models. This service is only available to Google employees.
|
|
4
|
+
|
|
5
|
+
## 🔐 Requirements
|
|
6
|
+
|
|
7
|
+
- **Google Employee Account** (@google.com)
|
|
8
|
+
- **Connected to Google Network** (Corporate network or VPN)
|
|
9
|
+
- **Python 3** and **jq** installed
|
|
10
|
+
|
|
11
|
+
## 🚀 Quick Setup
|
|
12
|
+
|
|
13
|
+
### Step 1: Run Authentication Script
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 scripts/setup_antigravity_auth.py
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This script will:
|
|
20
|
+
1. Open your browser to Google OAuth
|
|
21
|
+
2. Wait for you to login and approve
|
|
22
|
+
3. Capture the authorization code
|
|
23
|
+
4. Exchange it for an access token
|
|
24
|
+
5. Save credentials automatically
|
|
25
|
+
|
|
26
|
+
### Step 2: Use with Claude-All
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude-all
|
|
30
|
+
# Select option 3 (Google AntiGravity)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 📋 Detailed Setup Process
|
|
34
|
+
|
|
35
|
+
### 1. Prepare Environment
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Install jq if not installed
|
|
39
|
+
# Ubuntu/Debian:
|
|
40
|
+
sudo apt-get install jq
|
|
41
|
+
|
|
42
|
+
# Termux:
|
|
43
|
+
pkg install jq
|
|
44
|
+
|
|
45
|
+
# macOS:
|
|
46
|
+
brew install jq
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Run Setup Script
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cd Claude-All-New
|
|
53
|
+
python3 scripts/setup_antigravity_auth.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The script will display:
|
|
57
|
+
- OAuth URL to open
|
|
58
|
+
- Instructions for each step
|
|
59
|
+
- Progress indicators
|
|
60
|
+
|
|
61
|
+
### 3. Complete OAuth Flow
|
|
62
|
+
|
|
63
|
+
1. **Browser Opens**: Google OAuth page
|
|
64
|
+
2. **Login**: Use your @google.com account
|
|
65
|
+
3. **Approve**: Grant requested permissions
|
|
66
|
+
4. **Redirect**: Back to localhost (handled automatically)
|
|
67
|
+
5. **Success**: Token saved to `~/.config/claude-all/antigravity/`
|
|
68
|
+
|
|
69
|
+
### 4. Verify Setup
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Check if auth file exists
|
|
73
|
+
ls -la ~/.config/claude-all/antigravity/
|
|
74
|
+
|
|
75
|
+
# View saved credentials (formatted)
|
|
76
|
+
cat ~/.config/claude-all/antigravity/google_internal_auth.json | jq
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🎯 Available Models
|
|
80
|
+
|
|
81
|
+
AntiGravity provides access to:
|
|
82
|
+
|
|
83
|
+
- **Gemini 3 Pro Preview** - Latest experimental model
|
|
84
|
+
- **Gemini 2.5 Flash/Pro** - Advanced capabilities
|
|
85
|
+
- **Gemini 2.0 Flash Experimental** - Testing features
|
|
86
|
+
- **Internal Research Models** - Not publicly available
|
|
87
|
+
|
|
88
|
+
## 🔧 Configuration
|
|
89
|
+
|
|
90
|
+
### Auth File Location
|
|
91
|
+
```
|
|
92
|
+
~/.config/claude-all/antigravity/
|
|
93
|
+
└── google_internal_auth.json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Auth File Structure
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"type": "authorized_user",
|
|
100
|
+
"client_id": "YOUR_CLIENT_ID",
|
|
101
|
+
"client_secret": "YOUR_CLIENT_SECRET",
|
|
102
|
+
"access_token": "your-access-token",
|
|
103
|
+
"refresh_token": "your-refresh-token",
|
|
104
|
+
"label": "Google Internal AntiGravity",
|
|
105
|
+
"token_uri": "https://oauth2.googleapis.com/token"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 🚨 Troubleshooting
|
|
110
|
+
|
|
111
|
+
### "Authentication not found"
|
|
112
|
+
```bash
|
|
113
|
+
# Run setup again
|
|
114
|
+
python3 scripts/setup_antigravity_auth.py
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### "Connection failed"
|
|
118
|
+
- Verify VPN connection
|
|
119
|
+
- Check if on Google network
|
|
120
|
+
- Ensure auth file exists
|
|
121
|
+
|
|
122
|
+
### "Token expired"
|
|
123
|
+
The script automatically handles token refresh using the refresh token.
|
|
124
|
+
|
|
125
|
+
### "Permission denied"
|
|
126
|
+
```bash
|
|
127
|
+
chmod +x scripts/setup_antigravity_auth.py
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 🔄 Using with Claude-All
|
|
131
|
+
|
|
132
|
+
### Select Models Interactively
|
|
133
|
+
```bash
|
|
134
|
+
claude-all
|
|
135
|
+
# Option 3 → Select from available models
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Direct Model Selection
|
|
139
|
+
```bash
|
|
140
|
+
# Check available models
|
|
141
|
+
cat model/antigravity.json | jq '.models[] | {name: .name, id: .id}'
|
|
142
|
+
|
|
143
|
+
# Use specific model (if supported)
|
|
144
|
+
claude-all -m gemini-3-pro-preview
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 🔗 API Endpoints
|
|
148
|
+
|
|
149
|
+
- **AntiGravity API**: `https://antigravity.corp.google.com/v1`
|
|
150
|
+
- **Authentication**: Google OAuth 2.0
|
|
151
|
+
- **Token Refresh**: `https://oauth2.googleapis.com/token`
|
|
152
|
+
|
|
153
|
+
## ⚠️ Security Notes
|
|
154
|
+
|
|
155
|
+
- Keep your auth file secure (600 permissions)
|
|
156
|
+
- Don't share credentials
|
|
157
|
+
- Auth files contain refresh tokens
|
|
158
|
+
- Report suspicious activity immediately
|
|
159
|
+
|
|
160
|
+
## 📞 Google Internal Support
|
|
161
|
+
|
|
162
|
+
For Google employees:
|
|
163
|
+
- Internal chat: #antigravity-support
|
|
164
|
+
- Email: antigravity-team@google.com
|
|
165
|
+
- Documentation: Go/antigravity-docs
|
|
166
|
+
|
|
167
|
+
## 🆚 Alternative: Gemini AI Studio
|
|
168
|
+
|
|
169
|
+
If you're not a Google employee:
|
|
170
|
+
- Use option 2 (Gemini AI Studio) instead
|
|
171
|
+
- Get API key from: https://aistudio.google.com/app/apikey
|
|
172
|
+
- Still access to powerful Gemini models
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
**Note**: AntiGravity access is exclusive to Google employees connected to the corporate network.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# AntiGravity Authentication Credentials
|
|
2
|
+
|
|
3
|
+
For Google employees wanting to use AntiGravity (option 3), you have two options:
|
|
4
|
+
|
|
5
|
+
## Option 1: Use CLIProxyAPI (Recommended)
|
|
6
|
+
|
|
7
|
+
If you have CLIProxyAPI installed, you can extract credentials from it:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Get credentials from CLIProxyAPI config
|
|
11
|
+
cliproxy config show
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Or get the CLIProxyAPI client ID and secret from:
|
|
15
|
+
- Your CLIProxyAPI installation directory
|
|
16
|
+
- Google internal documentation
|
|
17
|
+
- Ask the AntiGravity team
|
|
18
|
+
|
|
19
|
+
## Option 2: Get Your Own Credentials
|
|
20
|
+
|
|
21
|
+
1. Go to [Google Cloud Console](https://console.cloud.google.com)
|
|
22
|
+
2. Create a new project or use existing one
|
|
23
|
+
3. Go to "APIs & Services" > "Credentials"
|
|
24
|
+
4. Create "OAuth 2.0 Client ID"
|
|
25
|
+
5. Select "Web application"
|
|
26
|
+
6. Add authorized redirect URI: `http://localhost:8080/callback`
|
|
27
|
+
7. Copy your Client ID and Client Secret
|
|
28
|
+
|
|
29
|
+
## Security Notes
|
|
30
|
+
|
|
31
|
+
These credentials are for Google internal use only:
|
|
32
|
+
- They allow access to Google's internal OAuth flow
|
|
33
|
+
- Used specifically for AntiGravity API authentication
|
|
34
|
+
- Safe to share among Google employees
|
|
35
|
+
- Should not be committed to public repositories (due to automated detection)
|
|
36
|
+
|
|
37
|
+
## Quick Setup for Google Employees
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# 1. Install dependencies
|
|
41
|
+
pkg install jq python3
|
|
42
|
+
|
|
43
|
+
# 2. Run setup script with your credentials
|
|
44
|
+
python3 scripts/setup_antigravity_auth.py
|
|
45
|
+
|
|
46
|
+
# 3. Use with claude-all
|
|
47
|
+
claude-all # Select option 3
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Need Help?
|
|
51
|
+
|
|
52
|
+
For Google employees:
|
|
53
|
+
- Internal chat: #antigravity-support
|
|
54
|
+
- Email: antigravity-team@google.com
|