Skip to content

Installation Script Fails - Comprehensive Fix Provided #978

@lebsral

Description

@lebsral

Installation Script Fails - Comprehensive Fix Provided

Summary

The CCPM installation process has multiple critical issues that prevent successful installation and usage. This issue documents all problems and provides a complete working solution.

Problems Identified

1. Installation URL Returns HTML (Issues #966, #961)

Problem: The official installation command fails:

curl -sSL https://automaze.io/ccpm/install | bash

Error:

bash: line 8: syntax error near unexpected token `newline'
bash: line 8: `<!DOCTYPE html>'
curl: (56) Failure writing output to destination

Root Cause: The URL returns an HTML page instead of the bash script.

2. Incorrect Directory Structure (Related to Issue #971)

Problem: The current install/ccpm.sh script clones into the current directory without organizing files correctly.

What happens:

  • Files are placed in project root or incorrectly in .claude/
  • Command files reference ccpm/scripts/pm/*.sh but scripts are in wrong location
  • Slash commands fail to work

Root Cause: Script doesn't understand CCPM's required directory structure.

3. Slash Commands Not Recognized (Issue #971)

Problem: Even with correct installation, slash commands don't work.

Root Cause: Claude Code must be restarted after installation to load commands from .claude/commands/, but this is not documented.

Required Directory Structure

For CCPM to work correctly, this structure is required:

project/
├── .claude/
│   ├── commands/              ← Command definitions (loaded by Claude Code)
│   │   ├── pm/*.md           ← /pm:* slash commands
│   │   ├── context/*.md      ← /context:* commands
│   │   └── testing/*.md      ← /testing:* commands
│   ├── ccpm/                 ← CCPM implementation
│   │   ├── scripts/
│   │   │   └── pm/*.sh       ← Scripts referenced by commands
│   │   ├── agents/
│   │   ├── rules/
│   │   ├── commands/         ← Source commands (copied to .claude/commands/)
│   │   ├── prds/
│   │   └── epics/
│   └── settings.local.json
├── .gitignore                 ← Must include .claude/epics/
└── CLAUDE.md

Why this structure?

  • .claude/commands/ - Claude Code scans this for slash commands
  • .claude/ccpm/ - Commands reference ccpm/scripts/, which resolves to this path
  • Commands and scripts must be in separate locations for proper path resolution

Complete Solution

I've created a fixed installation script that:

  1. ✅ Downloads CCPM to temp directory
  2. ✅ Creates proper .claude/ccpm/ structure
  3. ✅ Copies command files to .claude/commands/
  4. ✅ Sets up permissions
  5. ✅ Creates .gitignore
  6. ✅ Provides clear next steps including restart requirement
  7. ✅ Works on first try

Installation Script

See attached install-ccpm.sh (or view the full script below).

Usage

cd your-project
curl -fsSL https://raw.githubusercontent.com/YOUR_REPO/main/install-ccpm.sh | bash
bash .claude/ccpm/scripts/pm/init.sh
# RESTART CLAUDE CODE

Testing

Tested successfully on:

  • ✅ macOS (Darwin 25.0.0)
  • ✅ Claude Code v2.0.24
  • ✅ Fresh directory installation
  • ✅ Scripts work immediately
  • ✅ Slash commands work after restart

Proposed Changes to CCPM Repository

1. Replace install/ccpm.sh

Replace with the fixed script that properly organizes files.

2. Update README.md

Add to "Get Started Now" section:

## Installation

### Quick Install (macOS/Linux)
\`\`\`bash
cd /path/to/your/project
curl -fsSL https://raw.githubusercontent.com/automazeio/ccpm/main/install/ccpm.sh | bash
bash .claude/ccpm/scripts/pm/init.sh
\`\`\`

⚠️ **IMPORTANT:** After installation, you must **restart Claude Code** for slash commands to be recognized!

### Verify Installation
After restarting Claude Code:
\`\`\`
/pm:help
\`\`\`

3. Add Troubleshooting Section

## Troubleshooting

### Slash commands not working
1. Verify files exist: `ls .claude/commands/pm/`
2. **Restart Claude Code** (required after installation)
3. Check structure: `tree -L 2 .claude/`

### Installation URL fails
Use GitHub raw URL:
\`\`\`bash
curl -fsSL https://raw.githubusercontent.com/automazeio/ccpm/main/install/ccpm.sh | bash
\`\`\`

### Directory structure incorrect
Re-run installation script - it's safe to run multiple times.

Files Provided

  1. install-ccpm.sh - Fixed installation script (ready to use)
  2. CCPM_INSTALLATION_FIX.md - Complete documentation
  3. TEST_NEW_INSTALL.md - Testing guide

Impact

This fix resolves:

Environment

Additional Notes

The restart requirement is a Claude Code behavior - it scans .claude/commands/ on startup. This should be prominently documented in the README as users consistently report this as a bug when it's actually expected behavior.


Would you like me to submit this as a Pull Request? I have working code ready to contribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions