atproto git client atgc.codes
README.md

atgc #

atgc

Current release: v1.1.0

vibescrobble

ATproto Git Client.

The project page is atgc.codes.

Features #

atgc is intended for CLI workflows against Tangled.

  • Use multiple simultaneous ATProto accounts
  • Log into ATproto via scoped OAuth (no app passwords!)
  • Full support for Tangled's types: pulls, issues, comments, labels, releases, strings and CI, with screenshots, animated gifs and mp4 video in bodies

Agentic support #

atgc is designed to support agentic workflows that run on high parallelism on git worktrees. Current features include:

  • Built-in briefing to explain usage to agents
  • Per-worktree credential switching
  • Per-agent credentials via did.bot
  • Keep an oplog of every operation
  • Agents can file their own issues and board reports

A Claude Code plugin tells each session what Tangled is and how to sign in to atgc. Its marketplace is this repository:

/plugin marketplace add https://tangled.org/permadeath.com/atgc.git
/plugin install atgc@atgc

See plugin/README.md.

Install #

Release notes for each version are at atgc.codes/posts.

atgc installs from source with cargo:

# install the latest release:
cargo install --git https://tangled.org/permadeath.com/atgc --tag v1.1.0 --locked

# or if already checked out:
cargo install --locked --path .

Needs Rust 1.89 or newer, a C compiler, git, and ssh for pushes.

git must be 2.31 or newer; atgc doctor local checks it. atgc is developed and tested on Linux and expected to work on macOS. Native Windows is untested: atgc keeps its state under $XDG_CONFIG_HOME or $HOME, and Windows sets neither.

Quickstart #

PLACEHOLDER-quickstart-vellichor

atgc auth login <handle|did>        # opens your browser; --paste on a headless box
ssh-keygen -t ed25519               # only if you have no SSH key yet
atgc key add                        # publish it, so knots accept your pushes
atgc repo clone <owner>/<name>      # sets the checkout's git identity to your DID
cd <name>
# commit on a branch, then:
atgc pr create                      # pushes the branch and opens the pull
atgc doctor                         # is atgc itself set up?

An agent signs in from its own session, so it gets an agent login. To set one up from your own terminal, add --agent. An agent has no ~/.ssh, so it runs atgc key create in place of the two key lines. atgc agent is the briefing for agents. Without push access, fork first: atgc repo fork <owner>/<name> --clone, then atgc pr create --remote upstream --fork=origin in the clone.

Commands #

Meta #

atgc about                 # info about atgc
atgc agent                 # working notes for AI agents (humans welcome)
atgc agent --json          # the same briefing plus the command tree
atgc help [command]        # the same pages as --help, as a verb

Account management #

Logging in #

atgc auth login <handle|did>    # log in via OAuth (adds an account; --paste on a headless box)
atgc auth login --agent <handle|did>  # an agent's login of the account, made from your terminal
atgc auth status                # list the accounts and show the active one
atgc auth default <handle|did>  # choose the person's fallback account
atgc auth refresh               # refresh the acting account's access token
atgc auth token                 # print the acting account's access token
atgc auth logout [handle|did]   # revoke and forget one account's session (--all, --local)

Push keys #

atgc key list [owner]  # registered SSH keys, and which is on this machine
atgc key add [key]     # publish a public key so knots accept its pushes
                       #   (an agent must name the key; people default to ~/.ssh)
atgc key create        # make one first, for an identity with no ~/.ssh
atgc key delete <key>  # withdraw one (by rkey, name, fingerprint or path)

Tangled profile #

atgc profile view [handle|did]       # the profile tangled.org shows (public read)
atgc profile activity [handle|did]   # recent repos, tickets and commits (public read)
atgc profile create                  # write the first one: --description, --avatar, --pin, ...
atgc profile edit                    # change named fields: --clear, --unpin, --no-bot, ...

Social #

atgc social followers [handle|did]   # who follows an account (--limit, --json)
atgc social following [handle|did]   # who an account follows
atgc social stars [handle|did]       # the repos an account starred, newest first
atgc social trending                 # what is trending on Tangled: people and repos
atgc social accounts <prefix>        # find accounts by handle (--limit)

Repository operations #

Repositories #

atgc repo clone <repo>     # clone a Tangled repo and set its git identity
atgc repo create [name]    # create a repo on a knot and declare it in your PDS
atgc repo fork <repo>      # fork a repo onto a knot, as your own (--clone to check it out)
atgc repo sync [fork]      # bring a fork's branch up to date with its source
atgc repo configure        # point this checkout at the current account, and hook it
atgc repo configure --hook-config  # ...declaring the hook in prek.toml / .pre-commit-config.yaml
atgc repo remote add <repo> [name]  # add a Tangled repo as a remote here, as clone would
atgc repo default-branch <branch>  # point a repo's HEAD at a different branch, on the knot
atgc repo delete-branch <branch>   # delete a branch on the knot (irreversible)
atgc repo edit [repo]      # change its description, website, topics or spindle
atgc repo delete [repo]    # delete its records and git data (--yes, irreversible)
atgc repo list [owner]     # list an account's repos
atgc repo view [repo]      # what a repo is: identity, hosting, git state
atgc repo branches         # a repo's branches, most recently updated first
atgc repo log [ref]        # a ref's commit history, optionally for one path
atgc repo compare a..b     # the commits b has that a does not (--patch for the mailbox)
atgc repo collaborators [repo]  # who the knot lets push: owner and collaborators
atgc repo collaborators add <who>     # let an account push (remove to stop it)
atgc repo forks [repo]     # the repos forked from one (Bobbin's index)
atgc repo stars [repo]     # the accounts that starred one (Bobbin's index)
atgc browse [section]      # open the repo's Tangled page (e.g. browse pulls)
atgc browse --pr           # open the current branch's pull request
atgc browse --pr=23        # open a named one: number, rkey, at:// URI or URL
atgc browse --issue=39     # open an issue: number, rkey, at:// URI or URL
atgc search <query>        # full-text search (this repo, or --all for every one)

Pull requests #

atgc pr create             # push the branch and open a pull from it
                           #   (--fork: push to your fork instead; --skip-ci: no pipelines)
atgc pr resubmit <pull>    # add a version after the branch changes
atgc pr list               # list pulls for this repo (--state open|closed|merged|all)
atgc pr list --author <who> # this repo, narrowed to one account
atgc pr list --all         # your pulls across every repo (--author for someone else's)
atgc pr list --incoming    # pulls anyone opened on the repos you own
atgc pr status             # this branch's pull, yours, and your repos' at a glance
atgc pr view [pull]        # view a pull (defaults to the current branch's; --comments --since --mergeable)
atgc pr diff <pull>        # print a version's diff (--version N, --interdiff)
atgc pr checkout <pull>    # fetch a version's head and branch there
atgc pr checks [pull]      # CI workflows for a pull's latest version
atgc pr comment <pull>     # comment on a pull (--reply-to to thread, --commit for one commit)
atgc pr edit <pull>        # change its title, body or target branch (--target)
atgc pr merge <pull>       # land its latest version on the target branch (--style merge)
atgc pr close <pull>       # close or reopen it
atgc pr reopen <pull>

Issues #

atgc issue list                 # this repo's issues (--all, --incoming, --author, --state)
atgc issue status               # assigned to you, opened by you, and your repos' at a glance
atgc issue view <issue>         # one issue, from Tangled's index (falls back to the knot)
atgc issue create --title <t>   # open an issue (--body, or --body-file -)
atgc issue comment <issue>      # comment on an issue (--reply-to to thread)
atgc issue edit <issue>         # change its title or body
atgc issue close <issue>        # close it, or mark it --completed
atgc issue reopen <issue>

Labels #

atgc label list            # the labels this repo defines, which --label accepts
atgc label create <slug>   # define one (--name, --color)
atgc label edit <slug>     # rename or recolor it
atgc label delete <slug>   # remove the definition

Releases #

atgc release list               # this repo's tags, and how many files each holds
atgc release view <tag>         # a tag's commit, message and attached files
atgc release download <tag> [<name>]  # fetch its files here (--force to replace)
atgc release upload <tag> <file>...   # attach files to a tag (--force an existing name)
atgc release delete <tag> <name>      # remove a tag's file

CI runs #

atgc run list              # this repo's pipeline runs, newest first (--limit)
atgc run view <id>         # one run's workflows: status, timing, web page
atgc run watch <id>        # follow it until every workflow finishes (--timeout)
atgc run logs <id>         # stream its workflow logs (--workflow, --timeout)
atgc run trigger [<commit>]  # start a run, every workflow or --workflow (--input, --dry-run)
atgc run rerun <id>        # retry a run from its stored spec (--workflow, --dry-run)
atgc run cancel <id>       # cancel a run or named workflows (--dry-run)
atgc run approve <id>      # release a blocked run (--dry-run)

Strings #

atgc string list [<account>]    # an account's strings, newest first
atgc string view <string>       # one string's details and contents (--raw for contents only)
atgc string create <file>       # publish a file; `-` reads stdin and needs --filename
atgc string delete <string>     # delete one of your own (--dry-run to check first)

Checking and troubleshooting #

atgc doctor                # is atgc itself set up? (the same as doctor setup)
atgc doctor local          # is this machine, account and checkout set up to work?
atgc doctor remote         # are Tangled's services answering, and what are they running?

atgc logs                  # one row per invocation, built from all four logs
atgc logs oauth            # every OAuth operation (-f to follow, --json for jq)
atgc logs pds              # every write atgc has sent to a PDS
atgc logs knot             # every procedure atgc has sent to a knot
atgc logs git              # every git subprocess, and what it did to the checkout
atgc logs pds --failures --since 2h      # only what went wrong, recently
atgc logs oauth --incident               # the client_id and overlap comparison

atgc issue create --repo permadeath.com/atgc --title <t>  # file a bug in atgc's tracker
atgc report <kind>         # feature requests and questions, onto atgc's public board (--image)

Other #

atgc api <nsid>            # call an XRPC method directly, as you, and print the answer
atgc api com.atproto.repo.listRecords --host knot:knot1.tangled.sh -f repo=did:plc:… -f collection=org.tangled.track.ticket
atgc api org.tangled.search.query --host bobbin -f q='index lag'
atgc api org.tangled.review.submitPatch --host knot:knot1.tangled.sh --input patch.json --dry-run

atgc completion <shell>    # print a completion script (bash|zsh|fish|powershell|elvish)

Documentation #

docs/ holds only what you cannot get by running the tool or reading the code: eight short pages, listed in docs/index.md. The model is the one to read first: Tangled's shape is somebody else's system, and everything surprising about atgc follows from it. What atgc leaves on disk, and how to remove it, is in Uninstalling.

They are compiled into the API documentation too, so prose and generated reference are one build:

cargo docs

Development #

This codebase is intended for a single user, and is largely AI generated. It is provided with no guarantee of stability, versioning, or any other best practices.

Please contact @permadeath.com before sending in issues or pull requests.

See CONTRIBUTING.md for more details.