TL;DR
aiwg remove all --provider <name> crashes with TypeError: The "path" argument must be of type string. Received an instance of Object before doing any work. Two underlying issues: (1) aiwg remove doesn't recognise the --provider flag at all (silently swallowed by the arg parser), and (2) aiwg remove all treats the literal string all as a plugin id, then explodes downstream when no plugin metadata resolves.
I hit this trying to remove a stale Factory deployment after switching the project from providers: ["factory"] to providers: ["claude"]. There's no documented way to scope aiwg remove to a specific provider, so the natural reach-for-the-flag attempt fails ugly.
Environment (REQUIRED — issues missing any field will be returned for clarification)
Steps to reproduce
# Starting state: aiwg.config has providers:["factory"] from an earlier install,
# you've since switched to claude and want to drop the factory deployment record.
aiwg remove all --provider factory
Expected behavior
One of:
- Best:
aiwg remove accepts --provider <name> and removes only the artifacts deployed to that provider, plus the deployedTo.<provider> block from aiwg.config.
- Acceptable: clear error like
Error: unknown flag --provider; remove takes <plugin-id> [--force] [--keep-data] [--dry-run] so the user knows to pick another path.
- Acceptable:
aiwg remove all errors clearly with Error: plugin id "all" not found; aiwg remove operates on a single plugin id rather than crashing inside path.
Actual behavior
$ aiwg remove all --provider factory
Error: The "path" argument must be of type string. Received an instance of Object
Exit code is non-zero, but no other context (no stack with --verbose, no hint about the flag being unknown).
Suggested fix
The arg parser at tools/plugin/plugin-uninstaller-cli.mjs lines 40–58 only recognises --force, --keep-data, --dry-run. Any other flag (including --provider) is silently dropped and the next positional becomes pluginId. Two changes:
- Reject unknown flags in the parser:
} else if (arg.startsWith('-')) {
console.error(`Error: unknown flag ${arg}`);
console.error(`Usage: aiwg remove <plugin-id> [--force] [--keep-data] [--dry-run]`);
process.exit(2);
}
- Validate the plugin id before path operations. The TypeError originates downstream in
dist/src/plugin/plugin-uninstaller.js when pluginId="all" doesn't resolve and something is passed to a path.* call as undefined/Object. Guard with a "plugin id 'X' not found in registry" check before the path resolution.
Optional but valuable:
- Add
--provider <name> as a real, documented flag — the use case (scoping removal to a single provider when the project is multi-provider) is legitimate and there's no other way to do it today. The workaround is manual: delete the deployed files, then hand-edit ~/.aiwg/aiwg.config to drop deployedTo.<provider>.
Acceptance criteria
Related
- Issues: (no duplicates found via
gh issue list -R jmagly/aiwg --search "remove provider" or "TypeError path argument")
- PRs:
- Tracker source: filed directly (not imported)
Context
Workaround for users hitting this: manually delete the AIWG-deployed artifacts under the unwanted provider's directory (look for files with aiwg:managed frontmatter marker), then hand-edit ~/.aiwg/aiwg.config to remove installed.<bundle>.deployedTo.<provider>. That's what I did to clean up 229 AIWG-managed files from ~/.factory/{droids,rules} after switching to Claude Code.
TL;DR
aiwg remove all --provider <name>crashes withTypeError: The "path" argument must be of type string. Received an instance of Objectbefore doing any work. Two underlying issues: (1)aiwg removedoesn't recognise the--providerflag at all (silently swallowed by the arg parser), and (2)aiwg remove alltreats the literal stringallas a plugin id, then explodes downstream when no plugin metadata resolves.I hit this trying to remove a stale Factory deployment after switching the project from
providers: ["factory"]toproviders: ["claude"]. There's no documented way to scopeaiwg removeto a specific provider, so the natural reach-for-the-flag attempt fails ugly.Environment (REQUIRED — issues missing any field will be returned for clarification)
2026.5.12 [stable]Darwin mac-studio.tail10294f.ts.net 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:58 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T6041 arm64claude-codev26.0.0npm-globalSteps to reproduce
Expected behavior
One of:
aiwg removeaccepts--provider <name>and removes only the artifacts deployed to that provider, plus thedeployedTo.<provider>block fromaiwg.config.Error: unknown flag --provider; remove takes <plugin-id> [--force] [--keep-data] [--dry-run]so the user knows to pick another path.aiwg remove allerrors clearly withError: plugin id "all" not found; aiwg remove operates on a single plugin idrather than crashing insidepath.Actual behavior
Exit code is non-zero, but no other context (no stack with
--verbose, no hint about the flag being unknown).Suggested fix
The arg parser at
tools/plugin/plugin-uninstaller-cli.mjslines 40–58 only recognises--force,--keep-data,--dry-run. Any other flag (including--provider) is silently dropped and the next positional becomespluginId. Two changes:dist/src/plugin/plugin-uninstaller.jswhenpluginId="all"doesn't resolve and something is passed to apath.*call asundefined/Object. Guard with a "plugin id 'X' not found in registry" check before the path resolution.Optional but valuable:
--provider <name>as a real, documented flag — the use case (scoping removal to a single provider when the project is multi-provider) is legitimate and there's no other way to do it today. The workaround is manual: delete the deployed files, then hand-edit~/.aiwg/aiwg.configto dropdeployedTo.<provider>.Acceptance criteria
aiwg remove all --provider factoryeither works (option 1 above) or fails with a clear error naming the unknown flag — no TypeError, no path-argument crash.aiwg remove all(with no flag) errors with "plugin id 'all' not found" or equivalent — not a TypeError.plugin-uninstaller-cli.mjs.--provideris implemented, documented inaiwg remove --help.Related
gh issue list -R jmagly/aiwg --search "remove provider"or"TypeError path argument")Context
Workaround for users hitting this: manually delete the AIWG-deployed artifacts under the unwanted provider's directory (look for files with
aiwg:managedfrontmatter marker), then hand-edit~/.aiwg/aiwg.configto removeinstalled.<bundle>.deployedTo.<provider>. That's what I did to clean up 229 AIWG-managed files from~/.factory/{droids,rules}after switching to Claude Code.