feat(crew): add crew configuration to rigs.json for cross-machine sync

Add CrewRegistryConfig to RigEntry allowing crew members to be defined
in rigs.json and synced across machines. The new `gt crew sync` command
creates missing crew members from the configuration.

Configuration example:
  "rigs": {
    "gastown": {
      "crew": {
        "theme": "mad-max",
        "members": ["diesel", "chrome", "nitro"]
      }
    }
  }

Closes: gt-tu4
This commit is contained in:
nux
2026-01-24 16:48:51 -08:00
committed by John Ogle
parent f01ae03d40
commit defc97216f
2 changed files with 221 additions and 4 deletions

View File

@@ -163,10 +163,11 @@ type RigsConfig struct {
// RigEntry represents a single rig in the registry.
type RigEntry struct {
GitURL string `json:"git_url"`
LocalRepo string `json:"local_repo,omitempty"`
AddedAt time.Time `json:"added_at"`
BeadsConfig *BeadsConfig `json:"beads,omitempty"`
GitURL string `json:"git_url"`
LocalRepo string `json:"local_repo,omitempty"`
AddedAt time.Time `json:"added_at"`
BeadsConfig *BeadsConfig `json:"beads,omitempty"`
Crew *CrewRegistryConfig `json:"crew,omitempty"`
}
// BeadsConfig represents beads configuration for a rig.
@@ -175,6 +176,18 @@ type BeadsConfig struct {
Prefix string `json:"prefix"` // issue prefix
}
// CrewRegistryConfig represents crew configuration for a rig in rigs.json.
// This enables cross-machine sync of crew member definitions.
type CrewRegistryConfig struct {
// Theme selects the naming theme for crew members (e.g., "mad-max", "minerals").
// Used when displaying crew member names and for consistency across machines.
Theme string `json:"theme,omitempty"`
// Members lists the crew member names to create on this rig.
// Use `gt crew sync` to create missing members from this list.
Members []string `json:"members,omitempty"`
}
// CurrentTownVersion is the current schema version for TownConfig.
// Version 2: Added Owner and PublicName fields for federation identity.
const CurrentTownVersion = 2