feat(repo): add +git-tree and +blob for low-level git objects #388

Merged
wbtiger merged 1 commits from Taoyouce/gitlink-cli:feat/repo-git-objects into master 2026-07-14 20:36:40 +08:00
Contributor

What

The v1 API exposes raw git objects (GET /v1/:owner/:repo/git/trees/:sha, /git/blobs/:sha) but the CLI had no coverage. Two new repo subcommands:

# Paged tree entries by SHA or branch/tag ref, optionally recursive
gitlink-cli repo +git-tree --owner myname --repo myrepo -s master --recursive

# Blob object by SHA; --decode prints the base64 content as plain text
gitlink-cli repo +blob --owner myname --repo myrepo -s <blob-sha> --decode

repo +tree (sub_entries) shows one directory level of the working tree; +git-tree/+blob give direct object access — useful for scripting, content pipelines, and agents that walk a repo without checking it out.

Validation

  • Production-verified on gitlink.org.cn: tree listing by ref (35 entries, paging respected) and a blob fetched by SHA whose --decode output matches the original file byte-for-byte.
  • 2 unit tests (paths, recursive query, decode path); go test ./..., go vet, gofmt all clean.
  • README examples and bilingual i18n keys included.
## What The v1 API exposes raw git objects (`GET /v1/:owner/:repo/git/trees/:sha`, `/git/blobs/:sha`) but the CLI had no coverage. Two new repo subcommands: ```bash # Paged tree entries by SHA or branch/tag ref, optionally recursive gitlink-cli repo +git-tree --owner myname --repo myrepo -s master --recursive # Blob object by SHA; --decode prints the base64 content as plain text gitlink-cli repo +blob --owner myname --repo myrepo -s <blob-sha> --decode ``` `repo +tree` (sub_entries) shows one directory level of the working tree; `+git-tree`/`+blob` give direct object access — useful for scripting, content pipelines, and agents that walk a repo without checking it out. ## Validation - Production-verified on gitlink.org.cn: tree listing by ref (35 entries, paging respected) and a blob fetched by SHA whose --decode output matches the original file byte-for-byte. - 2 unit tests (paths, recursive query, decode path); `go test ./...`, `go vet`, `gofmt` all clean. - README examples and bilingual i18n keys included.
Taoyouce added 4 commits 2026-07-08 22:58:57 +08:00
605829335a feat(repo): add +git-tree and +blob for low-level git objects
Wraps GET /v1/:owner/:repo/git/trees/:sha and /git/blobs/:sha,
which had no CLI coverage:

- repo +git-tree -s <sha|ref> [--recursive]: paged tree entries
- repo +blob -s <sha> [--decode]: blob object; --decode prints the
  base64 content as plain text for piping

Production-verified on gitlink.org.cn (tree listing by ref, blob
fetched by SHA and decoded byte-for-byte). 2 unit tests, README
examples, bilingual i18n keys.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
wbtiger merged commit 94940a8e56 into master 2026-07-14 20:36:38 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#388
No description provided.