A terminal client for Tangled.
tui go tangled cli
5

Configure Feed

Select the types of activity you want to include in your feed.

cli/repo: add view subcommand and include author in output

Aly Raffauf (Jul 10, 2026, 3:34 PM EDT) 53be7bf9 d6cba46f

+67 -2
+1
internal/cli/output.go
··· 49 49 type repoItem struct { 50 50 Name string `json:"name"` 51 51 URI string `json:"uri"` 52 + Author string `json:"author"` 52 53 Knot string `json:"knot"` 53 54 Description string `json:"description,omitempty"` 54 55 CreatedAt string `json:"createdAt"`
+3 -2
internal/cli/repo_list.go
··· 38 38 return fmt.Errorf("list repos for %q: %w", handle, err) 39 39 } 40 40 41 - items := buildRepoItems(repos.Items) 41 + items := buildRepoItems(repos.Items, handle) 42 42 return output(items, renderRepoList) 43 43 }, 44 44 } ··· 73 73 return ident.Handle.String(), nil 74 74 } 75 75 76 - func buildRepoItems(items []tangled.Repo) []repoItem { 76 + func buildRepoItems(items []tangled.Repo, author string) []repoItem { 77 77 result := make([]repoItem, 0, len(items)) 78 78 79 79 for _, item := range items { ··· 88 88 result = append(result, repoItem{ 89 89 Name: name, 90 90 URI: item.URI, 91 + Author: author, 91 92 Knot: item.Value.Knot, 92 93 Description: item.Value.Description, 93 94 CreatedAt: item.Value.CreatedAt,
+62
internal/cli/repo_view.go
··· 1 + package cli 2 + 3 + import ( 4 + "fmt" 5 + 6 + "github.com/alyraffauf/tg/tangled" 7 + "github.com/spf13/cobra" 8 + ) 9 + 10 + var repoViewCmd = &cobra.Command{ 11 + Use: "view <handle/repo>", 12 + Short: "View a Tangled repository", 13 + Long: `View details for a Tangled repository.`, 14 + Args: cobra.ExactArgs(1), 15 + RunE: func(cmd *cobra.Command, args []string) error { 16 + ctx := cmd.Context() 17 + 18 + handle, repo, err := parseHandleRepo(args[0]) 19 + if err != nil { 20 + return err 21 + } 22 + 23 + ident, err := resolver.ResolveHandle(ctx, handle) 24 + if err != nil { 25 + return fmt.Errorf("resolve handle %q: %w", handle, err) 26 + } 27 + 28 + repoURI := fmt.Sprintf("at://%s/sh.tangled.repo/%s", ident.DID, repo) 29 + 30 + var tangledRepo *tangled.Repo 31 + tangledRepo, err = client.GetRepo(ctx, repoURI) 32 + if err != nil { 33 + return fmt.Errorf("get repo %s/%s: %w", handle, repo, err) 34 + } 35 + 36 + name := tangledRepo.Value.Name 37 + if name == "" { 38 + name = repo 39 + } 40 + 41 + result := repoItem{ 42 + Name: name, 43 + Author: handle, 44 + URI: repoURI, 45 + Knot: tangledRepo.Value.Knot, 46 + Description: tangledRepo.Value.Description, 47 + CreatedAt: tangledRepo.Value.CreatedAt, 48 + RepoDid: tangledRepo.Value.RepoDid, 49 + } 50 + return output(result, func(item repoItem) { 51 + fmt.Printf("Name: %s\n", item.Name) 52 + fmt.Printf("Description: %s\n", item.Description) 53 + fmt.Printf("URI: %s\n", item.URI) 54 + fmt.Printf("Knot: %s\n", item.Knot) 55 + fmt.Printf("Created: %s\n", item.CreatedAt) 56 + if item.RepoDid != "" { 57 + fmt.Printf("Repo DID: %s\n", item.RepoDid) 58 + } 59 + }) 60 + 61 + }, 62 + }
+1
internal/cli/root.go
··· 57 57 prCmd.AddCommand(prViewCmd) 58 58 59 59 rootCmd.AddCommand(repoCmd) 60 + repoCmd.AddCommand(repoViewCmd) 60 61 repoCmd.AddCommand(repoCloneCmd) 61 62 repoCmd.AddCommand(repoCreateCmd) 62 63 repoCmd.AddCommand(repoListCmd)