Skip to content

feat: add --project scope to uninstall - #177

Open
unicoderbot[bot] wants to merge 2 commits into
mainfrom
unicoder/issue-139
Open

unicoderbot[bot] wants to merge 2 commits into
mainfrom
unicoder/issue-139

Conversation

@unicoderbot

@unicoderbot unicoderbot Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Closes #139. Part of #136.

What

uninstall --project [dir] now reverses what install --project recorded in the project's .vgv_ai/manifest.json. That includes the plugin files copied under .vgv_ai/plugins/. Files the manifest doesn't record, such as the repo's AGENTS.md, are never touched.

How

  • Shared project option: Extracted the --project flag and scope resolution out of InstallCommand into a ProjectSelection mixin. install and uninstall now use the same code (addProjectOption / selectScope).
  • Scope.cleanupRoot(owner): New method on Scope that says where empty-directory cleanup stops.
    • UserScope keeps its previous behavior: the harness config directory, or the skills root for shared files.
    • ProjectScope uses the project root, so folders like .codex and .vgv_ai/plugins are removed once they are empty.
  • Empty-directory cleanup: deleteEmptyDirectories now takes a Scope. A new deleteEmptyAbove helper replaces the private copy in InstallCommand, so both commands share it.
  • Manifest folder: ReportingManifestStore.save now removes the manifest's folder (such as a project's .vgv_ai) once the manifest is deleted and the folder is empty. A folder that still holds other files is kept. If it can't be deleted, the command warns instead of failing.
  • Shared files: In a project, the shared skills and the plugin files are removed only with the last harness, the same rule the user scope already applied to skills. The "removed" and "kept" messages now name the plugin files too, and the "kept" message shows the exact uninstall --project <dir> command to run.
  • Docs: The README documents the new scope and drops uninstall --project from the "not installed yet" list.

Tests

Added --project tests to uninstall_command_test.dart:

  • Removal of everything the project manifest records.
  • Resolving the project directory from a relative argument.
  • Leaving the home install alone.
  • Keeping shared files while other harnesses remain.
  • --check changing nothing.
  • Keeping .vgv_ai while it holds other files, and warning when it can't be deleted.
  • A restore test after a real install that checks team-owned files such as AGENTS.md stay untouched.

The existing "shared skills kept" message assertion was updated for the new wording.

Closes #139

Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
@unicoderbot
unicoderbot Bot requested a review from a team as a code owner December 2, 2026 14:21
Comment on lines +202 to +204
ProjectScope(:final root) =>
'skills in ${scope.skillsRoot.path} and the plugin files in '
'${root.fileSystem.path.join(root.path, '.vgv_ai', 'plugins')}',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.vgv_ai/plugins is hardcoded here and again in ProjectScope.pluginRoot. Expose the plugins directory from ProjectScope, for example a pluginsDirectory getter, so the layout is defined in one place.

static String _uninstallAll(Scope scope) => switch (scope) {
UserScope() => 'vgv_ai uninstall',
ProjectScope(:final root) =>
'vgv_ai uninstall --${ProjectSelection.projectFlag} ${root.path}',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root.path goes into a command the user is told to copy, but it isn't quoted. A project under a path like ~/My Projects/app gives a command that fails. Quote the path.

Suggested change
'vgv_ai uninstall --${ProjectSelection.projectFlag} ${root.path}',
"vgv_ai uninstall --${ProjectSelection.projectFlag} '${root.path}'",

@marcossevilla

Copy link
Copy Markdown
Member

/unicoder /address-review

@unicoderbot

unicoderbot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

On it, I'll address the review comments and push the changes.

  • Preparing environment
    • Cloning repository
    • Setting up dev environment
  • Reviewing feedback
  • Working on changes
  • Pushing updates

I've pushed changes to address the feedback, but the coding agent reported the work is incomplete: Both review comments are addressed but tests could not run because Very Good CLI is too old.

Review the new commits before considering the feedback fully addressed.

Co-authored-by: marcossevilla <marcossevilla@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.

feat: add a project scope to uninstall

2 participants