tg#
tg is a command-line client for Tangled, the git forge built on atproto. It is an analogue to the GitHub CLI (gh), using Bobbin for reads and authenticated PDS/knot writes.
Installation#
With Nix#
nix profile add github:alyraffauf/tg
From source#
go install github.com/alyraffauf/tg/cmd/tg@latest
Usage#
tg auto-detects the repository from the origin remote when run inside a cloned Tangled repo. For now, only ssh origins are supported. You can also pass a fully-qualified handle/repo argument.
Repositories#
# List repositories for a user
tg repo list microcosm.blue
# Create a repository (requires `tg auth login`)
tg repo create my-tool --description "A small tool"
# Create and clone it into the current directory
tg repo create my-tool --clone
# Create and push an existing local repo (at the given path) to the new remote
tg repo create my-tool --push=.
# Clone a repository
tg repo clone microcosm.blue/microcosm-rs
# Clone into a custom directory
tg repo clone microcosm.blue/microcosm-rs my-fork
Issues#
# List issues for the current repository
tg issue list
# List issues for an explicit repository
tg issue list microcosm.blue/microcosm-rs
# Create, comment on, and update an issue
tg issue create --repo microcosm.blue/microcosm-rs --body "Details" "Bug report"
tg issue comment <rkey> --body "I can reproduce this"
tg issue close <rkey>
tg issue reopen <rkey>
tg issue edit <rkey> --title "Updated title"
Pull Requests#
# List pull requests
tg pr list
# Create, comment on, inspect, and update pull requests
tg pr create --title "Add feature" --base main
# Reconstruct the latest round on the current remote target branch
tg pr checkout <rkey>
tg pr diff <rkey>
tg pr comment <rkey> --body "Looks good"
tg pr close <rkey>
tg pr merge <rkey>
Other commands#
tg repo edit, tg repo set-default-branch, tg repo delete --yes, tg repo fork,
tg ssh-key delete, tg browse, tg completion, tg auth token, and tg api are available.
Architecture#
cmd/tg/— CLI entry pointinternal/cli/— Cobra command tree (repo,issue,pr)internal/gitutil/— Git operations (clone, fetch, patch apply)tangled/— Typed client for the Bobbin API (api.tangled.org)atproto/— Identity resolution (handle ↔ DID, PDS discovery)
Dependencies#
- Go 1.26+
gitandssh(for clone and PR checkout)github.com/bluesky-social/indigo— atproto SDKgithub.com/spf13/cobra— CLI framework
License#
See LICENSE.