-
Notifications
You must be signed in to change notification settings - Fork 567
Fix installation script - Resolves #966, #961, #971 #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit fixes multiple installation issues: - Fixes automazeio#966 - Installation error with automaze.io URL - Fixes automazeio#961 - Installation errors - Fixes automazeio#971 - Slash commands not functioning after installation Problems solved: 1. Proper directory structure: Creates .claude/ccpm/ and .claude/commands/ 2. Copies command files to correct location for Claude Code to discover 3. Sets up permissions and .gitignore automatically 4. Adds clear user feedback and next steps 5. Documents restart requirement for slash commands to load The fixed script: - Downloads CCPM to temp directory (avoids path issues) - Creates proper .claude/ccpm/ structure (scripts go here) - Copies commands to .claude/commands/ (where Claude Code scans) - Sets up settings.local.json with proper bash permissions - Creates .gitignore with .claude/epics/ excluded - Provides step-by-step visual feedback - Works on first try without manual intervention Tested successfully on macOS with Claude Code v2.0.24. Related issue with full details: automazeio#978 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughThe installer script now clones the repo into a temporary directory, performs permission checks, creates and populates Changes
Sequence DiagramsequenceDiagram
participant User
participant Script as install/ccpm.sh
participant Temp as /tmp/ccpm-*
participant Project as ProjectRoot
User->>Script: run installer
Script->>Script: show banner & messages
Script->>Project: check write permission
alt not writable
Script->>User: error + exit (non-zero)
else writable
Script->>Temp: git clone into TEMP_DIR
Temp-->>Script: clone complete
Script->>Project: mkdir -p .claude
Script->>Project: copy .claude/ccpm from TEMP_DIR
Script->>Project: copy .claude/commands from TEMP_DIR
alt settings.local.json exists in temp
Script->>Project: copy settings.local.json -> .claude/settings.local.json
end
Script->>Project: create/update .gitignore
Script->>Temp: cleanup (trap)
Script->>User: success message + exit 0
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
install/ccpm.sh (2)
79-94: Incomplete .gitignore handling—consider appending missing entries.The script creates .gitignore only if it doesn't exist. If the user already has a .gitignore without the CCPM exclusions (
.claude/epics/,.claude/settings.local.json), those files could be committed. This won't break the install but could pollute the repo. Consider checking for and appending missing entries if the file exists.Example approach:
ensure_gitignore_entries() { local entries=(".claude/epics/" ".claude/settings.local.json") for entry in "${entries[@]}"; do if [ -f "$PROJECT_ROOT/.gitignore" ]; then grep -q "^$entry$" "$PROJECT_ROOT/.gitignore" || echo "$entry" >> "$PROJECT_ROOT/.gitignore" fi done }
5-5: Update placeholder URL in comment.The comment on line 5 shows
https://raw.githubusercontent.com/YOUR_REPO/main/install-ccpm.sh. Replace with the actual install URL or remove the placeholder.-# Usage: curl -fsSL https://raw.githubusercontent.com/YOUR_REPO/main/install-ccpm.sh | bash +# Usage: curl -fsSL https://raw.githubusercontent.com/automazeio/ccpm/main/install/ccpm.sh | bash
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
install/ccpm.sh(1 hunks)
🔇 Additional comments (4)
install/ccpm.sh (4)
1-11: Well-structured initialization with proper error handling.The shebang,
set -e, and temp directory setup are all correct. Good use ofmktemp -dfor safe temporary storage.
20-27: Defensive permission check is appreciated.Early write-permission validation prevents silent failures later and provides immediate user feedback.
29-37: Clone step is robust.The explicit error handling with cleanup (
rm -rf "$TEMP_DIR") on failure is solid. Good pattern for external operations.
96-123: Excellent user-facing output.Clear summary, next steps, and explicit restart warning align perfectly with PR objectives #971 and #966. The emoji-based progress reporting is professional and accessible. The documentation link is helpful.
Fixes identified issues: 1. Fix glob expansion bugs (lines 48, 56) - removed quotes around wildcards 2. Update placeholder URL to actual GitHub raw URL 3. Improve .gitignore handling - append to existing file instead of only creating new 4. Add trap for cleanup to ensure temp directory removal even on failure 5. Remove redundant manual cleanup code Changes: - Line 48: "$TEMP_DIR/ccpm/"* → "$TEMP_DIR/ccpm"/* - Line 56: commands/"* → commands/* - Line 5: Updated URL from placeholder to real GitHub raw URL - Added cleanup() function with trap EXIT for robust cleanup - Enhanced .gitignore to append entries if file exists These changes ensure the installation script is more robust and handles edge cases properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Signed-off-by: velidawill <[email protected]>
Signed-off-by: velidawill <[email protected]>
|
FYI the bash script path is wrong. Claude code 2.0 gets this error: Proposed fix. instead of: It should be: |
Great! drop a PR please |
Summary
This PR fixes the broken CCPM installation process that has affected multiple users. The installation now works correctly on the first try and slash commands are properly recognized after restarting Claude Code.
Issues Fixed
Problems Solved
1. Incorrect Directory Structure
Before: Script cloned to current directory causing path resolution issues
After: Creates proper
.claude/ccpm/and.claude/commands/structure2. Slash Commands Not Found
Before: Commands not copied to where Claude Code scans (
.claude/commands/)After: Copies commands from
.claude/ccpm/commands/to.claude/commands/3. Missing Documentation
Before: Users didn't know they need to restart Claude Code
After: Clear instructions including restart requirement
4. Poor User Feedback
Before: Silent failures, unclear error messages
After: Step-by-step visual progress with ✅ indicators
Changes Made
install/ccpm.sh.claude/ccpm/directory and copies all CCPM files there.claude/commands/for Claude Code discoverysettings.local.jsonwith proper bash permissions.gitignorewith.claude/epics/excludedThe Correct Structure
Testing
Tested successfully in fresh directory:
Environment:
Installation Output
Breaking Changes
None. The script creates the same functionality but with correct file organization.
Additional Improvements Recommended
Checklist
This PR should resolve the installation problems that have been affecting users since v2.0.10. The fix is backward compatible and can be deployed immediately.
Summary by CodeRabbit