Something went wrong. Try again.
An unofficial terminal client for Tangled, optimized for humans and agents. tgcli.wisp.place
cli atproto go tangled
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142package cli
import ( "github.com/alyraffauf/tg/internal/app" "github.com/spf13/cobra")
func newIssueViewCommand(service *app.Service) *cobra.Command { var repository string
command := &cobra.Command{ Use: "view <record-key>", Short: "View an issue", Long: `View an issue by its record key, the last part of its at:// URI.
Without --repo, tg uses the origin remote in the current directory.`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() target, err := resolveTargetFlag(ctx, repository, service) if err != nil { return err } view, err := service.ViewIssue(ctx, target, args[0]) if err != nil { return err } return output(cmd, view, func(view *app.ViewResult) { fields := []detailField{ {"Title", view.Title}, {"Status", formatDetailState(cmd.OutOrStdout(), view.State)}, {"Author", view.Author.Handle}, {"Created", localTimestamp(view.CreatedAt)}, } renderDetail(cmd.OutOrStdout(), fields, view.Body) }) }, } command.Flags().StringVarP(&repository, "repo", "R", "", "Target repository as handle/repo") return command}