-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-github.sh
More file actions
113 lines (98 loc) · 3.33 KB
/
Copy pathsetup-github.sh
File metadata and controls
113 lines (98 loc) · 3.33 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
#!/bin/bash
# ============================================
# Prompt Library - GitHub Repo Setup Script
# Source: @citterxbt Public Prompt Library
# ============================================
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}🚀 Prompt Library - GitHub Setup${NC}"
echo "=================================="
echo ""
# Config
REPO_NAME="prompt-library"
GITHUB_USER=""
VISIBILITY="private" # private or public
# Check if gh CLI is available
if command -v gh &> /dev/null; then
HAS_GH=true
echo -e "${GREEN}✓${NC} GitHub CLI detected"
else
HAS_GH=false
echo -e "${YELLOW}⚠${NC} GitHub CLI not found - will use git only"
fi
# Get GitHub username
if [ -z "$GITHUB_USER" ]; then
if [ "$HAS_GH" = true ]; then
GITHUB_USER=$(gh api user -q .login 2>/dev/null || echo "")
fi
if [ -z "$GITHUB_USER" ]; then
read -p "Enter your GitHub username: " GITHUB_USER
fi
fi
echo -e "GitHub User: ${GREEN}$GITHUB_USER${NC}"
echo -e "Repo Name: ${GREEN}$REPO_NAME${NC}"
echo ""
# Check if we're in the right directory
if [ ! -f "README.md" ]; then
echo -e "${RED}Error: README.md not found. Run this script from the prompt-library folder.${NC}"
exit 1
fi
# Initialize git if not already
if [ ! -d ".git" ]; then
echo "Initializing git repository..."
git init
echo -e "${GREEN}✓${NC} Git initialized"
else
echo -e "${GREEN}✓${NC} Git already initialized"
fi
# Add all files
echo "Adding files..."
git add -A
echo -e "${GREEN}✓${NC} Files staged"
# Commit
echo "Creating initial commit..."
git commit -m "Initial commit: Prompt Library from @citterxbt" 2>/dev/null || echo "Nothing to commit"
echo -e "${GREEN}✓${NC} Committed"
# Create repo and push
if [ "$HAS_GH" = true ]; then
echo ""
echo "Creating GitHub repository..."
# Check if repo exists
if gh repo view "$GITHUB_USER/$REPO_NAME" &>/dev/null; then
echo -e "${YELLOW}⚠${NC} Repo already exists, skipping creation"
else
gh repo create "$REPO_NAME" --"$VISIBILITY" --source=. --remote=origin --push
echo -e "${GREEN}✓${NC} Repo created and pushed!"
fi
else
# Manual instructions
echo ""
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${YELLOW}Manual Steps Required:${NC}"
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
echo "1. Create repo on GitHub:"
echo " https://github.com/new"
echo " Name: $REPO_NAME"
echo " Visibility: Private (recommended)"
echo ""
echo "2. Run these commands:"
echo ""
echo -e " ${GREEN}git remote add origin git@github.com:$GITHUB_USER/$REPO_NAME.git${NC}"
echo -e " ${GREEN}git branch -M main${NC}"
echo -e " ${GREEN}git push -u origin main${NC}"
echo ""
fi
echo ""
echo -e "${GREEN}✅ Done!${NC}"
echo ""
echo "Your repo: https://github.com/$GITHUB_USER/$REPO_NAME"
echo ""
echo "Next steps:"
echo " - Add more prompts to the library"
echo " - Star the repo for easy access"
echo " - Set up Claude Projects with these prompts"