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.
1234567891011121314151617181920212223242526272829303132333435363738package cli
import ( "io"
"github.com/alyraffauf/tg/internal/app" "github.com/spf13/cobra")
func newAuthListCommand(service *app.Service) *cobra.Command { return &cobra.Command{ Use: "list", Short: "List logged-in accounts", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, _ []string) error { results, err := service.AuthAccounts(cmd.Context()) if err != nil { return err } return output(cmd, results, func(items []app.AuthAccountResult) { renderAuthAccountList(cmd.OutOrStdout(), items) }) }, }}
func renderAuthAccountList(writer io.Writer, items []app.AuthAccountResult) { rows := make([][]string, 0, len(items)) for _, item := range items { active := "" if item.Active { active = "✓" } rows = append(rows, []string{active, item.Handle, item.DID, item.Method}) } renderTable(writer, []string{"ACTIVE", "HANDLE", "DID", "METHOD"}, rows, "No accounts.")}