claude-all-config 3.8.2 → 3.8.4

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/.env.example CHANGED
@@ -50,3 +50,8 @@ TELEGRAM_API_HASH=
50
50
  # ANTHROPIC_API_KEY=
51
51
  # OPENAI_API_KEY=
52
52
  # GOOGLE_API_KEY=
53
+
54
+ # ─────────────────────────────────────────────────────────────
55
+ # GitHub token for ai-memory private repo sync
56
+ # ─────────────────────────────────────────────────────────────
57
+ GH_TOKEN=
package/claude-all CHANGED
@@ -6,11 +6,29 @@
6
6
 
7
7
  # Auto-load secrets from ~/.claude/.env if present so MCP servers can pick up
8
8
  # CONTEXT7_API_KEY, EXA_API_KEY, Z_AI_API_KEY, MINIMAX_API_KEY, TELEGRAM_*, etc.
9
- if [ -f "$HOME/.claude/.env" ]; then
10
- set -a
11
- # shellcheck disable=SC1091
12
- . "$HOME/.claude/.env" 2>/dev/null || true
13
- set +a
9
+ # Check multiple possible locations (Termux proot may use different HOME paths)
10
+ for _env_dir in "$HOME/.claude" "$HOME/.kiro" "$PREFIX/../../home/.claude" "/data/data/com.termux/files/home/.claude"; do
11
+ if [ -f "$_env_dir/.env" ]; then
12
+ set -a
13
+ # shellcheck disable=SC1091
14
+ . "$_env_dir/.env" 2>/dev/null || true
15
+ set +a
16
+ break
17
+ fi
18
+ done
19
+ unset _env_dir
20
+
21
+ # CRITICAL: Ensure ANTHROPIC_API_KEY is always set so Claude Code never asks
22
+ # for OAuth login. Each provider case will override with the real key+base_url.
23
+ # Without this, Claude Code shows "Not logged in · Please run /login" on
24
+ # headless servers/Termux that can't open a browser for OAuth.
25
+ if [[ -z "$ANTHROPIC_API_KEY" ]]; then
26
+ if [[ -n "$Z_AI_API_KEY" ]]; then
27
+ export ANTHROPIC_API_KEY="$Z_AI_API_KEY"
28
+ export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
29
+ else
30
+ export ANTHROPIC_API_KEY="sk-placeholder-overridden-by-provider"
31
+ fi
14
32
  fi
15
33
 
16
34
  # Skip-permissions flag selection.
@@ -824,15 +842,20 @@ setup_xai() {
824
842
  }
825
843
 
826
844
  setup_glm() {
827
- API_KEY=$(load_api_key "glm" "GLM")
828
- if [[ $? -eq 0 ]]; then
829
- check_dependencies
830
- MODEL=$(select_glm_model)
831
- echo -e "${BLUE}Configuring for ZhipuAI / GLM...${NC}"
832
- export GLM_API_KEY="$API_KEY"
833
- export MODEL_NAME="$MODEL"
834
- exec claude $SKIP_PERMS_FLAG --model "$MODEL" "$@"
845
+ # Auto-use Z_AI_API_KEY from .env if available
846
+ if [[ -n "$Z_AI_API_KEY" ]]; then
847
+ API_KEY="$Z_AI_API_KEY"
848
+ else
849
+ API_KEY=$(load_api_key "glm" "GLM")
850
+ [[ $? -ne 0 ]] && return 1
835
851
  fi
852
+ check_dependencies
853
+ MODEL=$(select_glm_model)
854
+ echo -e "${BLUE}Configuring for ZhipuAI / GLM...${NC}"
855
+ export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
856
+ export ANTHROPIC_API_KEY="$API_KEY"
857
+ export CLAUDE_MODEL="$MODEL"
858
+ exec claude $SKIP_PERMS_FLAG --model "$MODEL" "$@"
836
859
  }
837
860
 
838
861
  setup_groq() {
@@ -1898,17 +1921,21 @@ case $choice in
1898
1921
  exec claude $SKIP_PERMS_FLAG --model "$MODEL_NAME" "$@"
1899
1922
  ;;
1900
1923
  7)
1901
- # ZhipuAI / GLM
1924
+ # ZhipuAI / GLM (via Z.AI proxy)
1902
1925
  echo -e "${BLUE}Configuring for ZhipuAI (GLM)...${NC}"
1903
1926
 
1904
- # Get API key with persistent storage
1927
+ # Auto-use Z_AI_API_KEY if available (from .env), fallback to saved key
1928
+ if [[ -z "$ANTHROPIC_AUTH_TOKEN" && -n "$Z_AI_API_KEY" ]]; then
1929
+ ANTHROPIC_AUTH_TOKEN="$Z_AI_API_KEY"
1930
+ fi
1931
+
1905
1932
  if [[ -z "$ANTHROPIC_AUTH_TOKEN" ]]; then
1906
1933
  load_api_key_to_var "$HOME/.glm_api_key" "ANTHROPIC_AUTH_TOKEN"
1907
1934
  fi
1908
1935
 
1909
1936
  if [[ -z "$ANTHROPIC_AUTH_TOKEN" ]]; then
1910
- echo "Get Key: https://open.bigmodel.cn/usercenter/apikeys"
1911
- read -p "Enter GLM API Key: " ANTHROPIC_AUTH_TOKEN
1937
+ echo "Get Key: https://z.ai/dashboard or https://open.bigmodel.cn/usercenter/apikeys"
1938
+ read -p "Enter Z.AI / GLM API Key: " ANTHROPIC_AUTH_TOKEN
1912
1939
  save_api_key "$ANTHROPIC_AUTH_TOKEN" "$HOME/.glm_api_key" "GLM"
1913
1940
  else
1914
1941
  if [[ ! -f "$HOME/.glm_api_key" ]]; then
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env bash
2
+ # ai-memory — Sync shared AI context across devices
3
+ # Usage:
4
+ # ai-memory pull — Load latest context (session start)
5
+ # ai-memory push — Push session summary (session end)
6
+ # ai-memory context — Print CONTEXT.md + active-tasks for injection
7
+
8
+ set -euo pipefail
9
+
10
+ REPO_URL="${AI_MEMORY_REPO:-https://github.com/zesbe/ai-memory.git}"
11
+ MEMORY_DIR="${AI_MEMORY_DIR:-$HOME/ai-memory}"
12
+
13
+ # Use GH token from env if available (for private repos)
14
+ if [[ -n "${GH_TOKEN:-}" ]]; then
15
+ REPO_URL="https://x-access-token:${GH_TOKEN}@github.com/zesbe/ai-memory.git"
16
+ elif [[ -n "${GITHUB_TOKEN:-}" ]]; then
17
+ REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/zesbe/ai-memory.git"
18
+ fi
19
+
20
+ # Ensure repo exists locally
21
+ ensure_repo() {
22
+ if [[ ! -d "$MEMORY_DIR/.git" ]]; then
23
+ git clone --depth 1 "$REPO_URL" "$MEMORY_DIR" 2>/dev/null
24
+ fi
25
+ }
26
+
27
+ case "${1:-context}" in
28
+ pull)
29
+ ensure_repo
30
+ cd "$MEMORY_DIR"
31
+ git pull --rebase --quiet 2>/dev/null || true
32
+ echo "✅ ai-memory synced"
33
+ ;;
34
+ push)
35
+ ensure_repo
36
+ cd "$MEMORY_DIR"
37
+ git add -A
38
+ if git diff --cached --quiet 2>/dev/null; then
39
+ echo "No changes to push"
40
+ else
41
+ git commit -m "auto: session update $(date +%Y-%m-%d_%H:%M)" --quiet
42
+ git push --quiet 2>/dev/null
43
+ echo "✅ ai-memory pushed"
44
+ fi
45
+ ;;
46
+ context)
47
+ ensure_repo
48
+ cd "$MEMORY_DIR"
49
+ git pull --rebase --quiet 2>/dev/null || true
50
+ echo "--- AI MEMORY CONTEXT ---"
51
+ cat "$MEMORY_DIR/CONTEXT.md" 2>/dev/null
52
+ echo ""
53
+ echo "--- ACTIVE TASKS ---"
54
+ cat "$MEMORY_DIR/active-tasks/current.md" 2>/dev/null
55
+ echo "--- END AI MEMORY ---"
56
+ ;;
57
+ *)
58
+ echo "Usage: ai-memory [pull|push|context]"
59
+ ;;
60
+ esac
@@ -17,6 +17,13 @@ fi
17
17
  # Read using-superpowers content
18
18
  using_superpowers_content=$(cat "${PLUGIN_ROOT}/skills/using-superpowers/SKILL.md" 2>&1 || echo "Error reading using-superpowers skill")
19
19
 
20
+ # Load ai-memory context if available
21
+ ai_memory_content=""
22
+ AI_MEMORY_SCRIPT="${SCRIPT_DIR}/ai-memory.sh"
23
+ if [[ -f "$AI_MEMORY_SCRIPT" ]]; then
24
+ ai_memory_content=$(bash "$AI_MEMORY_SCRIPT" context 2>/dev/null || echo "")
25
+ fi
26
+
20
27
  # Escape outputs for JSON using pure bash
21
28
  escape_for_json() {
22
29
  local input="$1"
@@ -38,13 +45,14 @@ escape_for_json() {
38
45
 
39
46
  using_superpowers_escaped=$(escape_for_json "$using_superpowers_content")
40
47
  warning_escaped=$(escape_for_json "$warning_message")
48
+ ai_memory_escaped=$(escape_for_json "$ai_memory_content")
41
49
 
42
50
  # Output context injection as JSON
43
51
  cat <<EOF
44
52
  {
45
53
  "hookSpecificOutput": {
46
54
  "hookEventName": "SessionStart",
47
- "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
55
+ "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n\n${ai_memory_escaped}\n</EXTREMELY_IMPORTANT>"
48
56
  }
49
57
  }
50
58
  EOF
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-all-config",
3
- "version": "3.8.2",
3
+ "version": "3.8.4",
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": {