···11+# tg
22+33+`tg` is a command-line client for [Tangled](https://tangled.org), the git forge built on atproto. It is an analogue to the GitHub CLI (`gh`), (for now) built against the read-only [Bobbin](https://docs.tangled.org/bobbin) XRPC API.
44+55+## Installation
66+77+### With Nix
88+99+```bash
1010+nix profile add github:alyraffauf/tg
1111+```
1212+1313+### From source
1414+1515+```bash
1616+go install github.com/alyraffauf/tg/cmd/tg@latest
1717+```
1818+1919+## Usage
2020+2121+`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.
2222+2323+### Repositories
2424+2525+```bash
2626+# List repositories for a user
2727+tg repo list microcosm.blue
2828+2929+# Clone a repository
3030+tg repo clone microcosm.blue/microcosm-rs
3131+3232+# Clone into a custom directory
3333+tg repo clone microcosm.blue/microcosm-rs my-fork
3434+```
3535+3636+### Issues
3737+3838+```bash
3939+# List issues for the current repository
4040+tg issue list
4141+4242+# List issues for an explicit repository
4343+tg issue list microcosm.blue/microcosm-rs
4444+```
4545+4646+### Pull Requests
4747+4848+```bash
4949+# List pull requests
5050+tg pr list
5151+5252+# Check out a pull request as detached HEAD
5353+tg pr checkout 3mporttfqez22
5454+```
5555+5656+## Architecture
5757+5858+- `cmd/tg/` — CLI entry point
5959+- `internal/cli/` — Cobra command tree (`repo`, `issue`, `pr`)
6060+- `internal/gitutil/` — Git operations (clone, fetch, patch apply)
6161+- `tangled/` — Typed client for the Bobbin API (`api.tangled.org`)
6262+- `atproto/` — Identity resolution (handle ↔ DID, PDS discovery)
6363+6464+## Dependencies
6565+6666+- Go 1.26+
6767+- `git` and `ssh` (for clone and PR checkout)
6868+- [`github.com/bluesky-social/indigo`](https://github.com/bluesky-social/indigo) — atproto SDK
6969+- [`github.com/spf13/cobra`](https://github.com/spf13/cobra) — CLI framework
7070+7171+## License
7272+7373+See [LICENSE.md].