Commit Graph

10 Commits

Author SHA1 Message Date
catlog22
b4e09213e4 fix(installer): prevent deletion of current manifest in Bash version
Issue:
- In Bash version, new_install_manifest creates file immediately
- save_install_manifest calls remove_old_manifests_for_path
- This deletes ALL manifests for the path, including the new one
- Result: "WARNING: Failed to save installation manifest"

Solution:
- Add current_manifest_file parameter to remove_old_manifests_for_path
- Skip deletion if file matches current manifest
- Pass manifest_file to exclude it from deletion

Note: PowerShell version does not have this issue because it creates
the manifest file AFTER deleting old ones (hashtable → file conversion)
2025-11-17 22:51:14 +08:00
catlog22
3f7db2fdbc refactor(installer): implement manifest deduplication for same installation paths
- Add Remove-OldManifestsForPath function to automatically clean old manifests
- Modify Save-InstallManifest to remove old manifests before saving new one
- Update Get-AllInstallManifests to return only latest manifest per installation path
- Apply same strategy to both Install-Claude.ps1 (PowerShell) and Install-Claude.sh (Bash)

Benefits:
- Each installation location registers only once
- Only latest version manifest is retained
- Uninstall UI shows only latest version per location
- Prevents manifest file accumulation
2025-11-17 22:48:54 +08:00
catlog22
2788cf7da4 refactor(installer): implement incremental merge strategy with critical config backup
Changes:
- Switch from full directory replacement to incremental merge for all directories (.claude, .codex, .gemini, .qwen)
- Preserve user's custom files and folders during installation
- Add priority backup for critical config files:
  - .codex/AGENTS.md
  - .gemini/GEMINI.md, CLAUDE.md
  - .qwen/QWEN.md
- Only overwrite files present in installation package
- Auto-cleanup empty backup folders
- Update both PowerShell and Bash installers with consistent behavior

Benefits:
- Non-destructive updates that preserve user customizations
- Safer upgrade path with automatic backup
- Better user experience during reinstallation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 16:13:19 +08:00
catlog22
436c7909b0 feat: 添加完整的卸载功能支持
- 添加 -Uninstall 参数支持交互式和命令行卸载
- 实现 manifest 跟踪系统,记录每次安装的文件和目录
- 支持多个安装的选择性卸载
- 修复关键 bug: 从源目录扫描文件而非目标目录,避免误删用户文件
- 添加操作模式选择 UI (Install/Uninstall)
- 自动迁移旧版 manifest 到新的多文件系统
- PowerShell 和 Bash 版本功能完全对等

Closes #5

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 10:24:50 +08:00
catlog22
be2d0f24b6 Sync Install-Claude.sh with Install-Claude.ps1: Selective folder replacement
**Summary:**
Applied the same selective replacement logic from Install-Claude.ps1 to Install-Claude.sh (Bash version).

**Changes:**
- Added `backup_and_replace_directory` function for folder-level operations
- Modified `install_global` to use selective replacement for .claude, .codex, .gemini, .qwen
- Modified `install_path` to use selective replacement for local folders and config directories
- Maintained `merge_directory_contents` for backward compatibility

**New Installation Flow:**
1. Backup entire existing directory to timestamped backup folder
2. Only remove items in destination that match source item names
3. Copy source items to destination
4. Preserve all other files in destination directory

**Benefits:**
- Protects user-created files and session data
- Only updates files that come from installation source
- Safer incremental updates
- Consistent behavior across PowerShell and Bash versions

**Example:**
Source: .claude/{commands, workflows, scripts}
Destination before: .claude/{commands, workflows, custom.json, .workflow/}
Destination after: .claude/{commands, workflows, scripts, custom.json, .workflow/}

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 23:57:12 +08:00
catlog22
a03a9039d6 fix: add version tracking support to Install-Claude.sh
- Add -SourceVersion, -SourceBranch, -SourceCommit parameters
- Add create_version_json function to create version.json
- Add .qwen directory support
- Fix get_installation_mode output redirection
- Align with PowerShell version Install-Claude.ps1

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 22:08:53 +08:00
catlog22
4b578285ea refactor: Enhance tool write protection and lower Bash requirement
- Add explicit write operation protection in intelligent-tools-strategy
  - Require MODE=write or MODE=auto for local codebase modifications
  - Default all tools to read-only analysis mode
  - Convert all Chinese text to English for consistency
- Lower Bash version requirement from 4.0 to 2.0 in Install-Claude.sh
  - Align with install-remote.sh requirements
  - Improve compatibility with older systems

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 00:09:17 +08:00
catlog22
3067b8bda6 feat: Add .codex and .gemini agent configuration support
- Add .codex/Agent.md: Codex agent execution protocol
- Add .gemini/CLAUDE.md: Gemini agent execution protocol
- Update Install-Claude.ps1: Install .codex/.gemini to user profile (global) or target dir (path mode)
- Update Install-Claude.sh: Same installation support for bash
- Update intelligent-tools-strategy.md: Add MODE field definitions for Gemini/Qwen/Codex
- Update README.md: Add installation notes and workflow selection guide
- Update README_CN.md: Add Chinese version of installation notes and workflow guide

Installation behavior:
- Global mode: .codex and .gemini install to ~/.codex and ~/.gemini
- Path mode: .codex and .gemini install to <target-dir>/.codex and <target-dir>/.gemini
- Automatic backup of existing files before installation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 15:24:33 +08:00
catlog22
d6f857ffa8 fix: Display installation mode menu in Install-Claude.sh
- Redirect menu prompts to stderr to prevent capture by command substitution
- Fixes issue where installation options were not visible to user
- Menu now displays correctly: "Global" and "Path" installation modes

Issue: When get_user_choice output was captured by $(command),
the menu display was suppressed because stdout was being captured.

Solution: Output all user-facing prompts to stderr (&2) while
keeping the selected value on stdout for function return.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 22:31:33 +08:00
catlog22
ef57dd5879 feat: Add native Linux/macOS installation support
- Create Install-Claude.sh for native Bash installation
- Update install-remote.sh to call Install-Claude.sh instead of PowerShell
- Move installation section to top of README files
- Add prominent shell installation instructions for all platforms
- Support true cross-platform installation without PowerShell dependency

Installation methods:
- Windows: PowerShell (install-remote.ps1 + Install-Claude.ps1)
- Linux/macOS: Bash (install-remote.sh + Install-Claude.sh)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 22:26:23 +08:00