Expand description
Common utilities and shared functionality for CLI commands.
This module provides reusable infrastructure for install and update commands:
§Core Components
CommandExecutortrait: Standardized command execution patternCommandContext: Manifest and lockfile management utilitiesOperationModeenum: Distinguishes install vs update for shared logic
§Shared Display Helpers
display_dry_run_results(): Rich dry-run output with CI exit codesdisplay_no_changes(): Context-appropriate “no changes” messages
§Legacy Support
handle_legacy_ccpm_migration(): CCPM to AGPM migration utilitiescheck_for_legacy_ccpm_files(): Detects old CCPM installations
§Lockfile Management
load_lockfile(): Loads lockfile with automatic regenerationsave_lockfile(): Saves lockfile with error handlingbackup_and_regenerate_lockfile(): Recovery from corrupted lockfiles
Structs§
- Command
Context - Common context for CLI commands that need manifest and project information
Enums§
- Operation
Mode - Determines the type of operation being performed for user-facing messages.
Traits§
- Command
Executor - Common trait for CLI command execution pattern
Functions§
- check_
for_ legacy_ ccpm_ files - Check for legacy CCPM files and return a migration message if found.
- display_
dry_ run_ results - Display dry-run results with rich categorization of changes.
- display_
no_ changes - Display “no changes” message appropriate for the operation mode.
- handle_
legacy_ ccpm_ migration - Handle legacy CCPM files by offering interactive migration.
- handle_
legacy_ format_ migration - Handle legacy format migration (old gitignore-managed → agpm/ subdirectory).
- handle_
missing_ gitignore_ entries - Handle missing gitignore entries by offering to add them interactively.