-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·121 lines (103 loc) · 3.05 KB
/
setup.sh
File metadata and controls
executable file
·121 lines (103 loc) · 3.05 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# Claude Context Wrapper - Quick Setup Script
# One-liner to set up context in any project
# Created by BuildAppolis (www.buildappolis.com)
# This script can be run with:
# curl -sSL https://raw.githubusercontent.com/BuildAppolis/claude-context-wrapper/main/setup.sh | bash -s -- [type]
set -e
# Default to TypeScript if no argument provided
CONTEXT_TYPE="${1:-ts}"
# Colors (cross-platform)
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "win32" ]]; then
RED=''
GREEN=''
YELLOW=''
BLUE=''
NC=''
else
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
fi
echo -e "${BLUE}Claude Context Wrapper - Quick Setup${NC}"
echo "Setting up context in current directory: $(pwd)"
echo ""
# Create .claude directory
mkdir -p .claude
# Create context file based on type
case "$CONTEXT_TYPE" in
ts|typescript)
cat > .claude/context.ts << 'EOF'
// Claude Context - TypeScript
// Auto-generated by BuildAppolis Claude Context Wrapper
const context = {
timestamp: new Date().toISOString(),
project: process.cwd().split('/').pop(),
nodeVersion: process.version,
environment: process.env.NODE_ENV || 'development',
// Add your custom context here
};
console.log(Object.entries(context)
.map(([k, v]) => `${k}: ${v}`)
.join(', '));
EOF
echo -e "${GREEN}✓${NC} Created .claude/context.ts"
;;
py|python)
cat > .claude/context.py << 'EOF'
#!/usr/bin/env python3
# Claude Context - Python
# Auto-generated by BuildAppolis Claude Context Wrapper
import os
from datetime import datetime
context = {
'timestamp': datetime.now().isoformat(),
'project': os.path.basename(os.getcwd()),
'environment': os.getenv('ENV', 'development'),
# Add your custom context here
}
print(', '.join([f"{k}: {v}" for k, v in context.items()]))
EOF
chmod +x .claude/context.py
echo -e "${GREEN}✓${NC} Created .claude/context.py"
;;
txt|text)
cat > .claude/context.txt << 'EOF'
Project: $(basename $PWD)
Tech Stack: [Add your tech stack]
Current Focus: [Add current focus]
Notes: [Add any relevant notes]
EOF
echo -e "${GREEN}✓${NC} Created .claude/context.txt"
;;
*)
echo -e "${RED}Error:${NC} Invalid type. Use 'ts', 'py', or 'txt'"
exit 1
;;
esac
# Create config file
cat > .claude/ccw.config.json << 'EOF'
{
"includeGitInfo": true,
"customContext": {
"team": "development",
"priority": "feature-development"
},
"contextTimeout": 3,
"allowedDirectories": []
}
EOF
echo -e "${GREEN}✓${NC} Created .claude/ccw.config.json"
echo ""
echo -e "${GREEN}Setup complete!${NC}"
echo ""
echo "Next steps:"
echo "1. Edit .claude/context.${CONTEXT_TYPE} to customize your context"
echo "2. Use 'claude' with your context automatically included"
echo ""
echo "Example: claude \"create a new API endpoint\""
echo ""
echo "For the full wrapper with 'c' command, install from:"
echo "https://github.com/BuildAppolis/claude-context-wrapper"