An unofficial terminal client for Tangled, optimized for humans and agents. tgcli.wisp.place
README.md

tg

A command-line client for Tangled, the git forge built on atproto.

A tg terminal session listing and viewing labeled issues on tangled.org/core, browsing and inspecting pull requests, searching repositories across Knots, and checking Spindle pipeline status.

tg is an analogue to the GitHub CLI (gh). It reads from the Bobbin appview and writes through authenticated PDS records and Knot RPCs.

  • Issues and pull requests. List, filter by label, view, comment on, check out, and merge tickets and pull requests with ruled tables, label badges, and rendered Markdown.
  • Repositories and pipelines. Clone by handle/repo or repository DID, manage forks, labels, strings, and SSH keys, and inspect Spindle pipeline runs and logs.
  • Structured output. Pass --json for highlighted terminal JSON (or plain JSON when piped) and --markdown for raw GitHub-flavored Markdown on any command.
  • Agent integration. Expose Tangled tools to coding agents through the tgmcp MCP server or the included agent skill.

Install #

brew tap alyraffauf/tap
brew trust alyraffauf/tap
brew install alyraffauf/tap/tg

Nix (latest dev release) #

nix profile add github:alyraffauf/tg

From source #

go install github.com/alyraffauf/tg/cmd/tg@latest

Quick start #

# Log in (OAuth, or pass an app password for headless use)
tg auth login alice.example.com

# Clone a repository
tg repo clone microcosm.blue/microcosm-rs

# Clone by repository DID
tg repo clone did:plc:example

# Work with issues and pull requests
tg issue list
tg issue create --body "Details" "Bug report"
tg pr create --title "Add feature" --base main
tg pr merge <rkey>

Inside a cloned Tangled repository, tg detects the target from Git remotes, checking origin first. It recognizes remotes that identify a repository by handle/repo or by repository DID. Hosted Tangled remotes support SSH, Git, HTTP, and HTTPS URLs. Custom Knot remotes support SSH and HTTPS URLs, and tg verifies a custom Knot against the repository record before accepting it.

When a repository record contains a repository DID, tg writes that DID into new Git remotes. Automatically selected Knots use the tangled.org proxy. An explicitly configured Knot uses a direct remote and its configured SSH port. DID remotes stay valid after handle changes, repository renames, and transfers. If tg cannot resolve the repository record for an SSH clone, it creates a handle/repo remote and prints the resolution error as a warning.

MCP server #

The tgmcp package exposes Tangled tools to MCP clients. Run it from this checkout with nix run .#tgmcp, which uses tg from the same checkout.

Documentation #

  • Agent skill for using tg with a coding agent
  • Command reference, also available via tg <command> --help and the man pages installed by the Nix package (man tg, man tg-issue-list)
  • Authentication covering OAuth and app-password login, multiple accounts, and keyring token storage
  • Configuration covering the config file, environment variables, and flags

Contributing #

See CONTRIBUTING.md for the development workflow and an overview of the codebase.

License #

See LICENSE.