rdev/cmd/sdlc/cmd_archive.go
jordan f22b220c6d feat: add SDLC branch management, merge, archive, and orchestrator APIs
Add branch lifecycle commands (branch, merge, archive) to the SDLC CLI.
Introduce orchestrator handler and service for multi-step SDLC workflows.
Expand skeleton template with 15 Claude commands covering the full feature
lifecycle. Extend classifier rules, error types, and executor port for
branch operations. Split rules.go and classifier_test.go to stay within
500-line limit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:30:03 -07:00

49 lines
885 B
Go

package main
import (
"fmt"
"github.com/orchard9/rdev/internal/sdlc"
"github.com/spf13/cobra"
)
var archiveCmd = &cobra.Command{
Use: "archive <slug>",
Short: "Archive a released feature",
Args: cobra.ExactArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
root := mustResolveRoot()
slug := args[0]
if err := sdlc.ArchiveFeature(root, slug); err != nil {
return err
}
// Remove from active work in state
state, err := sdlc.LoadState(root)
if err != nil {
return err
}
state.RemoveActiveFeature(slug)
state.RecordAction("archived", slug, "cli")
if err := state.Save(root); err != nil {
return err
}
if jsonOutput {
printJSON(map[string]string{
"feature": slug,
"status": "archived",
})
return nil
}
fmt.Printf("Archived: %s\n", slug)
return nil
},
}
func init() {
rootCmd.AddCommand(archiveCmd)
}