-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclaude-config
More file actions
executable file
·102 lines (86 loc) · 2.75 KB
/
claude-config
File metadata and controls
executable file
·102 lines (86 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Claude Code Sync - Configuration Helper
# Creates and manages configuration
set -e
ORIGINAL_DIR="$(pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Load library for version function
source "$SCRIPT_DIR/lib-claude-sync.sh"
# Handle --version flag
if [ "$1" = "--version" ] || [ "$1" = "-v" ]; then
show_version "$SCRIPT_DIR" "claude-config"
exit 0
fi
EXAMPLE_CONFIG="$SCRIPT_DIR/.claude-sync-config.example"
LOCAL_CONFIG="$SCRIPT_DIR/.claude-sync-config.local"
SHARED_CONFIG="$SCRIPT_DIR/.claude-sync-config"
echo "=== Claude Code Sync - Configuration ==="
echo ""
# Check if local config exists
if [ -f "$LOCAL_CONFIG" ]; then
echo "Current configuration: $LOCAL_CONFIG"
echo ""
cat "$LOCAL_CONFIG"
echo ""
read -p "Edit configuration? (yes/no): " EDIT
if [ "$EDIT" = "yes" ]; then
${EDITOR:-nano} "$LOCAL_CONFIG"
echo "Configuration updated!"
fi
else
echo "No local configuration found."
echo ""
echo "Would you like to create one now?"
echo ""
read -p "Create configuration? (yes/no): " CREATE
if [ "$CREATE" = "yes" ]; then
echo ""
echo "Configuration wizard:"
echo ""
# Git remote
read -p "Git remote URL (e.g., git@bitbucket.org:user/repo.git): " REMOTE
# Branch
read -p "Git branch [main]: " BRANCH
BRANCH=${BRANCH:-main}
# Encryption
read -p "Enable encryption? (yes/no) [no]: " ENCRYPT
if [ "$ENCRYPT" = "yes" ]; then
ENCRYPTION="true"
else
ENCRYPTION="false"
fi
# Create config file
cat > "$LOCAL_CONFIG" <<EOF
# Claude Code Conversation Sync - Local Configuration
# This file is gitignored and machine-specific
CLAUDE_SYNC_REMOTE="$REMOTE"
CLAUDE_SYNC_BRANCH="$BRANCH"
CLAUDE_SYNC_ENCRYPTION="$ENCRYPTION"
CLAUDE_BACKUP_RETENTION_DAYS="30"
CLAUDE_DATA_DIR="\$HOME/.claude"
CLAUDE_SYNC_VERBOSE="false"
EOF
echo ""
echo "Configuration created at: $LOCAL_CONFIG"
echo ""
echo "You can edit it anytime by running: claude-config"
else
echo ""
echo "To create configuration later, run: claude-config"
echo ""
echo "Or manually copy:"
echo " cp $EXAMPLE_CONFIG $LOCAL_CONFIG"
echo " edit $LOCAL_CONFIG"
fi
fi
echo ""
echo "Configuration priority (highest to lowest):"
echo " 1. Environment variables (CLAUDE_SYNC_*)"
echo " 2. Local config: .claude-sync-config.local (machine-specific)"
echo " 3. Shared config: .claude-sync-config (version controlled)"
echo " 4. Built-in defaults"
echo ""
echo "To set environment variables, add to your ~/.bashrc:"
echo " export CLAUDE_SYNC_REMOTE=\"git@bitbucket.org:user/repo.git\""
echo ""
cd "$ORIGINAL_DIR"