feat: Git repository management commands#533
Merged
Merged
Conversation
…t-repos) Adds three CLI commands for git repository management: - create-repo: Publishes a NIP-34 kind:30617 repo announcement event. The relay creates a bare git repo on disk as a side-effect. - get-repo: Queries kind:30617 by repo identifier (d-tag), optionally filtered by owner pubkey. - list-repos: Queries kind:30617 by author (defaults to self). SDK addition: - build_repo_announcement() builder with full NIP-34 tag support (d, name, description, clone, web, relays) and input validation. NIP-OA auth flows automatically through client.sign_event() — no special per-command handling needed. Clone URLs use multi-value tag format per NIP-34 spec. Any URL scheme is accepted (http, https, git, ssh, nostr, etc.). Includes 8 SDK builder tests + 7 CLI validate_repo_id tests.
wesbillman
approved these changes
May 11, 2026
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds three commands to the Sprout CLI for managing git repositories:
create-repo— Publish a repository announcement, which triggers the relay to provision a bare git repo on disk. Supports optional metadata: name, description, clone URLs, web URL, and preferred relays.get-repo— Look up a repository by its identifier, optionally scoped to a specific owner.list-repos— List repositories owned by you (or another user).Also adds
build_repo_announcementto the SDK — a typed builder for kind:30617 events with full input validation.Why
Until now, creating a git repository on a Sprout relay required manually constructing and signing a NIP-34 kind:30617 event. These commands make it a one-liner:
Once created,
git cloneandgit pushwork automatically via the existing Smart HTTP transport andgit-credential-nostrauth — no additional setup needed.Design
Follows the same pattern as every other CLI command:
client.sign_event()(which handles NIP-OA injection automatically)Repository announcements are parameterized replaceable events — re-publishing with the same identifier updates the metadata in place rather than creating duplicates.
Clone URLs use the NIP-34 multi-value tag format and accept any URL scheme (http, https, ssh, git, nostr, etc.).
Testing