claude-smart 0.2.37 → 0.2.40

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.
@@ -106,6 +106,34 @@ append_env_value() {
106
106
  chmod 600 "$REFLEXIO_ENV"
107
107
  }
108
108
 
109
+ append_env_raw() {
110
+ local key value
111
+ key="$1"
112
+ value="$2"
113
+ mkdir -p "$(dirname "$REFLEXIO_ENV")"
114
+ touch "$REFLEXIO_ENV"
115
+ chmod 600 "$REFLEXIO_ENV"
116
+ printf '%s=%s\n' "$key" "$value" >> "$REFLEXIO_ENV"
117
+ chmod 600 "$REFLEXIO_ENV"
118
+ }
119
+
120
+ ensure_local_env_defaults() {
121
+ mkdir -p "$(dirname "$REFLEXIO_ENV")"
122
+ touch "$REFLEXIO_ENV"
123
+ chmod 600 "$REFLEXIO_ENV"
124
+ if ! get_env_value CLAUDE_SMART_USE_LOCAL_CLI >/dev/null 2>&1; then
125
+ printf '# Route reflexio generation through the local Claude Code CLI\n' >> "$REFLEXIO_ENV"
126
+ append_env_raw CLAUDE_SMART_USE_LOCAL_CLI "1"
127
+ fi
128
+ if ! get_env_value CLAUDE_SMART_USE_LOCAL_EMBEDDING >/dev/null 2>&1; then
129
+ printf '# Use the in-process ONNX embedder (chromadb) - no API key for semantic search\n' >> "$REFLEXIO_ENV"
130
+ append_env_raw CLAUDE_SMART_USE_LOCAL_EMBEDDING "1"
131
+ fi
132
+ if ! get_env_value CLAUDE_SMART_READ_ONLY >/dev/null 2>&1; then
133
+ append_env_value CLAUDE_SMART_READ_ONLY "0"
134
+ fi
135
+ }
136
+
109
137
  mask_secret() {
110
138
  local value len suffix
111
139
  value="$1"
@@ -283,11 +311,11 @@ main() {
283
311
 
284
312
  if [ "$mode" = "local" ]; then
285
313
  if [ -f "$REFLEXIO_ENV" ]; then
286
- remove_env_keys
314
+ remove_env_keys REFLEXIO_API_KEY REFLEXIO_URL REFLEXIO_USER_ID
287
315
  log "removed managed Reflexio settings from $REFLEXIO_ENV"
288
- else
289
- log "local mode selected; no $REFLEXIO_ENV exists, so no env file was created"
290
316
  fi
317
+ ensure_local_env_defaults
318
+ log "configured local Reflexio defaults in $REFLEXIO_ENV"
291
319
  install_for_host "$host"
292
320
  return 0
293
321
  fi