claude-all-config 3.7.0 → 3.7.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.0
1
+ 3.7.2
package/gemini ADDED
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # gemini — ClaudeAll shim that:
4
+ # 1. Sources ~/.gemini/.env (and ~/.claude/.env as fallback) so MCP servers
5
+ # see CONTEXT7_API_KEY / EXA_API_KEY / Z_AI_API_KEY / TELEGRAM_* / etc.
6
+ # 2. Auto-prepends --yolo (-y) to make Gemini autonomous by default.
7
+ # 3. Forwards all args to the REAL gemini binary further down PATH.
8
+ #
9
+ # Opt out of YOLO for a single run:
10
+ # gemini --no-yolo ...
11
+ # GEMINI_NO_YOLO=1 gemini ...
12
+ #
13
+ # Bypass this shim entirely:
14
+ # command -v gemini -a # see all gemini binaries
15
+ # /usr/local/bin/gemini ... # call the real one directly
16
+
17
+ set -u
18
+
19
+ # ─── Source env files (most-specific first) ───────────────────────────────
20
+ load_env() {
21
+ local f="$1"
22
+ if [ -f "$f" ]; then
23
+ set -a
24
+ # shellcheck disable=SC1090
25
+ . "$f" 2>/dev/null || true
26
+ set +a
27
+ fi
28
+ }
29
+ load_env "$HOME/.claude/.env"
30
+ load_env "$HOME/.gemini/.env"
31
+
32
+ # ─── Find the REAL gemini binary (skip ourselves) ─────────────────────────
33
+ SELF="$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")"
34
+
35
+ REAL_GEMINI=""
36
+ # Walk PATH manually, skipping the shim itself
37
+ IFS=':' read -ra DIRS <<< "$PATH"
38
+ for dir in "${DIRS[@]}"; do
39
+ candidate="$dir/gemini"
40
+ [ -x "$candidate" ] || continue
41
+ candidate_real="$(readlink -f "$candidate" 2>/dev/null || realpath "$candidate" 2>/dev/null || echo "$candidate")"
42
+ # Skip if this is the shim itself
43
+ if [ "$candidate_real" = "$SELF" ]; then
44
+ continue
45
+ fi
46
+ REAL_GEMINI="$candidate"
47
+ break
48
+ done
49
+
50
+ if [ -z "$REAL_GEMINI" ]; then
51
+ echo "❌ ClaudeAll gemini shim: real gemini binary not found in PATH." >&2
52
+ echo " Install: npm install -g @google/gemini-cli" >&2
53
+ echo " (After install, this shim will auto-locate it.)" >&2
54
+ exit 127
55
+ fi
56
+
57
+ # ─── Decide YOLO flag ─────────────────────────────────────────────────────
58
+ USE_YOLO=1
59
+ ARGS=()
60
+ for a in "$@"; do
61
+ case "$a" in
62
+ --no-yolo) USE_YOLO=0 ;;
63
+ -y|--yolo) USE_YOLO=1 ;;
64
+ *) ARGS+=("$a") ;;
65
+ esac
66
+ done
67
+ [ -n "${GEMINI_NO_YOLO:-}" ] && USE_YOLO=0
68
+
69
+ # ─── Exec real gemini ─────────────────────────────────────────────────────
70
+ if [ "$USE_YOLO" = "1" ]; then
71
+ exec "$REAL_GEMINI" --yolo "${ARGS[@]}"
72
+ else
73
+ exec "$REAL_GEMINI" "${ARGS[@]}"
74
+ fi
package/gemini-all ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # gemini-all — Gemini CLI launcher with ClaudeAll superpowers loaded.
4
+ #
5
+ # What it does:
6
+ # 1. Source ~/.gemini/.env (and ~/.claude/.env as fallback) so MCP servers
7
+ # see your CONTEXT7_API_KEY / EXA_API_KEY / Z_AI_API_KEY / etc.
8
+ # 2. Default to YOLO mode (--yolo / -y) for autonomous operation.
9
+ # 3. Pass through all args to gemini.
10
+ #
11
+ # Usage:
12
+ # gemini-all # interactive YOLO session
13
+ # gemini-all "your prompt" # one-shot with prompt
14
+ # gemini-all --no-yolo # disable auto-approve
15
+ # gemini-all -y -- ... # explicit YOLO with extra args
16
+ #
17
+ # Override with env vars:
18
+ # GEMINI_BIN=/path/to/gemini gemini-all
19
+ # GEMINI_NO_YOLO=1 gemini-all # disable yolo for this run
20
+
21
+ set -u
22
+
23
+ # ─── Source env files (most-specific first) ───────────────────────────────
24
+ load_env() {
25
+ local f="$1"
26
+ if [ -f "$f" ]; then
27
+ set -a
28
+ # shellcheck disable=SC1090
29
+ . "$f" 2>/dev/null || true
30
+ set +a
31
+ fi
32
+ }
33
+
34
+ # Gemini-specific overrides take precedence over the shared Claude env.
35
+ load_env "$HOME/.claude/.env"
36
+ load_env "$HOME/.gemini/.env"
37
+
38
+ # ─── Locate gemini binary ─────────────────────────────────────────────────
39
+ GEMINI_CMD="${GEMINI_BIN:-gemini}"
40
+ if ! command -v "$GEMINI_CMD" &>/dev/null; then
41
+ echo "❌ gemini CLI not found in PATH." >&2
42
+ echo " Install: npm install -g @google/gemini-cli" >&2
43
+ echo " Or set GEMINI_BIN=/path/to/gemini" >&2
44
+ exit 127
45
+ fi
46
+
47
+ # ─── YOLO mode (default ON, opt-out with --no-yolo or GEMINI_NO_YOLO=1) ────
48
+ YOLO_FLAG="--yolo"
49
+ ARGS=()
50
+ for a in "$@"; do
51
+ case "$a" in
52
+ --no-yolo) YOLO_FLAG="" ;;
53
+ -y|--yolo) YOLO_FLAG="--yolo" ;;
54
+ *) ARGS+=("$a") ;;
55
+ esac
56
+ done
57
+ [ -n "${GEMINI_NO_YOLO:-}" ] && YOLO_FLAG=""
58
+
59
+ # ─── Show what we loaded (only when verbose) ──────────────────────────────
60
+ if [ -n "${GEMINI_ALL_VERBOSE:-}" ]; then
61
+ echo "🤖 gemini-all"
62
+ echo " Binary: $(command -v "$GEMINI_CMD")"
63
+ echo " YOLO: ${YOLO_FLAG:-OFF}"
64
+ echo " Env: $(printenv | grep -cE '^(CONTEXT7|EXA|Z_AI|MINIMAX|TELEGRAM)_') vars loaded"
65
+ fi
66
+
67
+ # ─── Exec ─────────────────────────────────────────────────────────────────
68
+ if [ -n "$YOLO_FLAG" ]; then
69
+ exec "$GEMINI_CMD" "$YOLO_FLAG" "${ARGS[@]}"
70
+ else
71
+ exec "$GEMINI_CMD" "${ARGS[@]}"
72
+ fi
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "claude-all-config",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "🦾 MONSTER ENGINEER v2 - Ultimate AI CLI with 63 Skills, 12 Superpowers, 14 Agents. Multi-Agent Orchestration, Cost-Aware, Security Scorecard, Parallel-First.",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "claude-all": "./claude-all",
8
8
  "claude-all-skills": "./bin/skills-cli.js",
9
9
  "claude-all-update": "./update.sh",
10
- "claude-all-mcp": "./bin/mcp-install.js"
10
+ "claude-all-mcp": "./bin/mcp-install.js",
11
+ "gemini-all": "./gemini-all"
11
12
  },
12
13
  "scripts": {
13
14
  "postinstall": "node postinstall.js || bash install.sh",
@@ -86,6 +87,8 @@
86
87
  "AGENT.md",
87
88
  "CLAUDE.md",
88
89
  "claude-all",
90
+ "gemini-all",
91
+ "gemini",
89
92
  "install.sh",
90
93
  "install-termux.sh",
91
94
  "install-universal.sh",
package/postinstall.js CHANGED
@@ -278,46 +278,48 @@ function installGemini() {
278
278
  const mcpSrc = path.join(PKG_DIR, 'mcp.json');
279
279
  const mcpDest = path.join(GEMINI_DIR, 'mcp.json');
280
280
  if (fs.existsSync(mcpSrc)) {
281
- fs.copyFileSync(mcpSrc, mcpDest);
282
- fs.chmodSync(mcpDest, 0o600);
283
- console.log(` 🔧 MCP config (7 servers)`);
281
+ try {
282
+ fs.copyFileSync(mcpSrc, mcpDest);
283
+ try { fs.chmodSync(mcpDest, 0o600); } catch {}
284
+ console.log(` 🔧 MCP config (11 servers)`);
285
+ } catch (e) {
286
+ console.log(` ⚠️ MCP config skipped (${e.code || 'error'})`);
287
+ }
288
+ }
289
+
290
+ // .env template for Gemini (same secrets as Claude)
291
+ const envSrc = path.join(PKG_DIR, '.env.example');
292
+ const envDest = path.join(GEMINI_DIR, '.env');
293
+ if (fs.existsSync(envSrc) && !fs.existsSync(envDest)) {
294
+ try {
295
+ fs.copyFileSync(envSrc, envDest);
296
+ try { fs.chmodSync(envDest, 0o600); } catch {}
297
+ console.log(` 🔐 .env template (edit ~/.gemini/.env to set your API keys)`);
298
+ } catch (e) {
299
+ console.log(` ⚠️ .env template skipped (${e.code || 'error'})`);
300
+ }
301
+ } else if (fs.existsSync(envDest)) {
302
+ console.log(` 🔐 .env preserved (already exists)`);
284
303
  }
285
304
 
286
- // GEMINI.md - Global instructions (like CLAUDE.md)
287
- const geminiMd = `# Gemini Superpowers - MONSTER ENGINEER Mode
288
-
289
- You are **MONSTER ENGINEER** - Gemini CLI enhanced with ClaudeAll superpowers.
290
-
291
- ## 👑 Identity: Raja Terakhir (Ultimate Technical Authority)
292
-
293
- You are expert-level in ALL engineering disciplines:
294
- - **Software Engineer** - Architecture, design patterns, clean code, all languages
295
- - **Security Engineer** - Pentesting, hardening, zero-trust, vulnerability assessment
296
- - **DevOps Engineer** - CI/CD, Docker, Kubernetes, infrastructure as code
297
- - **Backend Engineer** - Go, Node.js, Python, Rust, APIs, microservices
298
- - **Frontend Engineer** - React, Svelte, Vue, TypeScript, mobile
299
- - **Cloud Architect** - AWS, GCP, Azure, Oracle, Cloudflare
300
- - **Database Admin** - PostgreSQL, MySQL, Redis, MongoDB, optimization
301
- - **Network Engineer** - VPN, firewalls, DNS, tunnels, load balancing
302
- - **SRE** - Monitoring, alerting, incident response, chaos engineering
303
- - **Mobile Developer** - Flutter, Swift (iOS), Kotlin (Android)
304
-
305
- ## Behavior
306
- 1. **ULTRA Proactive** - Work autonomously, never ask permission
307
- 2. **Direct Execution** - Run commands directly
308
- 3. **Security First** - Never expose credentials, always use Unix sockets over ports
309
- 4. **Expert Authority** - Make technical decisions confidently
310
-
311
- ## Available
312
- - 14 Agents (proactive-mode, code-generator, security-auditor, etc)
313
- - 63 Skills (systematic-debugging, test-driven-development, etc)
314
- - 7 MCP Servers (context7, exa, memory, filesystem, fetch, etc)
315
-
316
- ## Usage
317
- Run with YOLO mode: gemini -y
318
- `;
319
- fs.writeFileSync(path.join(GEMINI_DIR, 'GEMINI.md'), geminiMd);
320
- console.log(` 📄 GEMINI.md (MONSTER ENGINEER mode)`);
305
+ // GEMINI.md - kept in sync with CLAUDE.md (read from package, not hardcoded)
306
+ const claudeMdInPkg = path.join(PKG_DIR, 'CLAUDE.md');
307
+ const geminiMdDest = path.join(GEMINI_DIR, 'GEMINI.md');
308
+ if (fs.existsSync(claudeMdInPkg)) {
309
+ try {
310
+ // Re-title CLAUDE GEMINI but keep all content (single source of truth)
311
+ let content = fs.readFileSync(claudeMdInPkg, 'utf8');
312
+ content = content
313
+ .replace(/# ClaudeAll Global Instructions/, '# Gemini Superpowers (ClaudeAll Global Instructions)')
314
+ .replace(/Claude Code enhanced with ClaudeAll superpowers\./, 'Gemini CLI enhanced with ClaudeAll superpowers.\n\n**YOLO mode**: run `gemini -y` to auto-approve tool calls (configured in settings.json).')
315
+ .replace(/~\/\.claude\//g, '~/.gemini/')
316
+ .replace(/CLAUDE\.md/g, 'GEMINI.md');
317
+ fs.writeFileSync(geminiMdDest, content);
318
+ console.log(` 📄 GEMINI.md (synced from CLAUDE.md, ${content.split('\n').length} lines)`);
319
+ } catch (e) {
320
+ console.log(` ⚠️ GEMINI.md write skipped (${e.code || 'error'})`);
321
+ }
322
+ }
321
323
 
322
324
  // Settings.json with auto-approve tools + persona
323
325
  const geminiSettings = {
@@ -393,18 +395,41 @@ function setupLocalBinSymlinks() {
393
395
  'claude-all-skills': path.join(PKG_DIR, 'bin', 'skills-cli.js'),
394
396
  'claude-all-mcp': path.join(PKG_DIR, 'bin', 'mcp-install.js'),
395
397
  'claude-all-update': path.join(PKG_DIR, 'update.sh'),
398
+ 'gemini-all': path.join(PKG_DIR, 'gemini-all'),
399
+ // 'gemini' shim shadows the real `gemini` binary so plain `gemini` runs
400
+ // in YOLO mode by default with .env loaded. Opt out with --no-yolo.
401
+ 'gemini': path.join(PKG_DIR, 'gemini'),
396
402
  };
397
403
 
398
404
  let created = 0;
399
405
  for (const [name, target] of Object.entries(bins)) {
400
406
  if (!fs.existsSync(target)) continue;
401
407
  const linkPath = path.join(localBin, name);
408
+
409
+ // Safety: don't overwrite a real binary that belongs to a different
410
+ // package. If linkPath exists and is NOT pointing to our package, skip.
402
411
  try {
403
- // Replace any stale symlink/file pointing somewhere else
404
- if (fs.existsSync(linkPath) || fs.lstatSync(linkPath, { throwIfNoEntry: false })) {
412
+ const lst = fs.lstatSync(linkPath, { throwIfNoEntry: false });
413
+ if (lst) {
414
+ if (lst.isSymbolicLink()) {
415
+ const resolved = fs.realpathSync(linkPath);
416
+ if (!resolved.startsWith(PKG_DIR)) {
417
+ // Symlink points elsewhere — could be a different version of the
418
+ // real binary (e.g., the actual @google/gemini-cli installed via
419
+ // the same prefix). Leave it alone.
420
+ console.log(` ⏭ ${name}: ~/.local/bin/${name} already points to ${resolved}, skipping shim install.`);
421
+ continue;
422
+ }
423
+ } else if (lst.isFile()) {
424
+ // Real file (not a symlink). Almost certainly a different package.
425
+ console.log(` ⏭ ${name}: ~/.local/bin/${name} is a real file (not our symlink), skipping.`);
426
+ continue;
427
+ }
428
+ // Otherwise (our own stale symlink), unlink and recreate.
405
429
  fs.unlinkSync(linkPath);
406
430
  }
407
431
  } catch {}
432
+
408
433
  try {
409
434
  fs.symlinkSync(target, linkPath);
410
435
  try { fs.chmodSync(target, 0o755); } catch {}