Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 4.29 KB

File metadata and controls

78 lines (52 loc) · 4.29 KB

Copilot Cleaner

Copilot Cleaner is a local cross-platform C# Avalonia desktop app for reviewing and cleaning GitHub Copilot session-state folders.

By default it scans:

~/.copilot/session-state

and moves selected session folders to:

~/.copilot/old_session-state

Features

  • Streams session rows into the grid while scanning continues in the background.
  • Reads each session folder and displays high-value cleanup hints from vscode.metadata.json, copilotshell.json, workspace.yaml, and top-level session files.
  • Shows Has copilotshell.json, workspace.cwd, Last modified, In Copilot SDK list, workspace.git_root, workspace.branch, workspace.summary, and metadata.origin as first-class main-grid columns.
  • Shows all flattened metadata values and a lazily loaded recursive file list for the selected session folder.
  • Automatically loads and displays SDK-visible Copilot sessions in a separate tab using GitHub.Copilot.SDK.
  • Sorts Session State and Copilot SDK columns with multi-column sorting applied in visible left-to-right column order and active precedence/direction shown in grid headers.
  • Allows column drag-and-drop reordering.
  • Aggregates rows by one or more visible columns, with nested group-level checkboxes for bulk selection.
  • Moves selected session folders to a configurable target directory.
  • Deletes selected session folders after confirmation.
  • Deletes selected SDK-visible sessions through the Copilot SDK after confirmation.

Run

dotnet run

Press Ctrl+C in the terminal to shut down a dotnet run session.

Build

dotnet restore CopilotCleaner.csproj
dotnet build CopilotCleaner.csproj --configuration Release

License Notices

Copilot Cleaner is licensed under the MIT License in LICENSE. Third-party dependency attributions are tracked in THIRD_PARTY_NOTICES.md. Both files are copied into build and publish output so release artifacts carry the license information with the app.

The same license files are embedded into the app and displayed on the About / Licenses tab, with the main application license first and third-party notices after it.

Run the license guardrail before merging dependency changes:

./Scripts/Check-Licenses.ps1

The check restores the project when needed, reads the NuGet dependency graph, verifies approved license metadata for packages with compile/runtime/native assets, and fails if LICENSE or THIRD_PARTY_NOTICES.md is missing or stale. CI also verifies that publish output contains both license files and retains any bundled GitHub Copilot CLI LICENSE.md file.

To create a framework-dependent publish output for a target runtime:

dotnet publish CopilotCleaner.csproj --configuration Release --runtime win-x64 --self-contained false --output artifacts/CopilotCleaner-win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
dotnet publish CopilotCleaner.csproj --configuration Release --runtime linux-x64 --self-contained false --output artifacts/CopilotCleaner-linux-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
dotnet publish CopilotCleaner.csproj --configuration Release --runtime osx-arm64 --self-contained false --output artifacts/CopilotCleaner-osx-arm64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true

Release

GitHub Actions builds the app for Windows, Linux, and macOS for pushes and pull requests to main. Tags that match v* run the release workflow, publish self-contained win-x64, win-arm64, linux-x64, osx-x64, and osx-arm64 ZIP artifacts, and create a GitHub Release.

Cross-Platform Status

The app now targets net8.0 and uses Avalonia for the desktop UI, including cross-platform folder pickers. The service and model layers use portable .NET filesystem and parsing APIs, while cleanup behavior still depends on the local Copilot session-state layout and Copilot SDK/CLI availability on the host system.

SDK and File Parsing

The cleaner uses direct file parsing for local session-state folder details because those files are the cleanup target for move/delete operations. It uses the official GitHub.Copilot.SDK package for Copilot session enumeration and SDK-managed session deletion. The app does not directly read or write the root session-store.db.