wtg-cli 0.3.2__cp315-cp315-win_amd64.whl

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.
wtg_cli/__init__.py ADDED
@@ -0,0 +1,14 @@
1
+ """Python helpers for the What The Git CLI package."""
2
+
3
+ from importlib import metadata as _metadata
4
+
5
+ from .cli import main, run
6
+
7
+ try:
8
+ __version__ = _metadata.version("wtg-cli")
9
+ except (
10
+ _metadata.PackageNotFoundError
11
+ ): # pragma: no cover - fallback for editable installs
12
+ __version__ = "0.0.0"
13
+
14
+ __all__ = ["main", "run", "__version__"]
wtg_cli/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ """Allow running ``python -m wtg_cli``."""
2
+
3
+ from .cli import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())
Binary file
wtg_cli/cli.py ADDED
@@ -0,0 +1,35 @@
1
+ """Wrapper functions that route Python entry points to the Rust CLI."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from typing import Iterable, Sequence
7
+
8
+ from . import _wtg
9
+
10
+
11
+ def run(argv: Iterable[str] | None = None) -> int:
12
+ """Execute the CLI using the provided argv sequence.
13
+
14
+ When *argv* is ``None`` the current ``sys.argv`` is forwarded, which mirrors
15
+ invoking the tool as a standalone executable.
16
+ """
17
+
18
+ args: list[str]
19
+ if argv is None:
20
+ args = list(sys.argv)
21
+ elif isinstance(argv, Sequence):
22
+ args = list(argv)
23
+ else:
24
+ args = list(argv)
25
+
26
+ if not args:
27
+ args = ["wtg"]
28
+
29
+ return _wtg.run_cli([str(arg) for arg in args])
30
+
31
+
32
+ def main() -> int:
33
+ """Entry point used by ``python -m wtg_cli`` and console scripts."""
34
+
35
+ return run()
@@ -0,0 +1,191 @@
1
+ Metadata-Version: 2.4
2
+ Name: wtg-cli
3
+ Version: 0.3.2
4
+ Classifier: Programming Language :: Python :: 3
5
+ Classifier: Programming Language :: Python :: 3.11
6
+ Classifier: Programming Language :: Python :: 3.12
7
+ Classifier: Programming Language :: Python :: 3.13
8
+ Classifier: Programming Language :: Python :: 3.14
9
+ Classifier: Programming Language :: Python :: 3.15
10
+ Classifier: Programming Language :: Rust
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Topic :: Software Development :: Version Control :: Git
14
+ License-File: LICENSE
15
+ Summary: What The Git CLI – snarky Git history sleuth packaged for Python
16
+ Author: Mike Perlov
17
+ License: MIT
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
20
+
21
+ # What The Git (wtg) 🔍
22
+
23
+ A snarky but helpful CLI tool to identify git commits, issues, PRs and file changes, and tell you which release they shipped in. Because sometimes you just need to know what the git is going on!
24
+
25
+ A totally vibe-coded tool, so do not blame me if it hurts your feelings. 😄
26
+
27
+ [![PyPI](https://img.shields.io/pypi/v/wtg-cli)](https://pypi.org/project/wtg-cli/)
28
+ [![Crates.io](https://img.shields.io/crates/v/wtg-cli)](https://crates.io/crates/wtg-cli)
29
+ [![CI](https://github.com/mishamsk/wtg/actions/workflows/ci.yml/badge.svg)](https://github.com/mishamsk/wtg/actions/workflows/ci.yml)
30
+
31
+ ## Demo
32
+
33
+ <p align="center">
34
+ <img src="assets/demo.gif" alt="Demo" width="600" height="600" />
35
+ </p>
36
+
37
+ **Try it yourself!**
38
+
39
+ ```bash
40
+ uvx --from wtg-cli wtg https://github.com/go-task/task/issues/1322
41
+ ```
42
+
43
+ ## Features
44
+
45
+ - 🔍 **Smart Detection**: Automatically identifies what you're looking for (commit hash, issue/PR number, file path, or tag)
46
+ - 🌐 **Remote Repository Support**: Work with any GitHub repository without cloning it locally
47
+ - 🔗 **GitHub URL Parsing**: Paste any GitHub URL (commit, issue, PR, file) and wtg figures it out
48
+ - 🎨 **Colorful Output**: Beautiful terminal output with emojis and colors
49
+ - 😄 **Snarky Messages**: Helpful error messages with personality
50
+ - 📦 **Release Tracking**: Finds which release first shipped your commit, with optional pre-release filtering
51
+ - 🎯 **Release Checking**: Verify if a commit/issue/PR is in a specific release
52
+ - 👤 **Blame Info**: Shows who's responsible for that pesky bug
53
+ - 🚀 **Smart Caching**: Efficiently caches remote repositories with minimal disk usage
54
+ - 🌐 **Graceful Degradation**: Works without network or GitHub remote
55
+
56
+ ## Installation
57
+
58
+ ### Recommended: Python package
59
+
60
+ Run the (python) CLI without installing anything permanently:
61
+
62
+ ```bash
63
+ uvx --from wtg-cli wtg --help
64
+ ```
65
+
66
+ Or install it as a global tool (works on macOS, Linux, and Windows):
67
+
68
+ ```bash
69
+ uv tool install wtg-cli
70
+ wtg --help
71
+ ```
72
+
73
+ ### Alternative: build/install from source
74
+
75
+ ```bash
76
+ cargo install wtg-cli
77
+ ```
78
+
79
+ ## Usage
80
+
81
+ ### Local Repository
82
+
83
+ Simply run `wtg` with any of the following:
84
+
85
+ ```bash
86
+ # Find a commit by hash
87
+ wtg c62bbcc
88
+
89
+ # Find an issue or PR
90
+ wtg 123
91
+ wtg #123
92
+
93
+ # Find a file
94
+ wtg Cargo.toml
95
+
96
+ # Find a tag
97
+ wtg v1.2.3
98
+
99
+ # Check if a commit is in a specific release
100
+ wtg c62bbcc v2.0.0
101
+
102
+ # Skip pre-releases when finding the first release
103
+ wtg c62bbcc -S
104
+
105
+ # Fetch latest tags from remote before querying
106
+ wtg c62bbcc --fetch
107
+ ```
108
+
109
+ ### Remote Repository
110
+
111
+ Query any GitHub repository without cloning it first:
112
+
113
+ ```bash
114
+ # Using -r flag with owner/repo
115
+ wtg -r astral-sh/uv 0.5.0
116
+
117
+ # Using full GitHub URL
118
+ wtg -r https://github.com/astral-sh/uv v0.5.0
119
+
120
+ # Paste any GitHub URL directly
121
+ wtg https://github.com/astral-sh/uv/commit/abc123
122
+ wtg https://github.com/astral-sh/uv/issues/42
123
+ wtg https://github.com/astral-sh/uv/pull/123
124
+ wtg https://github.com/astral-sh/uv/blob/main/README.md
125
+ ```
126
+
127
+ **Note**: Remote repositories are cached in your system's cache directory for faster subsequent queries. The cache uses `--filter=blob:none` (Git 2.17+) for minimal disk usage, with automatic fallback to bare clones on older Git versions. On macOS this lives under `~/Library/Caches/wtg/repos`, on Linux it defaults to `~/.cache/wtg/repos`, and on Windows it follows `%LOCALAPPDATA%\wtg\repos`.
128
+
129
+ ## Output Examples
130
+
131
+ ### Commit
132
+ ```
133
+ 🔍 Found commit: c4e0cc8e98d3
134
+
135
+ 💻 The Commit:
136
+ Hash: c4e0cc8
137
+ 👤 Who wrote this gem:
138
+ mishamsk (5206955+mishamsk@users.noreply.github.com)
139
+ 🔗 https://github.com/mishamsk
140
+ 📝 ⬇️ reduce msrv
141
+ 📅 2024-11-07 03:37:26
142
+ 🔗 https://github.com/mishamsk/sas-lexer/commit/c4e0cc8e98d3e786916ac811c5617ecb68d1a6fd
143
+
144
+ 📦 First shipped in:
145
+ 🎉 rust-v1.0.0-beta.3 (rust-v1.0.0-beta.3)
146
+ 📅 2024-11-08 03:03:21 U
147
+ 🔗 https://github.com/mishamsk/sas-lexer/releases/tag/rust-v1.0.0-beta.3
148
+ ```
149
+
150
+ ## GitHub Authentication
151
+
152
+ For better rate limits, set a GitHub token:
153
+
154
+ 1. **Environment variable** (recommended):
155
+ ```bash
156
+ export GITHUB_TOKEN=ghp_your_token_here
157
+ ```
158
+
159
+ 2. **GitHub CLI**: wtg automatically reads from `~/.config/gh/hosts.yml` if you have `gh` installed
160
+
161
+ 3. **Anonymous**: Works without auth but has lower rate limits (60 requests/hour)
162
+
163
+ ## How It Works
164
+
165
+ 1. Opens your git repository
166
+ 2. Tries to identify the input type (commit, issue, file, tag)
167
+ 3. Fetches additional info from GitHub API if available
168
+ 4. Finds the closest release that contains the commit
169
+ 5. Displays everything in a beautiful, colorful format
170
+
171
+ ## Limitations
172
+
173
+ - Only supports GitHub (GitLab and others coming... maybe?)
174
+ - Squashed commits detection not yet implemented
175
+ - No TUI mode (planned for future)
176
+
177
+ ## License
178
+
179
+ MIT
180
+
181
+ ## Contributing
182
+
183
+ Found a bug? Want to add a snarky message? PRs welcome! Just make sure to keep the snark levels high and the code quality higher.
184
+
185
+ <details>
186
+ <summary>Python package compatibility</summary>
187
+
188
+ Python 3.11–3.15 is supported. Prebuilt CPython 3.11–3.15 wheels are available for macOS ARM64, Linux x86_64, and Windows x86_64. Other installations build from source and require a Rust toolchain.
189
+
190
+ </details>
191
+
@@ -0,0 +1,10 @@
1
+ wtg_cli/__init__.py,sha256=hyOom6FHhDhBYwXHgn49jUwHg8b4oPpH3RONGar821o,363
2
+ wtg_cli/__main__.py,sha256=y-tanBpdvSApMQqB0CKa2rRfKw9eaCGsQEZEuM6NoGo,131
3
+ wtg_cli/_wtg.cp315-win_amd64.pyd,sha256=OvzRLbESla-XScGqLrrD9ZRqQqpIBxx82yOqlKFdK8g,10906112
4
+ wtg_cli/cli.py,sha256=RaQY4DKipZo7OmARWSQyMhCs_RPxDk-8UBD3ktMKwi0,840
5
+ wtg_cli-0.3.2.dist-info/METADATA,sha256=-3LiTEgKwNxU8-_DhIXJBLk40bJH5FNs0ySsyANelM0,6094
6
+ wtg_cli-0.3.2.dist-info/WHEEL,sha256=Q5QdGvjBfn8x6ihg-B4VQuuGKk7DT67L9DVrwEH_qj8,97
7
+ wtg_cli-0.3.2.dist-info/entry_points.txt,sha256=v3pdriVnHV-N7dP3Y9bbhUFno6m-gRk_57hNq4vNFgA,39
8
+ wtg_cli-0.3.2.dist-info/licenses/LICENSE,sha256=5beZsDWkpy61sDNmto1ClYsqh_KnowEDb3YcWuRHfMk,1089
9
+ wtg_cli-0.3.2.dist-info/sboms/wtg-python.cyclonedx.json,sha256=zQuFLuywa8v-B-_1WLC6Wdr-jFbiG6p_McwL1ES8UcY,297669
10
+ wtg_cli-0.3.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win_amd64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ wtg=wtg_cli.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mike Perlov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.