wtg-cli 0.1.0__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,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: wtg-cli
3
+ Version: 0.1.0
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
+ ## Features
23
+
24
+ - 🔍 **Smart Detection**: Automatically identifies what you're looking for (commit hash, issue/PR number, file path, or tag)
25
+ - 🌐 **Remote Repository Support**: Work with any GitHub repository without cloning it locally
26
+ - 🔗 **GitHub URL Parsing**: Paste any GitHub URL (commit, issue, PR, file) and wtg figures it out
27
+ - 🎨 **Colorful Output**: Beautiful terminal output with emojis and colors
28
+ - 😄 **Snarky Messages**: Helpful error messages with personality
29
+ - 📦 **Release Tracking**: Finds which release first shipped your commit
30
+ - 👤 **Blame Info**: Shows who's responsible for that pesky bug
31
+ - 🚀 **Smart Caching**: Efficiently caches remote repositories with minimal disk usage
32
+ - 🌐 **Graceful Degradation**: Works without network or GitHub remote
33
+
34
+ ## Installation
35
+
36
+ ### Recommended: Python package
37
+
38
+ Run the (python) CLI without installing anything permanently:
39
+
40
+ ```bash
41
+ uvx --from wtg-cli wtg --help
42
+ ```
43
+
44
+ Or install it as a global tool (works on macOS, Linux, and Windows):
45
+
46
+ ```bash
47
+ uv tool install wtg-cli
48
+ wtg --help
49
+ ```
50
+
51
+ ### Alternative: build/install from source
52
+
53
+ ```bash
54
+ cargo install wtg-cli
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ### Local Repository
60
+
61
+ Simply run `wtg` with any of the following:
62
+
63
+ ```bash
64
+ # Find a commit by hash
65
+ wtg c62bbcc
66
+
67
+ # Find an issue or PR
68
+ wtg 123
69
+ wtg #123
70
+
71
+ # Find a file
72
+ wtg Cargo.toml
73
+
74
+ # Find a tag
75
+ wtg v1.2.3
76
+ ```
77
+
78
+ ### Remote Repository
79
+
80
+ Query any GitHub repository without cloning it first:
81
+
82
+ ```bash
83
+ # Using -r flag with owner/repo
84
+ wtg -r astral-sh/uv 0.5.0
85
+
86
+ # Using full GitHub URL
87
+ wtg -r https://github.com/astral-sh/uv v0.5.0
88
+
89
+ # Paste any GitHub URL directly
90
+ wtg https://github.com/astral-sh/uv/commit/abc123
91
+ wtg https://github.com/astral-sh/uv/issues/42
92
+ wtg https://github.com/astral-sh/uv/pull/123
93
+ wtg https://github.com/astral-sh/uv/blob/main/README.md
94
+ ```
95
+
96
+ **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.
97
+
98
+ ## Output Examples
99
+
100
+ ### Commit
101
+ ```
102
+ 🔍 Found commit: c4e0cc8e98d3
103
+
104
+ 💻 The Commit:
105
+ Hash: c4e0cc8
106
+ 👤 Who wrote this gem:
107
+ mishamsk (5206955+mishamsk@users.noreply.github.com)
108
+ 🔗 https://github.com/mishamsk
109
+ 📝 ⬇️ reduce msrv
110
+ 📅 2024-11-07 03:37:26
111
+ 🔗 https://github.com/mishamsk/sas-lexer/commit/c4e0cc8e98d3e786916ac811c5617ecb68d1a6fd
112
+
113
+ 📦 First shipped in:
114
+ 🎉 rust-v1.0.0-beta.3 (rust-v1.0.0-beta.3)
115
+ 📅 2024-11-08 03:03:21 U
116
+ 🔗 https://github.com/mishamsk/sas-lexer/releases/tag/rust-v1.0.0-beta.3
117
+ ```
118
+
119
+ ## GitHub Authentication
120
+
121
+ For better rate limits, set a GitHub token:
122
+
123
+ 1. **Environment variable** (recommended):
124
+ ```bash
125
+ export GITHUB_TOKEN=ghp_your_token_here
126
+ ```
127
+
128
+ 2. **GitHub CLI**: wtg automatically reads from `~/.config/gh/hosts.yml` if you have `gh` installed
129
+
130
+ 3. **Anonymous**: Works without auth but has lower rate limits (60 requests/hour)
131
+
132
+ ## How It Works
133
+
134
+ 1. Opens your git repository
135
+ 2. Tries to identify the input type (commit, issue, file, tag)
136
+ 3. Fetches additional info from GitHub API if available
137
+ 4. Finds the closest release that contains the commit
138
+ 5. Displays everything in a beautiful, colorful format
139
+
140
+ ## Limitations
141
+
142
+ - Only supports GitHub (GitLab and others coming... maybe?)
143
+ - Squashed commits detection not yet implemented
144
+ - No TUI mode (planned for future)
145
+
146
+ ## License
147
+
148
+ MIT
149
+
150
+ ## Contributing
151
+
152
+ 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.
153
+
@@ -0,0 +1,9 @@
1
+ wtg_cli-0.1.0.dist-info/METADATA,sha256=-c0zm8D-MHRar4hsatWEVns8q0DHUN4hONrf41WUhP0,4541
2
+ wtg_cli-0.1.0.dist-info/WHEEL,sha256=TJQY77QRLvXq32tEs9ATmwKO6NAOtuKOAw50eyiSmWU,96
3
+ wtg_cli-0.1.0.dist-info/entry_points.txt,sha256=v3pdriVnHV-N7dP3Y9bbhUFno6m-gRk_57hNq4vNFgA,39
4
+ wtg_cli-0.1.0.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=dUBbm5FQv_loo_tTpmkodfLmrBSpzpgQk1b9zJsap0I,9818112
8
+ wtg_cli/cli.py,sha256=RaQY4DKipZo7OmARWSQyMhCs_RPxDk-8UBD3ktMKwi0,840
9
+ wtg_cli-0.1.0.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.