wtg-cli 0.1.1__cp313-cp313-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,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: wtg-cli
3
+ Version: 0.1.1
4
+ Classifier: Programming Language :: Python :: 3
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Topic :: Software Development :: Version Control :: Git
9
+ License-File: LICENSE
10
+ Summary: What The Git CLI – snarky Git history sleuth packaged for Python
11
+ Author: Mike Perlov
12
+ License: MIT
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
15
+
16
+ # What The Git (wtg) 🔍
17
+
18
+ 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!
19
+
20
+ A totally vibe-coded tool, so do not blame me if it hurts your feelings. 😄
21
+
22
+ [![PyPI](https://img.shields.io/pypi/v/wtg-cli)](https://pypi.org/project/wtg-cli/)
23
+ [![Crates.io](https://img.shields.io/crates/v/wtg-cli)](https://crates.io/crates/wtg-cli)
24
+ [![CI](https://github.com/mishamsk/wtg/actions/workflows/ci.yml/badge.svg)](https://github.com/mishamsk/wtg/actions/workflows/ci.yml)
25
+
26
+ ## Demo
27
+
28
+ <p align="center">
29
+ <img src="assets/demo.gif" alt="Demo" width="600" height="600" />
30
+ </p>
31
+
32
+ **Try it yourself!**
33
+
34
+ ```bash
35
+ uvx --from wtg-cli wtg https://github.com/go-task/task/issues/1322
36
+ ```
37
+
38
+ ## Features
39
+
40
+ - 🔍 **Smart Detection**: Automatically identifies what you're looking for (commit hash, issue/PR number, file path, or tag)
41
+ - 🌐 **Remote Repository Support**: Work with any GitHub repository without cloning it locally
42
+ - 🔗 **GitHub URL Parsing**: Paste any GitHub URL (commit, issue, PR, file) and wtg figures it out
43
+ - 🎨 **Colorful Output**: Beautiful terminal output with emojis and colors
44
+ - 😄 **Snarky Messages**: Helpful error messages with personality
45
+ - 📦 **Release Tracking**: Finds which release first shipped your commit
46
+ - 👤 **Blame Info**: Shows who's responsible for that pesky bug
47
+ - 🚀 **Smart Caching**: Efficiently caches remote repositories with minimal disk usage
48
+ - 🌐 **Graceful Degradation**: Works without network or GitHub remote
49
+
50
+ ## Installation
51
+
52
+ ### Recommended: Python package
53
+
54
+ Run the (python) CLI without installing anything permanently:
55
+
56
+ ```bash
57
+ uvx --from wtg-cli wtg --help
58
+ ```
59
+
60
+ Or install it as a global tool (works on macOS, Linux, and Windows):
61
+
62
+ ```bash
63
+ uv tool install wtg-cli
64
+ wtg --help
65
+ ```
66
+
67
+ ### Alternative: build/install from source
68
+
69
+ ```bash
70
+ cargo install wtg-cli
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ### Local Repository
76
+
77
+ Simply run `wtg` with any of the following:
78
+
79
+ ```bash
80
+ # Find a commit by hash
81
+ wtg c62bbcc
82
+
83
+ # Find an issue or PR
84
+ wtg 123
85
+ wtg #123
86
+
87
+ # Find a file
88
+ wtg Cargo.toml
89
+
90
+ # Find a tag
91
+ wtg v1.2.3
92
+ ```
93
+
94
+ ### Remote Repository
95
+
96
+ Query any GitHub repository without cloning it first:
97
+
98
+ ```bash
99
+ # Using -r flag with owner/repo
100
+ wtg -r astral-sh/uv 0.5.0
101
+
102
+ # Using full GitHub URL
103
+ wtg -r https://github.com/astral-sh/uv v0.5.0
104
+
105
+ # Paste any GitHub URL directly
106
+ wtg https://github.com/astral-sh/uv/commit/abc123
107
+ wtg https://github.com/astral-sh/uv/issues/42
108
+ wtg https://github.com/astral-sh/uv/pull/123
109
+ wtg https://github.com/astral-sh/uv/blob/main/README.md
110
+ ```
111
+
112
+ **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`.
113
+
114
+ ## Output Examples
115
+
116
+ ### Commit
117
+ ```
118
+ 🔍 Found commit: c4e0cc8e98d3
119
+
120
+ 💻 The Commit:
121
+ Hash: c4e0cc8
122
+ 👤 Who wrote this gem:
123
+ mishamsk (5206955+mishamsk@users.noreply.github.com)
124
+ 🔗 https://github.com/mishamsk
125
+ 📝 ⬇️ reduce msrv
126
+ 📅 2024-11-07 03:37:26
127
+ 🔗 https://github.com/mishamsk/sas-lexer/commit/c4e0cc8e98d3e786916ac811c5617ecb68d1a6fd
128
+
129
+ 📦 First shipped in:
130
+ 🎉 rust-v1.0.0-beta.3 (rust-v1.0.0-beta.3)
131
+ 📅 2024-11-08 03:03:21 U
132
+ 🔗 https://github.com/mishamsk/sas-lexer/releases/tag/rust-v1.0.0-beta.3
133
+ ```
134
+
135
+ ## GitHub Authentication
136
+
137
+ For better rate limits, set a GitHub token:
138
+
139
+ 1. **Environment variable** (recommended):
140
+ ```bash
141
+ export GITHUB_TOKEN=ghp_your_token_here
142
+ ```
143
+
144
+ 2. **GitHub CLI**: wtg automatically reads from `~/.config/gh/hosts.yml` if you have `gh` installed
145
+
146
+ 3. **Anonymous**: Works without auth but has lower rate limits (60 requests/hour)
147
+
148
+ ## How It Works
149
+
150
+ 1. Opens your git repository
151
+ 2. Tries to identify the input type (commit, issue, file, tag)
152
+ 3. Fetches additional info from GitHub API if available
153
+ 4. Finds the closest release that contains the commit
154
+ 5. Displays everything in a beautiful, colorful format
155
+
156
+ ## Limitations
157
+
158
+ - Only supports GitHub (GitLab and others coming... maybe?)
159
+ - Squashed commits detection not yet implemented
160
+ - No TUI mode (planned for future)
161
+
162
+ ## License
163
+
164
+ MIT
165
+
166
+ ## Contributing
167
+
168
+ 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.
169
+
@@ -0,0 +1,9 @@
1
+ wtg_cli-0.1.1.dist-info/METADATA,sha256=KHZCPE_nbcueoXtMEysXJT1Pkc7v15DKw-jR_IKUj54,5227
2
+ wtg_cli-0.1.1.dist-info/WHEEL,sha256=TJQY77QRLvXq32tEs9ATmwKO6NAOtuKOAw50eyiSmWU,96
3
+ wtg_cli-0.1.1.dist-info/entry_points.txt,sha256=v3pdriVnHV-N7dP3Y9bbhUFno6m-gRk_57hNq4vNFgA,39
4
+ wtg_cli-0.1.1.dist-info/licenses/LICENSE,sha256=5beZsDWkpy61sDNmto1ClYsqh_KnowEDb3YcWuRHfMk,1089
5
+ wtg_cli/__init__.py,sha256=hyOom6FHhDhBYwXHgn49jUwHg8b4oPpH3RONGar821o,363
6
+ wtg_cli/__main__.py,sha256=y-tanBpdvSApMQqB0CKa2rRfKw9eaCGsQEZEuM6NoGo,131
7
+ wtg_cli/_wtg.cp313-win_amd64.pyd,sha256=Ej5YYuJ2MRWF4iIkbUGtXBdkayM2mC7GrgQK1E5j4QM,9942528
8
+ wtg_cli/cli.py,sha256=RaQY4DKipZo7OmARWSQyMhCs_RPxDk-8UBD3ktMKwi0,840
9
+ wtg_cli-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.9.6)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-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.