zithub 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
zithub-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: zithub
3
+ Version: 0.2.0
4
+ Summary: What's up with this repo, right now, plus batched gh PR/release actions: status, CI, merge preflight, review-thread reply/resolve, and more
5
+ Keywords: git,github,cli,pull-request,ci,gh
6
+ Author: Ville Vainio
7
+ Author-email: Ville Vainio <vivainio@gmail.com>
8
+ License-Expression: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development
19
+ Classifier: Topic :: Utilities
20
+ Requires-Python: >=3.10
21
+ Project-URL: Homepage, https://github.com/vivainio/zithub
22
+ Project-URL: Repository, https://github.com/vivainio/zithub
23
+ Project-URL: Issues, https://github.com/vivainio/zithub/issues
24
+ Description-Content-Type: text/markdown
25
+
26
+ # zithub
27
+
28
+ `zh` — what's up with this repo, right now, plus batched `gh` PR and release
29
+ actions for AI agents. A standalone `gh`/`git` CLI: bare `zh` gives repo,
30
+ branch, local, PR, and CI status in one shot (no separate status tool
31
+ required), and the rest covers what plain `gh` can't already do in a single
32
+ call — acting on PR review-comment threads (no `gh` subcommand exists for
33
+ these at all), merging with a real preflight
34
+ (draft/review-decision/unresolved-threads/CI, checked and merged in one
35
+ call instead of chained separately), and release preflight/creation. The
36
+ status/CI/PR/my/review/issues reporting is ported from
37
+ [wazup](https://github.com/vivainio/wazup), so `zh` doesn't need wazup
38
+ installed alongside it. It deliberately does *not* wrap `gh pr
39
+ create/close/comment/review/edit`, since those are already one `gh` call
40
+ each and an agent that already knows `gh` gains nothing from a second name
41
+ for the same thing.
42
+
43
+ Requires the [GitHub CLI](https://cli.github.com/) (`gh`) installed and
44
+ authenticated (`gh auth login`).
45
+
46
+ ## Commands
47
+
48
+ ```
49
+ zh # repo, branch, local, PR, and CI status in one shot
50
+ # (also recent branches/worktrees on the default branch)
51
+ zh ci # just the CI status for the current branch/PR
52
+ zh pr # current branch's PR: status, checks, and review comment
53
+ # threads (unresolved by default; --all also shows resolved)
54
+ zh my # your open PRs in this repo, or recent PR activity outside one
55
+ zh review # PRs awaiting your review, updated in the last 7 days
56
+ zh issues # your open issues in this repo, or recent activity outside one
57
+
58
+ zh pr threads # list review-comment threads (with the ids below)
59
+ zh pr reply # reply to a review-comment thread, optionally --resolve
60
+ zh pr resolve # mark thread(s) resolved, by id or --all
61
+ zh pr unresolve # reopen thread(s)
62
+
63
+ zh pr check # target branch, and whether the PR references a ticket
64
+
65
+ zh pr merge # merge a PR
66
+ zh pr ship # merge + delete branch (same as `merge --delete-branch`)
67
+
68
+ zh release # preflight, then commits + the gh command for each next version
69
+ zh release patch/minor/major # preflight, then just that one bumped version + gh command
70
+ zh release create # preflight, then actually create at an explicit version
71
+
72
+ zh repos # local checkouts zh has seen, most-recently-seen first
73
+ zh install-skills # install the zh Claude Code skill
74
+ ```
75
+
76
+ Add `-w`/`--why` to `zh`, `zh ci`, or `zh pr` to drill into a failing check
77
+ — prints the tail of the failing job's log, right up to the error, instead
78
+ of just a pass/fail icon.
79
+
80
+ `threads`/`reply`/`resolve`/`unresolve` exist because `gh` has no
81
+ subcommand for review threads at all — they go through `gh api graphql`
82
+ directly (`reviewThreads`, `resolveReviewThread`, `unresolveReviewThread`,
83
+ `addPullRequestReviewThreadReply`). Run `zh pr threads` to see each
84
+ thread's id, then act on it:
85
+
86
+ ```
87
+ zh pr threads # unresolved threads on the current branch's PR
88
+ zh pr reply T_kwDOA... -b "fixed in a1b2c3d" --resolve
89
+ zh pr resolve --all --path src/ # resolve every unresolved thread under src/
90
+ ```
91
+
92
+ `zh pr check` surfaces what you'd otherwise have to open the PR on the web
93
+ (or find a local clone) to see: the base branch it's targeting (no
94
+ judgment — just shown, since only you know whether it's the wrong one),
95
+ its local checkout if `zh repos` has seen one for that branch — warning if
96
+ that checkout is dirty, since switching branches or pulling there would be
97
+ risky — and whether the title/body references a ticket at all: a GitHub
98
+ issue ref (`#123`, `Fixes #123`), any URL (covers a Jira/Linear/etc. link),
99
+ or a bare Jira-style key (`ABC-123`, flagged with a suggestion to link it
100
+ directly). Exits non-zero if no ticket reference is found.
101
+
102
+ Typically called with one or more PR URLs directly (an owner/repo parsed
103
+ right out of the URL, so it works from anywhere — not just a checkout of
104
+ that repo), rather than a bare number, which only resolves against the
105
+ current directory's repo:
106
+
107
+ ```
108
+ zh pr check # current branch's PR
109
+ zh pr check https://github.com/acme/widgets/pull/42
110
+ zh pr check https://github.com/.../pull/42 https://github.com/.../pull/43 # a summary block per PR
111
+ ```
112
+
113
+ `zh pr merge` (and `zh pr ship`, which is the same thing with
114
+ `--delete-branch` on by default) bundles what would otherwise be a
115
+ draft/review-decision/unresolved-thread/CI check spread across several
116
+ calls into one preflight, then merges only if everything's clean:
117
+
118
+ ```
119
+ zh pr merge # preflight, waiting on any pending checks, then squash-merge
120
+ zh pr ship # same, plus delete the branch afterward
121
+ zh pr merge --no-wait # fail fast instead of polling pending checks
122
+ zh pr merge --force # skip the preflight and merge immediately
123
+ zh pr merge --method rebase --keep-branch
124
+ ```
125
+
126
+ `zh release` (bare, or `patch`/`minor`/`major`) checks: the active gh
127
+ account matches the repo's owner (same convention `wazup` uses — a
128
+ logged-in account whose login, or the org half of a `name_OrgName`
129
+ corporate-SSO login, matches origin's owner; best-effort and never blocks
130
+ the release if nothing matches), the current branch matches the release
131
+ target, local HEAD matches `origin/<target>` exactly, and CI is green on
132
+ that exact commit (falling back to the branch's latest runs if no run
133
+ exists yet for the commit, and proceeding on judgement if none exist at
134
+ all). A dirty worktree only warns — it isn't part of the release either
135
+ way, since the tag points at HEAD.
136
+
137
+ Past the preflight it's read-only: it never creates anything itself. It
138
+ shows the commit log a release's notes get written from, and prints the
139
+ exact `zh release create ...` command to run once notes are ready. That
140
+ command skips its own preflight by default, so running it right after
141
+ `zh release` doesn't redo the CI wait that was just run here.
142
+ `patch`/`minor`/`major` fetch the latest release tag and compute one
143
+ specific bump; bare `zh release` shows all three:
144
+
145
+ ```
146
+ zh release # -> zh release create <next patch/minor/major> ...
147
+ zh release patch # -> just the patch bump
148
+ zh release patch --target release-2.0
149
+ ```
150
+
151
+ `zh release create` is the one command that actually publishes — it
152
+ requires release notes (`-n`/`--notes` or `-F`/`--notes-file` — one of
153
+ them, always), and after creating the GitHub release it also polls for and
154
+ waits on any workflow run(s) triggered by that release (e.g. a PyPI
155
+ publish job), reporting success or failure instead of leaving that for the
156
+ caller to check separately. A repo with no such workflow just proceeds —
157
+ it's not treated as a failure. The preflight is opt-in via `--preflight`,
158
+ for when you're calling it directly without a prior `zh release`:
159
+
160
+ ```
161
+ zh release create v1.3.0 -n "$(cat notes.md)"
162
+ zh release create v2.0.0-rc1 --prerelease --preflight # check first, since there was no prior `zh release`
163
+ ```
164
+
165
+ Every command above that needs `gh` also registers the checkout it ran in
166
+ — path, repo, branch — into a local registry at
167
+ `~/.local/share/zithub/repos.jsonl`, ported from wazup's own (a separate
168
+ database, same design). `zh repos` lists what's been seen, letting an
169
+ agent find a local checkout of a repo by name instead of guessing paths or
170
+ re-cloning; two worktrees or clones of the same repo, at different paths,
171
+ show up as separate entries with their own branch:
172
+
173
+ ```
174
+ zh repos # everything seen, most-recently-seen first
175
+ zh repos zithub # only checkouts whose repo name or path contains "zithub"
176
+ ```
177
+
178
+ ## Install
179
+
180
+ ```
181
+ uv tool install zithub
182
+ ```
183
+
184
+ ## License
185
+
186
+ MIT
zithub-0.2.0/README.md ADDED
@@ -0,0 +1,161 @@
1
+ # zithub
2
+
3
+ `zh` — what's up with this repo, right now, plus batched `gh` PR and release
4
+ actions for AI agents. A standalone `gh`/`git` CLI: bare `zh` gives repo,
5
+ branch, local, PR, and CI status in one shot (no separate status tool
6
+ required), and the rest covers what plain `gh` can't already do in a single
7
+ call — acting on PR review-comment threads (no `gh` subcommand exists for
8
+ these at all), merging with a real preflight
9
+ (draft/review-decision/unresolved-threads/CI, checked and merged in one
10
+ call instead of chained separately), and release preflight/creation. The
11
+ status/CI/PR/my/review/issues reporting is ported from
12
+ [wazup](https://github.com/vivainio/wazup), so `zh` doesn't need wazup
13
+ installed alongside it. It deliberately does *not* wrap `gh pr
14
+ create/close/comment/review/edit`, since those are already one `gh` call
15
+ each and an agent that already knows `gh` gains nothing from a second name
16
+ for the same thing.
17
+
18
+ Requires the [GitHub CLI](https://cli.github.com/) (`gh`) installed and
19
+ authenticated (`gh auth login`).
20
+
21
+ ## Commands
22
+
23
+ ```
24
+ zh # repo, branch, local, PR, and CI status in one shot
25
+ # (also recent branches/worktrees on the default branch)
26
+ zh ci # just the CI status for the current branch/PR
27
+ zh pr # current branch's PR: status, checks, and review comment
28
+ # threads (unresolved by default; --all also shows resolved)
29
+ zh my # your open PRs in this repo, or recent PR activity outside one
30
+ zh review # PRs awaiting your review, updated in the last 7 days
31
+ zh issues # your open issues in this repo, or recent activity outside one
32
+
33
+ zh pr threads # list review-comment threads (with the ids below)
34
+ zh pr reply # reply to a review-comment thread, optionally --resolve
35
+ zh pr resolve # mark thread(s) resolved, by id or --all
36
+ zh pr unresolve # reopen thread(s)
37
+
38
+ zh pr check # target branch, and whether the PR references a ticket
39
+
40
+ zh pr merge # merge a PR
41
+ zh pr ship # merge + delete branch (same as `merge --delete-branch`)
42
+
43
+ zh release # preflight, then commits + the gh command for each next version
44
+ zh release patch/minor/major # preflight, then just that one bumped version + gh command
45
+ zh release create # preflight, then actually create at an explicit version
46
+
47
+ zh repos # local checkouts zh has seen, most-recently-seen first
48
+ zh install-skills # install the zh Claude Code skill
49
+ ```
50
+
51
+ Add `-w`/`--why` to `zh`, `zh ci`, or `zh pr` to drill into a failing check
52
+ — prints the tail of the failing job's log, right up to the error, instead
53
+ of just a pass/fail icon.
54
+
55
+ `threads`/`reply`/`resolve`/`unresolve` exist because `gh` has no
56
+ subcommand for review threads at all — they go through `gh api graphql`
57
+ directly (`reviewThreads`, `resolveReviewThread`, `unresolveReviewThread`,
58
+ `addPullRequestReviewThreadReply`). Run `zh pr threads` to see each
59
+ thread's id, then act on it:
60
+
61
+ ```
62
+ zh pr threads # unresolved threads on the current branch's PR
63
+ zh pr reply T_kwDOA... -b "fixed in a1b2c3d" --resolve
64
+ zh pr resolve --all --path src/ # resolve every unresolved thread under src/
65
+ ```
66
+
67
+ `zh pr check` surfaces what you'd otherwise have to open the PR on the web
68
+ (or find a local clone) to see: the base branch it's targeting (no
69
+ judgment — just shown, since only you know whether it's the wrong one),
70
+ its local checkout if `zh repos` has seen one for that branch — warning if
71
+ that checkout is dirty, since switching branches or pulling there would be
72
+ risky — and whether the title/body references a ticket at all: a GitHub
73
+ issue ref (`#123`, `Fixes #123`), any URL (covers a Jira/Linear/etc. link),
74
+ or a bare Jira-style key (`ABC-123`, flagged with a suggestion to link it
75
+ directly). Exits non-zero if no ticket reference is found.
76
+
77
+ Typically called with one or more PR URLs directly (an owner/repo parsed
78
+ right out of the URL, so it works from anywhere — not just a checkout of
79
+ that repo), rather than a bare number, which only resolves against the
80
+ current directory's repo:
81
+
82
+ ```
83
+ zh pr check # current branch's PR
84
+ zh pr check https://github.com/acme/widgets/pull/42
85
+ zh pr check https://github.com/.../pull/42 https://github.com/.../pull/43 # a summary block per PR
86
+ ```
87
+
88
+ `zh pr merge` (and `zh pr ship`, which is the same thing with
89
+ `--delete-branch` on by default) bundles what would otherwise be a
90
+ draft/review-decision/unresolved-thread/CI check spread across several
91
+ calls into one preflight, then merges only if everything's clean:
92
+
93
+ ```
94
+ zh pr merge # preflight, waiting on any pending checks, then squash-merge
95
+ zh pr ship # same, plus delete the branch afterward
96
+ zh pr merge --no-wait # fail fast instead of polling pending checks
97
+ zh pr merge --force # skip the preflight and merge immediately
98
+ zh pr merge --method rebase --keep-branch
99
+ ```
100
+
101
+ `zh release` (bare, or `patch`/`minor`/`major`) checks: the active gh
102
+ account matches the repo's owner (same convention `wazup` uses — a
103
+ logged-in account whose login, or the org half of a `name_OrgName`
104
+ corporate-SSO login, matches origin's owner; best-effort and never blocks
105
+ the release if nothing matches), the current branch matches the release
106
+ target, local HEAD matches `origin/<target>` exactly, and CI is green on
107
+ that exact commit (falling back to the branch's latest runs if no run
108
+ exists yet for the commit, and proceeding on judgement if none exist at
109
+ all). A dirty worktree only warns — it isn't part of the release either
110
+ way, since the tag points at HEAD.
111
+
112
+ Past the preflight it's read-only: it never creates anything itself. It
113
+ shows the commit log a release's notes get written from, and prints the
114
+ exact `zh release create ...` command to run once notes are ready. That
115
+ command skips its own preflight by default, so running it right after
116
+ `zh release` doesn't redo the CI wait that was just run here.
117
+ `patch`/`minor`/`major` fetch the latest release tag and compute one
118
+ specific bump; bare `zh release` shows all three:
119
+
120
+ ```
121
+ zh release # -> zh release create <next patch/minor/major> ...
122
+ zh release patch # -> just the patch bump
123
+ zh release patch --target release-2.0
124
+ ```
125
+
126
+ `zh release create` is the one command that actually publishes — it
127
+ requires release notes (`-n`/`--notes` or `-F`/`--notes-file` — one of
128
+ them, always), and after creating the GitHub release it also polls for and
129
+ waits on any workflow run(s) triggered by that release (e.g. a PyPI
130
+ publish job), reporting success or failure instead of leaving that for the
131
+ caller to check separately. A repo with no such workflow just proceeds —
132
+ it's not treated as a failure. The preflight is opt-in via `--preflight`,
133
+ for when you're calling it directly without a prior `zh release`:
134
+
135
+ ```
136
+ zh release create v1.3.0 -n "$(cat notes.md)"
137
+ zh release create v2.0.0-rc1 --prerelease --preflight # check first, since there was no prior `zh release`
138
+ ```
139
+
140
+ Every command above that needs `gh` also registers the checkout it ran in
141
+ — path, repo, branch — into a local registry at
142
+ `~/.local/share/zithub/repos.jsonl`, ported from wazup's own (a separate
143
+ database, same design). `zh repos` lists what's been seen, letting an
144
+ agent find a local checkout of a repo by name instead of guessing paths or
145
+ re-cloning; two worktrees or clones of the same repo, at different paths,
146
+ show up as separate entries with their own branch:
147
+
148
+ ```
149
+ zh repos # everything seen, most-recently-seen first
150
+ zh repos zithub # only checkouts whose repo name or path contains "zithub"
151
+ ```
152
+
153
+ ## Install
154
+
155
+ ```
156
+ uv tool install zithub
157
+ ```
158
+
159
+ ## License
160
+
161
+ MIT
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "zithub"
3
- version = "0.1.0"
4
- description = "Batched gh CLI actions for PR workflows: merge preflight, review-thread reply/resolve, and more in one call"
3
+ version = "0.2.0"
4
+ description = "What's up with this repo, right now, plus batched gh PR/release actions: status, CI, merge preflight, review-thread reply/resolve, and more"
5
5
  readme = "README.md"
6
6
  license = "MIT"
7
7
  requires-python = ">=3.10"
@@ -52,3 +52,7 @@ dev = [
52
52
 
53
53
  [tool.pytest.ini_options]
54
54
  testpaths = ["tests"]
55
+
56
+ [[tool.uv.index]]
57
+ url = "https://pypi.org/simple"
58
+ default = true
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "zithub"
3
- version = "0.1.0"
4
- description = "Batched gh CLI actions for PR workflows: merge preflight, review-thread reply/resolve, and more in one call"
3
+ version = "0.2.0"
4
+ description = "What's up with this repo, right now, plus batched gh PR/release actions: status, CI, merge preflight, review-thread reply/resolve, and more"
5
5
  readme = "README.md"
6
6
  authors = [
7
7
  { name = "Ville Vainio", email = "vivainio@gmail.com" }
@@ -44,3 +44,7 @@ dev = [
44
44
 
45
45
  [tool.pytest.ini_options]
46
46
  testpaths = ["tests"]
47
+
48
+ [[tool.uv.index]]
49
+ url = "https://pypi.org/simple"
50
+ default = true