WIP: A simple cli for daily tangled use cases and AI integration. This is for my personal use right now, but happy if others get mileage from it! :)

Resolve DIDs to handles in command output #9

open opened by markbennett.ca

Context#

The tangled issue view command currently displays the author as a raw DID:

Issue #4 [OPEN]
Title: PR Phase 1: Create, List, and View Pull Requests
Author: did:plc:b2mcbcamkwyznc5fkplwlxbf
Created: today

A raw DID like did:plc:b2mcbcamkwyznc5fkplwlxbf is opaque — it carries no meaningful information for a human reader and wastes tokens in LLM workflows. The tangled auth status command already resolves the logged-in user's DID to a handle (@markbennett.ca), so the resolution capability exists in the codebase.

Tasks#

  • Create src/utils/at-handle.ts with a resolveHandle(did: string): Promise<string> function that returns the human-readable handle for a given DID, or falls back to the raw DID if resolution fails.
  • Audit all commands that display an author, actor, or identity field and update them to use resolveHandle(). Known locations to update include:
    • tangled issue viewAuthor: field
    • Any other commands added in future that display a DID to the user
  • Use the AT Protocol identity resolution (e.g. com.atproto.identity.resolveHandle or the reverse DID document lookup) to fetch the handle.
  • Fall back gracefully to displaying the raw DID if resolution fails or is unavailable.
  • Cache resolved handles within a single command invocation to avoid redundant network calls when the same DID appears multiple times.
  • Add tests for resolveHandle() covering success, failure/fallback, and cache behaviour.

Notes#

The resolution should live in src/utils/at-handle.ts so it is reusable across all commands, following the project pattern of keeping utilities in src/utils/. This utility will become increasingly useful as more commands (PR view, repo view, etc.) are added that display actor information.

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:b2mcbcamkwyznc5fkplwlxbf/sh.tangled.repo.issue/3mejtwm7u7i2f