Skip to content

feat: add registry command to manage global and local skill registries, drop built-in registries#19

Open
jakemac53 wants to merge 14 commits into
serverpod:mainfrom
jakemac53:repositories
Open

feat: add registry command to manage global and local skill registries, drop built-in registries#19
jakemac53 wants to merge 14 commits into
serverpod:mainfrom
jakemac53:repositories

Conversation

@jakemac53
Copy link
Copy Markdown
Collaborator

@jakemac53 jakemac53 commented May 13, 2026

This task ended up snowballing a lot and includes various registry related improvements and a new set of commands:

  • Adds registry add, registry list, and registry remove commands.
    • These support both git URIs and owner/repo formats (which infers GitHub), as trailing arguments. Multiple registries can be added/removed at time.
  • Adds a global config file to store permanent configuration for a machine.
  • Adds support for globally installed registries as well as project level registries.
    • Includes tracking back links to where registry skills were installed so that when you remove a global registry it can go clean up all of those skills.
  • Adds support for running global migrations, and adds a migration for existing projects. It will ask if they want to retain the existing registries or not. This supports a graceful migration for existing users.
  • The API can still just provide its own list of registries, so serverpod can automatically provide registries if it wants. But the core package does not have any built in registries.
  • Registry layout (flat vs nested) is now inferred and not hard coded in the config.

Closes dart-lang/ai#463

Note that this PR and #14 are stepping on each toes a bit, whichever lands first though I can reconcile the other one. Or possibly we should just not do #14, as deleting .dart_tool will end up also effectively removing any locally installed registries as well, I am a bit unsure about that.

@jakemac53 jakemac53 marked this pull request as ready for review May 15, 2026 18:00
@jakemac53
Copy link
Copy Markdown
Collaborator Author

cc @vlidholt I have a few prs out if you could help me get reviews :)

@marcelomendoncasoares
Copy link
Copy Markdown
Contributor

marcelomendoncasoares commented May 21, 2026

Note that this PR and #14 are stepping on each toes a bit, whichever lands first though I can reconcile the other one. Or possibly we should just not do #14, as deleting .dart_tool will end up also effectively removing any locally installed registries as well, I am a bit unsure about that.

Hi @jakemac53! I just approved and merged your other #14 PR, but only afterwards I saw this note. Indeed, losing registries on a flutter clean would not be a good UX. However, do we need registries to be managed imperatively? How about using a skills key on the workspace or package pubspec.yaml? Then a next skills get will read the declared registries and sync.

Also, whenever you need an opinion or review, just mark me on a comment or for review and I'll try to contribute. But feel free to merge other smaller/simple changes directly.

@jakemac53
Copy link
Copy Markdown
Collaborator Author

How about using a skills key on the workspace or package pubspec.yaml? Then a next skills get will read the declared registries and sync.

I don't think the pubspec is a good place because in many cases you wouldn't want these settings to be persistent across all users (maybe some developers of the package want certain skills but others don't etc).

There will also be a lot more configuration and data stored here in the future - specific information about exactly which skills were installed, at what versions, etc etc. That information is almost certainly specific to an individual user.

Also, whenever you need an opinion or review, just mark me on a comment or for review and I'll try to contribute. But feel free to merge other smaller/simple changes directly.

Ok, I do generally want reviews but I could add a googler for those reviews instead for some of these

@jakemac53
Copy link
Copy Markdown
Collaborator Author

Another idea I had to resolve this is to basically have a "recovery" mode based on metadata injected into each installed skill directory. So if this package installs a skill it dumps a file in there saying where it came from, also some of the info such as the version or hash of its contents. Some of that data may only exist in the skill install dir.

This way we could recover the config as long as any skill was in fact installed from a registry.

@jakemac53
Copy link
Copy Markdown
Collaborator Author

cc @kenzieschmoll did you want to look at this?

I am curious what your thoughts are in particular around the local configuration location.

@jakemac53
Copy link
Copy Markdown
Collaborator Author

jakemac53 commented May 22, 2026

Ugh, now the file name in the test is 2 characters too long for windows. Fun. worked around this with some git foo

Comment thread lib/src/commands/get_skills.dart Outdated
final globalConfigFile = File(globalConfigPath);
final globalConfig = await GlobalConfig.loadOrEmpty(globalConfigFile);

final removalLists = await (rest.isEmpty
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should there be an easy way to remove all?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think its as necessary for this one, you won't have nearly as many registries as skills.

Comment thread lib/src/core/migration.dart Outdated
Comment on lines +348 to +349
final parts = arg.split('/');
if (parts.length != 2) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

would a git uri pass this check?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This whole code path is only meant to handle the owner/repo format, which we special case for GitHub repos.

Anything with a : or an @ (http or ssh URIs) will fall back to the simpler case where we just use the URI directly.

Comment thread lib/src/commands/skills_command.dart Outdated
Comment thread lib/src/commands/skills_command_runner.dart
Comment thread lib/src/commands/skills_command_runner.dart Outdated
Comment thread lib/src/commands/registry_command.dart
@jakemac53 jakemac53 requested a review from kenzieschmoll May 26, 2026 16:50
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.

Drop support for built in skill repositories

3 participants