Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions docs/web/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,108 @@ EOF
echo ""
}

configure_telemetry_consent() {
# Skip in CI mode
if [[ "$CI_MODE" == "true" ]]; then
print_step "Skipping telemetry configuration (CI mode)"
return 0
fi

# Skip if DO_NOT_TRACK is set (universal opt-out standard)
if [[ -n "${DO_NOT_TRACK:-}" ]]; then
print_step "Telemetry disabled (DO_NOT_TRACK is set)"
return 0
fi

# Skip if VOICEMODE_TELEMETRY is already set
if [[ -n "${VOICEMODE_TELEMETRY:-}" ]]; then
print_step "Telemetry preference already configured: $VOICEMODE_TELEMETRY"
return 0
fi

# Check if already configured in voicemode.env
local voicemode_config="$HOME/.voicemode/voicemode.env"
if [[ -f "$voicemode_config" ]] && grep -q "VOICEMODE_TELEMETRY" "$voicemode_config" 2>/dev/null; then
local current_value=$(grep "VOICEMODE_TELEMETRY" "$voicemode_config" | tail -1 | cut -d= -f2 | tr -d '"' | tr -d "'")
print_step "Telemetry preference already configured: $current_value"
return 0
fi

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " 📊 Help Improve VoiceMode"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "VoiceMode includes optional telemetry to help improve the project."
echo ""
echo "If enabled, we collect:"
echo " • Anonymous usage statistics (session counts, provider choices)"
echo " • Performance metrics (response times)"
echo " • Error rates (no message content)"
echo ""
echo "Your data is never sold and helps us make VoiceMode better."
echo "Learn more: https://voicemode.dev/docs/privacy"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""

# In non-interactive mode, default to no
if [[ "$NON_INTERACTIVE" == "true" ]]; then
echo "Would you like to enable telemetry? [y/N]"
echo "→ Defaulting to 'no' (non-interactive mode)"
set_telemetry_preference "false"
return 0
fi

read -p "Would you like to enable telemetry? [y/N]: " choice
case $choice in
[Yy]*)
set_telemetry_preference "true"
print_success "Telemetry enabled - thank you for helping improve VoiceMode!"
;;
*)
set_telemetry_preference "false"
print_success "Telemetry disabled - no data will be collected"
;;
esac

return 0
}

set_telemetry_preference() {
local value="$1"
local voicemode_config="$HOME/.voicemode/voicemode.env"

# Create the config directory if it doesn't exist
mkdir -p "$HOME/.voicemode"

# Create or update the config file
if [[ ! -f "$voicemode_config" ]]; then
# Create new config file
echo "# VoiceMode Configuration" > "$voicemode_config"
echo "# Generated by installer on $(date +%Y-%m-%d)" >> "$voicemode_config"
echo "" >> "$voicemode_config"
fi

# Check if VOICEMODE_TELEMETRY already exists in the file
if grep -q "^export VOICEMODE_TELEMETRY=" "$voicemode_config" 2>/dev/null; then
# Update existing value
if [[ "$OS" == "macos" ]]; then
sed -i '' "s/^export VOICEMODE_TELEMETRY=.*/export VOICEMODE_TELEMETRY=\"$value\"/" "$voicemode_config"
else
sed -i "s/^export VOICEMODE_TELEMETRY=.*/export VOICEMODE_TELEMETRY=\"$value\"/" "$voicemode_config"
fi
else
# Add new value
echo "" >> "$voicemode_config"
echo "# Telemetry preference (set during installation)" >> "$voicemode_config"
echo "export VOICEMODE_TELEMETRY=\"$value\"" >> "$voicemode_config"
fi

# Export for current session
export VOICEMODE_TELEMETRY="$value"
}

setup_coreml_acceleration() {
# Check if we're on Apple Silicon Mac
if [[ "$OS" == "macos" ]] && [[ "$ARCH" == "arm64" ]]; then
Expand Down Expand Up @@ -1838,6 +1940,9 @@ main() {
# Configure OpenAI API key for quick start
configure_api_key

# Ask about telemetry consent
configure_telemetry_consent

# Check if user is in home directory and suggest creating a workspace
check_and_suggest_working_directory

Expand Down
16 changes: 16 additions & 0 deletions voice_mode/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,22 @@ def load_voicemode_env():
# Download progress style: auto, rich, simple (default: auto)
# VOICEMODE_PROGRESS_STYLE=auto

#############
# Telemetry (opt-in analytics to improve VoiceMode)
#############

# Enable telemetry: true, false, or ask (default: ask)
# - true: Send anonymous usage statistics
# - false: Disable telemetry completely
# - ask: Prompt user on first interactive use
# VOICEMODE_TELEMETRY=ask

# Telemetry endpoint URL (usually not needed, uses project default)
# VOICEMODE_TELEMETRY_ENDPOINT=

# Note: Setting DO_NOT_TRACK=1 in your environment also disables telemetry
# Learn more: https://voicemode.dev/docs/privacy

#############
# API Keys (set these in your environment for security)
#############
Expand Down
Loading