Skip to content

setup.sh Fixes for updated repository structure#62

Closed
uhbuhb wants to merge 2 commits intodanielmiessler:mainfrom
uhbuhb:main
Closed

setup.sh Fixes for updated repository structure#62
uhbuhb wants to merge 2 commits intodanielmiessler:mainfrom
uhbuhb:main

Conversation

@uhbuhb
Copy link
Copy Markdown

@uhbuhb uhbuhb commented Oct 24, 2025

The latest project restructuring totally broke the setup.sh script. Lets fix it :)

Also removed references to context/CLAUDE.md file in agent instructions, as that file has been removed in the repository restructuring.

Problems fixed:
• ask_input function wasn't displaying user input - shell only showed options, not the question
• Shell detection used runtime variables, always detected bash even when user's login shell was zsh
• PAI_DIR variable pointed to repo root instead of .claude directory, breaking environment setup
• Claude Code integration failed when ~/.claude already existed as directory or symlink
• settings.json retained template values instead of user's AI name, color, and paths

Implementation:
• Moved setup.sh from .claude/ to repository root for easier access via curl
• Fixed ask_input by redirecting prompt to stderr (line 99), allowing input to display properly
• Introduced INSTALL_DIR for repo root, set PAI_DIR to .claude directory (v0.6.0+ structure)
• Use $SHELL variable for shell detection instead of runtime variables, added fish support
• Rewrote Claude Code integration to detect and backup existing directories/symlinks before linking
• Auto-update settings.json with user's custom AI name, color, PAI_DIR, and PAI_HOME values

orihab-placer and others added 2 commits October 24, 2025 11:00
Problems fixed:
• ask_input function wasn't displaying user input - shell only showed options, not the question
• Shell detection used runtime variables, always detected bash even when user's login shell was zsh
• PAI_DIR variable pointed to repo root instead of .claude directory, breaking environment setup
• Claude Code integration failed when ~/.claude already existed as directory or symlink
• settings.json retained template values instead of user's AI name, color, and paths

Implementation:
• Moved setup.sh from .claude/ to repository root for easier access via curl
• Fixed ask_input by redirecting prompt to stderr (line 99), allowing input to display properly
• Introduced INSTALL_DIR for repo root, set PAI_DIR to .claude directory (v0.6.0+ structure)
• Use $SHELL variable for shell detection instead of runtime variables, added fish support
• Rewrote Claude Code integration to detect and backup existing directories/symlinks before linking
• Auto-update settings.json with user's custom AI name, color, PAI_DIR, and PAI_HOME values

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The context/CLAUDE.md file was removed in the repository restructuring
and apprently relevant context is now attached automatically.
danielmiessler pushed a commit that referenced this pull request Oct 27, 2025
Merging comprehensive setup.sh fixes that resolve critical installation bugs:

**Critical Fixes:**
- ✅ Creates ~/.claude/hooks symlink (hooks were never firing without this!)
- ✅ Creates ~/.claude/skills symlink (skills were never loading!)
- ✅ Creates ~/.claude/scratchpad directory  
- ✅ Fixes PAI_DIR path bug (settings.json symlink pointed to wrong location)
- ✅ Adds Linux support with platform detection (Debian/Ubuntu tested)
- ✅ Fixes prompt display issues for curl piping
- ✅ Git stash/pop for safe re-runs and testing

**Testing:**
- Tested on Debian 13.1 and Ubuntu MATE 24.04
- Comprehensive error handling and backup logic
- Proper user prompts and safety checks

**Credit:**
Huge thanks to @0xsalt for the extensive testing and comprehensive fix!

This PR fixes 6 out of 7 critical bugs (86%) - the remaining context/CLAUDE.md cleanup was added separately.

Related: Addresses issues mentioned in #67 and #62
@danielmiessler
Copy link
Copy Markdown
Owner

Thank you @uhbuhb for the comprehensive PR identifying the v0.6.0 restructuring issues!

Your PR correctly identified several critical bugs:
✅ PAI_DIR path bugs (setup.sh pointing to wrong locations)
✅ context/CLAUDE.md cleanup from agent files
✅ Prompt display issues
✅ Settings.json auto-update

Why we're not merging this PR:
We just merged PR #54 which includes most of your fixes plus several additional critical fixes:

  • Missing ~/.claude/hooks symlink (the Missing references? #1 showstopper)
  • Missing ~/.claude/skills symlink (also critical)
  • Linux platform support
  • Scratchpad directory creation
  • Git stash/pop for safe re-runs

The context/CLAUDE.md cleanup you identified was added separately in commit c36143e.

Your analysis was excellent!
You were the first to identify that the v0.6.0 restructure broke setup.sh. Your PR helped us understand the scope of the problem.

Note on setup.sh location:
We kept setup.sh in .claude/ rather than moving to repo root to avoid breaking existing documentation and curl installation instructions.

Thank you for the thorough analysis and contribution! 🙏

@danielmiessler
Copy link
Copy Markdown
Owner

Closing as the issues are now fixed in main via PR #54 + commit c36143e. Thank you for identifying the v0.6.0 issues!

rikitikitavi2012-debug added a commit to rikitikitavi2012-debug/PAI that referenced this pull request Mar 30, 2026
…essler#62)

Adds a suite of cross-reference tests to ensure that the primary
documentation markdown files correctly link to each other and that
the internal paths actually exist. Fixed a broken dynamic state path
(work.json -> events.jsonl) in v4.0-alpha.md.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: rikitikitavi2012-debug <240362902+rikitikitavi2012-debug@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants