Restructure as PowerShell module with cmdlets#6
Open
jamesc wants to merge 2 commits into
Open
Conversation
- Add MultiCopilot module (psd1, psm1, loader) - Convert scripts to cmdlets: New-CopilotWorktree, Remove-CopilotWorktree, Get-CopilotWorktree, Clear-CopilotWorktree - Add Initialize-CopilotProject cmdlet to scaffold .devcontainer/ templates - Extract shared helpers to Private/GitHelpers.ps1 - Bundle template files in MultiCopilot/Templates/ - Add SupportsShouldProcess (-WhatIf/-Confirm) to destructive cmdlets - Move AMP_API_KEY validation to fail-fast (before container setup) - Remove old scripts/ directory Amp-Thread-ID: https://ampcode.com/threads/T-019cb806-b11a-70be-8c9b-1fb00a8b8ee2 Co-authored-by: Amp <amp@ampcode.com>
…butes merge - Replace $LASTEXITCODE with $? for PowerShell hook success check in Remove-CopilotWorktree - Use bash -c for devcontainer exec to preserve quoted arguments in New-CopilotWorktree - Wrap Get-DefaultBranch in try/finally to ensure Pop-Location runs on error - Use line-by-line comparison instead of regex for .gitattributes merge in Initialize-CopilotProject Amp-Thread-ID: https://ampcode.com/threads/T-019cb823-a1da-74f9-90bd-e2626b6a78bd Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures the repo from loose scripts into a proper PowerShell module (
MultiCopilot), installable viaImport-Module.Changes
New module structure
MultiCopilot.psd1— Module manifest (PSGallery-ready metadata)MultiCopilot.psm1— Auto-loads allPrivate/andPublic/scriptsPrivate/GitHelpers.ps1— Shared helpers extracted from scripts5 cmdlets (replacing 4 scripts)
worktree-up.ps1New-CopilotWorktreeworktree-down.ps1Remove-CopilotWorktreeworktree-status.ps1Get-CopilotWorktreeworktree-cleanup.ps1Clear-CopilotWorktreeInitialize-CopilotProjectKey improvements
[CmdletBinding()]with proper parameter attributes andGet-HelpsupportSupportsShouldProcess(-WhatIf/-Confirm) on destructive cmdletsInitialize-CopilotProjectreplaces manual "copy these files" stepAMP_API_KEYvalidation moved to fail-fast (before container setup)MultiCopilot/Templates/Installation