zithub 0.1.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.1.0/PKG-INFO ADDED
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: zithub
3
+ Version: 0.1.0
4
+ Summary: Batched gh CLI actions for PR workflows: merge preflight, review-thread reply/resolve, and more in one call
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` — batched `gh` PR actions for AI agents, for the two things plain `gh`
29
+ can't already do in a single call: acting on PR review-comment threads (no
30
+ `gh` subcommand exists for these at all), and merging with a real preflight
31
+ (draft/review-decision/unresolved-threads/CI, checked and merged in one
32
+ call instead of chained separately). Where
33
+ [wazup](https://github.com/vivainio/wazup) is the read-only "what's up with
34
+ this repo" status tool, `zh` is this narrower write-side complement — it
35
+ deliberately does *not* wrap `gh pr create/close/comment/review/edit`,
36
+ since those are already one `gh` call each and an agent that already knows
37
+ `gh` gains nothing from a second name for the same thing.
38
+
39
+ Requires the [GitHub CLI](https://cli.github.com/) (`gh`) installed and
40
+ authenticated (`gh auth login`).
41
+
42
+ ## Commands
43
+
44
+ ```
45
+ zh pr threads # list review-comment threads (with the ids below)
46
+ zh pr reply # reply to a review-comment thread, optionally --resolve
47
+ zh pr resolve # mark thread(s) resolved, by id or --all
48
+ zh pr unresolve # reopen thread(s)
49
+
50
+ zh pr merge # merge a PR
51
+ zh pr ship # merge + delete branch (same as `merge --delete-branch`)
52
+
53
+ zh release # preflight, then commits + the gh command for each next version
54
+ zh release patch/minor/major # preflight, then just that one bumped version + gh command
55
+ zh release create # preflight, then actually create at an explicit version
56
+ ```
57
+
58
+ `threads`/`reply`/`resolve`/`unresolve` exist because `gh` has no
59
+ subcommand for review threads at all — they go through `gh api graphql`
60
+ directly (`reviewThreads`, `resolveReviewThread`, `unresolveReviewThread`,
61
+ `addPullRequestReviewThreadReply`). Run `zh pr threads` to see each
62
+ thread's id, then act on it:
63
+
64
+ ```
65
+ zh pr threads # unresolved threads on the current branch's PR
66
+ zh pr reply T_kwDOA... -b "fixed in a1b2c3d" --resolve
67
+ zh pr resolve --all --path src/ # resolve every unresolved thread under src/
68
+ ```
69
+
70
+ `zh pr merge` (and `zh pr ship`, which is the same thing with
71
+ `--delete-branch` on by default) bundles what would otherwise be a
72
+ draft/review-decision/unresolved-thread/CI check spread across several
73
+ calls into one preflight, then merges only if everything's clean:
74
+
75
+ ```
76
+ zh pr merge # preflight, waiting on any pending checks, then squash-merge
77
+ zh pr ship # same, plus delete the branch afterward
78
+ zh pr merge --no-wait # fail fast instead of polling pending checks
79
+ zh pr merge --force # skip the preflight and merge immediately
80
+ zh pr merge --method rebase --keep-branch
81
+ ```
82
+
83
+ `zh release` (bare, or `patch`/`minor`/`major`) ports the checks from the
84
+ `github-release` skill's `preflight.py` — the right gh account is active
85
+ (tested by actually trying to view the repo, not by guessing from a
86
+ login/owner naming convention), the current branch matches the release
87
+ target, local HEAD matches `origin/<target>` exactly, and CI is green on
88
+ that exact commit (falling back to the branch's latest runs if no run
89
+ exists yet for the commit, and proceeding on judgement if none exist at
90
+ all). A dirty worktree only warns — it isn't part of the release either
91
+ way, since the tag points at HEAD.
92
+
93
+ Past the preflight it's read-only: it never creates anything itself. It
94
+ shows the commit log a release's notes get written from, and prints the
95
+ exact `gh release create ...` command to run once notes are ready — not
96
+ `zh release create`, since the preflight (including the CI wait) was just
97
+ run right here and redoing it a moment later would be wasted work.
98
+ `patch`/`minor`/`major` fetch the latest release tag and compute one
99
+ specific bump; bare `zh release` shows all three:
100
+
101
+ ```
102
+ zh release # -> gh release create <next patch/minor/major> ...
103
+ zh release patch # -> just the patch bump
104
+ zh release patch --target release-2.0
105
+ ```
106
+
107
+ `zh release create` is the one command that actually publishes — it runs
108
+ the same preflight itself first (unless `--force`), so it's also safe to
109
+ call directly without a prior `zh release`:
110
+
111
+ ```
112
+ zh release create v1.3.0 -n "$(cat notes.md)"
113
+ zh release create v2.0.0-rc1 --prerelease --force # skip the preflight
114
+ ```
115
+
116
+ ## Install
117
+
118
+ ```
119
+ uv tool install zithub
120
+ ```
121
+
122
+ ## License
123
+
124
+ MIT
zithub-0.1.0/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # zithub
2
+
3
+ `zh` — batched `gh` PR actions for AI agents, for the two things plain `gh`
4
+ can't already do in a single call: acting on PR review-comment threads (no
5
+ `gh` subcommand exists for these at all), and merging with a real preflight
6
+ (draft/review-decision/unresolved-threads/CI, checked and merged in one
7
+ call instead of chained separately). Where
8
+ [wazup](https://github.com/vivainio/wazup) is the read-only "what's up with
9
+ this repo" status tool, `zh` is this narrower write-side complement — it
10
+ deliberately does *not* wrap `gh pr create/close/comment/review/edit`,
11
+ since those are already one `gh` call each and an agent that already knows
12
+ `gh` gains nothing from a second name for the same thing.
13
+
14
+ Requires the [GitHub CLI](https://cli.github.com/) (`gh`) installed and
15
+ authenticated (`gh auth login`).
16
+
17
+ ## Commands
18
+
19
+ ```
20
+ zh pr threads # list review-comment threads (with the ids below)
21
+ zh pr reply # reply to a review-comment thread, optionally --resolve
22
+ zh pr resolve # mark thread(s) resolved, by id or --all
23
+ zh pr unresolve # reopen thread(s)
24
+
25
+ zh pr merge # merge a PR
26
+ zh pr ship # merge + delete branch (same as `merge --delete-branch`)
27
+
28
+ zh release # preflight, then commits + the gh command for each next version
29
+ zh release patch/minor/major # preflight, then just that one bumped version + gh command
30
+ zh release create # preflight, then actually create at an explicit version
31
+ ```
32
+
33
+ `threads`/`reply`/`resolve`/`unresolve` exist because `gh` has no
34
+ subcommand for review threads at all — they go through `gh api graphql`
35
+ directly (`reviewThreads`, `resolveReviewThread`, `unresolveReviewThread`,
36
+ `addPullRequestReviewThreadReply`). Run `zh pr threads` to see each
37
+ thread's id, then act on it:
38
+
39
+ ```
40
+ zh pr threads # unresolved threads on the current branch's PR
41
+ zh pr reply T_kwDOA... -b "fixed in a1b2c3d" --resolve
42
+ zh pr resolve --all --path src/ # resolve every unresolved thread under src/
43
+ ```
44
+
45
+ `zh pr merge` (and `zh pr ship`, which is the same thing with
46
+ `--delete-branch` on by default) bundles what would otherwise be a
47
+ draft/review-decision/unresolved-thread/CI check spread across several
48
+ calls into one preflight, then merges only if everything's clean:
49
+
50
+ ```
51
+ zh pr merge # preflight, waiting on any pending checks, then squash-merge
52
+ zh pr ship # same, plus delete the branch afterward
53
+ zh pr merge --no-wait # fail fast instead of polling pending checks
54
+ zh pr merge --force # skip the preflight and merge immediately
55
+ zh pr merge --method rebase --keep-branch
56
+ ```
57
+
58
+ `zh release` (bare, or `patch`/`minor`/`major`) ports the checks from the
59
+ `github-release` skill's `preflight.py` — the right gh account is active
60
+ (tested by actually trying to view the repo, not by guessing from a
61
+ login/owner naming convention), the current branch matches the release
62
+ target, local HEAD matches `origin/<target>` exactly, and CI is green on
63
+ that exact commit (falling back to the branch's latest runs if no run
64
+ exists yet for the commit, and proceeding on judgement if none exist at
65
+ all). A dirty worktree only warns — it isn't part of the release either
66
+ way, since the tag points at HEAD.
67
+
68
+ Past the preflight it's read-only: it never creates anything itself. It
69
+ shows the commit log a release's notes get written from, and prints the
70
+ exact `gh release create ...` command to run once notes are ready — not
71
+ `zh release create`, since the preflight (including the CI wait) was just
72
+ run right here and redoing it a moment later would be wasted work.
73
+ `patch`/`minor`/`major` fetch the latest release tag and compute one
74
+ specific bump; bare `zh release` shows all three:
75
+
76
+ ```
77
+ zh release # -> gh release create <next patch/minor/major> ...
78
+ zh release patch # -> just the patch bump
79
+ zh release patch --target release-2.0
80
+ ```
81
+
82
+ `zh release create` is the one command that actually publishes — it runs
83
+ the same preflight itself first (unless `--force`), so it's also safe to
84
+ call directly without a prior `zh release`:
85
+
86
+ ```
87
+ zh release create v1.3.0 -n "$(cat notes.md)"
88
+ zh release create v2.0.0-rc1 --prerelease --force # skip the preflight
89
+ ```
90
+
91
+ ## Install
92
+
93
+ ```
94
+ uv tool install zithub
95
+ ```
96
+
97
+ ## License
98
+
99
+ MIT
@@ -0,0 +1,54 @@
1
+ [project]
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"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.10"
8
+ keywords = [
9
+ "git",
10
+ "github",
11
+ "cli",
12
+ "pull-request",
13
+ "ci",
14
+ "gh",
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Software Development",
27
+ "Topic :: Utilities",
28
+ ]
29
+ dependencies = []
30
+
31
+ [[project.authors]]
32
+ name = "Ville Vainio"
33
+ email = "vivainio@gmail.com"
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/vivainio/zithub"
37
+ Repository = "https://github.com/vivainio/zithub"
38
+ Issues = "https://github.com/vivainio/zithub/issues"
39
+
40
+ [project.scripts]
41
+ zh = "zithub:main"
42
+
43
+ [build-system]
44
+ requires = ["uv_build>=0.12.3,<0.13.0"]
45
+ build-backend = "uv_build"
46
+
47
+ [dependency-groups]
48
+ dev = [
49
+ "pytest>=8.0.0",
50
+ "ty>=0.0.72",
51
+ ]
52
+
53
+ [tool.pytest.ini_options]
54
+ testpaths = ["tests"]
@@ -0,0 +1,46 @@
1
+ [project]
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"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Ville Vainio", email = "vivainio@gmail.com" }
8
+ ]
9
+ license = "MIT"
10
+ requires-python = ">=3.10"
11
+ keywords = ["git", "github", "cli", "pull-request", "ci", "gh"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Software Development",
23
+ "Topic :: Utilities",
24
+ ]
25
+ dependencies = []
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/vivainio/zithub"
29
+ Repository = "https://github.com/vivainio/zithub"
30
+ Issues = "https://github.com/vivainio/zithub/issues"
31
+
32
+ [project.scripts]
33
+ zh = "zithub:main"
34
+
35
+ [build-system]
36
+ requires = ["uv_build>=0.12.3,<0.13.0"]
37
+ build-backend = "uv_build"
38
+
39
+ [dependency-groups]
40
+ dev = [
41
+ "pytest>=8.0.0",
42
+ "ty>=0.0.72",
43
+ ]
44
+
45
+ [tool.pytest.ini_options]
46
+ testpaths = ["tests"]
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ __all__ = ["main"]