-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclaude-sync-status
More file actions
executable file
·106 lines (89 loc) · 2.89 KB
/
claude-sync-status
File metadata and controls
executable file
·106 lines (89 loc) · 2.89 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
103
104
105
106
#!/bin/bash
# Claude Code Conversation Sync - Status
# Shows sync status and helpful information
# Save original directory to return to it at the end
ORIGINAL_DIR="$(pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Load configuration
source "$SCRIPT_DIR/lib-claude-sync.sh"
# Handle --version flag
if [ "$1" = "--version" ] || [ "$1" = "-v" ]; then
show_version "$SCRIPT_DIR" "claude-sync-status"
exit 0
fi
load_config "$SCRIPT_DIR"
CLAUDE_DIR="$CLAUDE_DATA_DIR"
REPO_DIR="$SCRIPT_DIR/conversations"
echo "=== Claude Code Conversation Sync - Status ==="
echo ""
echo "Local machine: $(hostname)"
echo "Claude data directory: $CLAUDE_DIR"
echo "Sync repository: $SCRIPT_DIR"
echo ""
# Show current configuration
show_config
echo ""
# Check if conversations repo is initialized
if [ -d "$REPO_DIR/.git" ]; then
echo "Conversations repository: Initialized"
# Check for remote
cd "$REPO_DIR"
if git remote | grep -q origin; then
echo "Remote URL: $(git remote get-url origin)"
echo "Current branch: $(git branch --show-current)"
else
echo "Remote: Not configured"
echo ""
echo "To configure:"
echo " claude-config"
fi
# Check encryption status
if [ -d ".git/git-crypt" ]; then
if git-crypt status 2>/dev/null | grep -q "not decrypted"; then
echo "Encryption: Enabled (LOCKED - run claude-restore-encryption-key)"
else
echo "Encryption: Enabled (unlocked)"
fi
else
echo "Encryption: Not enabled"
fi
# Show git status
echo ""
if [ -z "$(git status --porcelain)" ]; then
echo "Working tree: Clean (no changes to push)"
else
echo "Working tree: Has changes"
echo ""
echo "Changed files:"
git status --short
echo ""
echo "Run 'claude-sync-push' to sync these changes."
fi
cd "$SCRIPT_DIR"
else
echo "Conversations repository: Not initialized"
echo "Run 'claude-config' to set up, then 'claude-sync-init' to initialize."
fi
echo ""
# Show conversation count
if [ -d "$CLAUDE_DIR/projects" ]; then
PROJECT_COUNT=$(find "$CLAUDE_DIR/projects" -name "*.jsonl" 2>/dev/null | wc -l)
echo "Local conversations: $PROJECT_COUNT"
else
echo "Local conversations: 0 (Claude Code not used yet)"
fi
if [ -d "$REPO_DIR/projects" ]; then
SYNCED_COUNT=$(find "$REPO_DIR/projects" -name "*.jsonl" 2>/dev/null | wc -l)
echo "Synced conversations: $SYNCED_COUNT"
else
echo "Synced conversations: 0"
fi
echo ""
echo "Commands:"
echo " claude-config - Configure sync settings"
echo " claude-sync-init - Initialize/clone conversations repository"
echo " claude-sync-push - Sync local conversations to remote"
echo " claude-sync-pull - Sync conversations from remote to local"
echo " claude-sync-status - Show this status"
# Return to original directory
cd "$ORIGINAL_DIR"