Files
sgard/cmd/sgard/identity.go
Kyle Isom 60c0c50acb Step 30: Targeting CLI commands.
tag add/remove/list for machine-local tags. identity prints full label
set. --only/--never flags on add. target command to set/clear targeting
on existing entries. SetTargeting garden method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:53:07 -07:00

28 lines
453 B
Go

package main
import (
"fmt"
"github.com/kisom/sgard/garden"
"github.com/spf13/cobra"
)
var identityCmd = &cobra.Command{
Use: "identity",
Short: "Show this machine's identity labels",
RunE: func(cmd *cobra.Command, args []string) error {
g, err := garden.Open(repoFlag)
if err != nil {
return err
}
for _, label := range g.Identity() {
fmt.Println(label)
}
return nil
},
}
func init() {
rootCmd.AddCommand(identityCmd)
}