⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@scaryrawr
Copy link
Owner

Make it easier to manage marketplaces and plugins from outside of claude

- Export function to allow reuse in marketplace.ts
- Use HOME env var with homedir() fallback for consistency
- Add enablePlugin() to add plugins to .construct.json
- Add disablePlugin() to remove plugins from config
- Add listEnabledPlugins() to show enabled plugins
- Include comprehensive test coverage
- Add addMarketplace() to clone GitHub marketplaces
- Add removeMarketplace() to unregister and optionally delete
- Add updateMarketplace() to git pull updates
- Add listMarketplaces() to show known marketplaces
- Support GitHub URL and owner/repo shorthand formats
- Include comprehensive test coverage
- Add 'construct plugin' command for plugin management
- Add 'plugin enable/disable' for toggling plugins
- Add 'plugin --list-enabled' flag
- Add 'plugin marketplace' with add/remove/update/list subcommands
- Add mutual exclusivity for update [name] and --all flags
- Improve error messages for invalid subcommand usage
Document the plugin and marketplace commands including:
- CLI usage examples
- Implementation details
- Error handling behavior
- Testing strategy
Copilot AI review requested due to automatic review settings January 15, 2026 20:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds CLI commands for managing plugins and marketplaces externally from Claude, allowing users to enable/disable plugins and add/remove/update marketplaces via the command line.

Changes:

  • Added plugin management commands (enable, disable, list-enabled)
  • Added marketplace management commands (add, remove, update, list)
  • Extended CLI argument parsing to support nested subcommands using yargs

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/scanner.ts Exported getKnownMarketplacesPath() and added HOME environment variable fallback
src/plugin.ts New file implementing plugin enable/disable/list operations
src/plugin.test.ts Comprehensive unit tests for plugin operations
src/marketplace.ts New file implementing marketplace add/remove/update/list operations with git integration
src/marketplace.test.ts Comprehensive unit tests for marketplace operations
src/cli.ts Extended to support nested subcommands for plugin and marketplace management
plugin.md Detailed documentation of the plugin management implementation
index.ts Added command routing for new plugin and marketplace subcommands

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Jan 16, 2026

@scaryrawr I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Jan 16, 2026

@scaryrawr I've opened a new pull request, #6, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings January 16, 2026 01:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +62 to +72
```typescript
export interface CliArgs {
command: "run" | "operator" | "plugin";
// ... existing fields ...
pluginSubcommand?: "enable" | "disable";
listEnabled?: boolean;
marketplaceSubcommand?: "list" | "add" | "remove" | "update";
pluginName?: string;
marketplaceTarget?: string; // marketplace name or URL
updateAll?: boolean;
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The CliArgs interface documentation in plugin.md shows listEnabled as an optional boolean field, but the actual implementation in src/cli.ts uses listEnabledPlugins instead. This inconsistency could confuse developers reading the documentation.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines 25 to 28
await saveConfig({
enabledPlugins: [...enabledPlugins, pluginName],
lastUsed: new Date().toISOString(),
});
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The saveConfig call is missing proper error handling. If the file write fails (due to permissions or disk space issues), the config object will be partially modified in memory but not persisted. Consider wrapping this in a try-catch block and handling errors appropriately, or let the error propagate up to be handled by the caller in index.ts.

Copilot uses AI. Check for mistakes.
Comment on lines +147 to +167
.command(
"update [name]",
"Update marketplaces",
(updateYargs) =>
updateYargs
.positional("name", {
type: "string",
conflicts: "all",
})
.option("all", {
type: "boolean",
alias: "a",
description: "Update all git-based marketplaces",
default: false,
}),
(args) => {
command = "plugin";
marketplaceSubcommand = "update";
marketplaceTarget = args.name as string | undefined;
updateAll = args.all as boolean;
},
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The yargs configuration uses "conflicts" between "name" positional and "all" option for the update command. However, the logic in index.ts (lines 62-73) doesn't handle the case where neither is provided gracefully before reaching the error message. Consider adding validation or documentation to make the expected behavior clearer.

Copilot uses AI. Check for mistakes.
Comment on lines 251 to 264
export async function updateAllMarketplaces(
paths?: MarketplacePaths,
): Promise<void> {
const knownMarketplaces = await readKnownMarketplaces(paths);
const githubMarketplaces = Object.entries(knownMarketplaces).filter(
([, info]) => info.source.source === "github",
);

for (const [name] of githubMarketplaces) {
await updateMarketplace(name, paths);
}

console.log(`Updated ${githubMarketplaces.length} marketplace(s)`);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The updateAllMarketplaces function updates marketplaces sequentially but prints a summary message about the count after all updates complete. However, if any individual update fails (which calls process.exit(1) in runGitCommand), the summary message will never be printed. Consider either handling errors more gracefully or documenting this behavior.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +37 to +44
if (
args.listEnabledPlugins &&
!args.pluginSubcommand &&
!args.marketplaceSubcommand
) {
await listEnabledPlugins();
process.exit(0);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The conditional logic that checks for list-enabled only when no subcommands are present could lead to confusing behavior. If a user runs "construct plugin enable foo --list-enabled", the --list-enabled flag will be silently ignored. Consider either making these mutually exclusive in the yargs configuration or providing a warning when incompatible options are used together.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copilot AI and others added 2 commits January 15, 2026 20:33
* Initial plan

* fix: add check for empty marketplace list in updateAllMarketplaces

Co-authored-by: scaryrawr <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: scaryrawr <[email protected]>
* Initial plan

* fix: preserve all config fields when saving in plugin enable/disable

Co-authored-by: scaryrawr <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: scaryrawr <[email protected]>
Copilot AI review requested due to automatic review settings January 16, 2026 01:34
Copy link

Copilot AI commented Jan 16, 2026

@scaryrawr I've opened a new pull request, #7, to work on those changes. Once the pull request is ready, I'll request review from you.

scaryrawr and others added 3 commits January 15, 2026 20:36
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Jan 16, 2026

@scaryrawr I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Jan 16, 2026

@scaryrawr I've opened a new pull request, #9, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings January 16, 2026 01:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return;
}

await saveConfig({
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Duplicate await saveConfig({ statement on lines 45-47. Line 45 appears to be leftover code that should be removed. The try-catch block starting at line 46 is the intended implementation.

Suggested change
await saveConfig({

Copilot uses AI. Check for mistakes.
@scaryrawr scaryrawr closed this Jan 16, 2026
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.

2 participants