gitshorts 1.0.3__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.
Files changed (54) hide show
  1. gitshorts-1.0.3/LICENSE +21 -0
  2. gitshorts-1.0.3/PKG-INFO +265 -0
  3. gitshorts-1.0.3/README.md +220 -0
  4. gitshorts-1.0.3/gitfast/__init__.py +15 -0
  5. gitshorts-1.0.3/gitfast/cli.py +72 -0
  6. gitshorts-1.0.3/gitfast/core/__init__.py +0 -0
  7. gitshorts-1.0.3/gitfast/core/detector.py +63 -0
  8. gitshorts-1.0.3/gitfast/core/installer.py +111 -0
  9. gitshorts-1.0.3/gitfast/core/push_resolver.py +242 -0
  10. gitshorts-1.0.3/gitfast/core/setup_wizard.py +316 -0
  11. gitshorts-1.0.3/gitfast/core/uninstaller.py +86 -0
  12. gitshorts-1.0.3/gitfast/core/updater.py +106 -0
  13. gitshorts-1.0.3/gitfast/main.py +10 -0
  14. gitshorts-1.0.3/gitfast/merge/__init__.py +0 -0
  15. gitshorts-1.0.3/gitfast/merge/backup.py +105 -0
  16. gitshorts-1.0.3/gitfast/merge/detector.py +103 -0
  17. gitshorts-1.0.3/gitfast/merge/interactive.py +127 -0
  18. gitshorts-1.0.3/gitfast/merge/parser.py +159 -0
  19. gitshorts-1.0.3/gitfast/merge/resolver.py +120 -0
  20. gitshorts-1.0.3/gitfast/merge/strategies.py +150 -0
  21. gitshorts-1.0.3/gitfast/shells/__init__.py +0 -0
  22. gitshorts-1.0.3/gitfast/shells/bash.py +285 -0
  23. gitshorts-1.0.3/gitfast/shells/fish.py +319 -0
  24. gitshorts-1.0.3/gitfast/shells/powershell.py +284 -0
  25. gitshorts-1.0.3/gitfast/shells/zsh.py +281 -0
  26. gitshorts-1.0.3/gitfast/shortcuts/__init__.py +0 -0
  27. gitshorts-1.0.3/gitfast/shortcuts/auth.py +198 -0
  28. gitshorts-1.0.3/gitfast/shortcuts/tier1.py +103 -0
  29. gitshorts-1.0.3/gitfast/shortcuts/tier2.py +137 -0
  30. gitshorts-1.0.3/gitfast/shortcuts/tier3.py +161 -0
  31. gitshorts-1.0.3/gitfast/shortcuts/tier4.py +200 -0
  32. gitshorts-1.0.3/gitfast/token/__init__.py +0 -0
  33. gitshorts-1.0.3/gitfast/token/expiry.py +134 -0
  34. gitshorts-1.0.3/gitfast/token/manager.py +218 -0
  35. gitshorts-1.0.3/gitfast/token/storage.py +291 -0
  36. gitshorts-1.0.3/gitfast/token/validator.py +187 -0
  37. gitshorts-1.0.3/gitfast/utils/__init__.py +0 -0
  38. gitshorts-1.0.3/gitfast/utils/colors.py +63 -0
  39. gitshorts-1.0.3/gitfast/utils/git.py +114 -0
  40. gitshorts-1.0.3/gitfast/utils/os_utils.py +108 -0
  41. gitshorts-1.0.3/gitshorts.egg-info/PKG-INFO +265 -0
  42. gitshorts-1.0.3/gitshorts.egg-info/SOURCES.txt +52 -0
  43. gitshorts-1.0.3/gitshorts.egg-info/dependency_links.txt +1 -0
  44. gitshorts-1.0.3/gitshorts.egg-info/entry_points.txt +4 -0
  45. gitshorts-1.0.3/gitshorts.egg-info/top_level.txt +1 -0
  46. gitshorts-1.0.3/pyproject.toml +46 -0
  47. gitshorts-1.0.3/setup.cfg +4 -0
  48. gitshorts-1.0.3/setup.py +31 -0
  49. gitshorts-1.0.3/tests/test_auth.py +37 -0
  50. gitshorts-1.0.3/tests/test_installer.py +31 -0
  51. gitshorts-1.0.3/tests/test_merge.py +227 -0
  52. gitshorts-1.0.3/tests/test_shells.py +90 -0
  53. gitshorts-1.0.3/tests/test_shortcuts.py +136 -0
  54. gitshorts-1.0.3/tests/test_token.py +99 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ekaanksh-dev
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.
@@ -0,0 +1,265 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitshorts
3
+ Version: 1.0.3
4
+ Summary: 42 git shortcuts + auto merge conflict resolver — zero AI, pure Python
5
+ Home-page: https://github.com/Ekaanksh-dev/gitfast
6
+ Author: Ekaanksh Patil
7
+ Author-email: Ekaanksh Patil <pekanksh@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Ekaanksh-dev
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Project-URL: Homepage, https://github.com/Ekaanksh-dev/gitfast
31
+ Project-URL: Issues, https://github.com/Ekaanksh-dev/gitfast/issues
32
+ Keywords: git,shortcuts,developer-tools,merge,cli,productivity
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Operating System :: OS Independent
36
+ Classifier: Environment :: Console
37
+ Classifier: Topic :: Software Development :: Version Control :: Git
38
+ Requires-Python: >=3.7
39
+ Description-Content-Type: text/markdown
40
+ License-File: LICENSE
41
+ Dynamic: author
42
+ Dynamic: home-page
43
+ Dynamic: license-file
44
+ Dynamic: requires-python
45
+
46
+ # gitshorts
47
+
48
+ 42 git shortcuts + auto merge conflict resolver — zero AI, pure Python
49
+
50
+ ```bash
51
+ pip install gitshorts
52
+ gitshorts install
53
+ ghelp
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Why gitfast?
59
+
60
+ Before gitfast — 3 commands every commit:
61
+ ```bash
62
+ git add .
63
+ git commit -m "fix login bug"
64
+ git push origin main
65
+ ```
66
+
67
+ After gitfast — 1 command:
68
+ ```bash
69
+ gcp "fix login bug"
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Install
75
+
76
+ ```bash
77
+ # install
78
+ pip install gitshorts
79
+
80
+ # setup
81
+ gitshorts install
82
+
83
+ # reload your shell
84
+ source ~/.bashrc # bash
85
+ source ~/.zshrc # zsh
86
+ source ~/.config/fish/config.fish # fish
87
+
88
+ # verify
89
+ ghelp
90
+ ```
91
+
92
+ ---
93
+
94
+ ## All Commands
95
+
96
+ ### TIER 1 — Daily
97
+
98
+ | Command | Does | Replaces |
99
+ |---------|------|---------|
100
+ | `gs` | git status short | `git status` |
101
+ | `gc "msg"` | add + commit | `git add . && git commit -m` |
102
+ | `gcp "msg"` | add + commit + push | 3 separate commands |
103
+ | `gpl` | pull current branch | `git pull origin <branch>` |
104
+
105
+ ### TIER 2 — Weekly
106
+
107
+ | Command | Does | Replaces |
108
+ |---------|------|---------|
109
+ | `gb` | list all branches | `git branch -a` |
110
+ | `gnb "name"` | new branch + push upstream | 2 commands |
111
+ | `gsw "branch"` | switch branch | `git switch` |
112
+ | `gm "branch"` | merge branch | `git merge` |
113
+ | `gl` | pretty log last 20 | `git log --oneline --graph` |
114
+ | `gll` | log with file stats | `git log --stat` |
115
+ | `gd` | diff summary | `git diff --stat` |
116
+ | `gdf "file"` | diff one file | `git diff <file>` |
117
+ | `gcl "url"` | clone repo | `git clone` |
118
+
119
+ ### TIER 3 — Rescue
120
+
121
+ | Command | Does | Replaces |
122
+ |---------|------|---------|
123
+ | `gundo` | undo last commit keep staged | `git reset --soft HEAD~1` |
124
+ | `gundo2` | undo last commit unstage | `git reset HEAD~1` |
125
+ | `gsave "label"` | stash with label | `git stash push -m` |
126
+ | `gpop` | pop latest stash | `git stash pop` |
127
+ | `gstashes` | list all stashes | `git stash list` |
128
+ | `gdrop N` | drop stash N | `git stash drop stash@{N}` |
129
+ | `gsquash N` | squash last N commits | `git rebase -i HEAD~N` |
130
+ | `gabort` | abort merge or rebase | `git merge --abort` |
131
+ | `gnuke` | wipe all uncommitted changes | `git reset --hard HEAD` |
132
+
133
+ ### TIER 4 — Power
134
+
135
+ | Command | Does | Replaces |
136
+ |---------|------|---------|
137
+ | `gf` | fetch all remotes | `git fetch --all --prune` |
138
+ | `gtag v1.0` | tag + push release | 2 commands |
139
+ | `gtags` | list all tags | `git tag -l` |
140
+ | `gwho "file"` | blame file | `git blame` |
141
+ | `greflog` | full history + deleted | `git reflog` |
142
+ | `gshow "hash"` | inspect commit | `git show --stat` |
143
+ | `gclean` | delete merged branches | complex command |
144
+ | `gremotes` | show all remotes | `git remote -v` |
145
+
146
+ ### AUTH
147
+
148
+ | Command | Does |
149
+ |---------|------|
150
+ | `gtest_ssh` | test SSH to GitHub/GitLab/Bitbucket |
151
+ | `gsetup_ssh` | full SSH key setup in one command |
152
+ | `gsetup_creds` | configure OS credential helper |
153
+ | `ghttps_to_ssh` | convert HTTPS remote to SSH |
154
+ | `gauth_info` | show full auth status |
155
+
156
+ ### TOKEN
157
+
158
+ | Command | Does |
159
+ |---------|------|
160
+ | `gtoken setup` | store GitHub PAT securely |
161
+ | `gtoken test` | verify token works |
162
+ | `gtoken refresh` | update expired token |
163
+ | `gtoken revoke` | remove stored token |
164
+ | `gtoken info` | show token status + expiry |
165
+
166
+ ### MERGE — The Killer Feature
167
+
168
+ | Command | Does |
169
+ |---------|------|
170
+ | `gconflicts` | scan + list all conflicts |
171
+ | `gmerge` | auto resolve all conflicts |
172
+ | `gmerge -i` | interactive — pick ours/theirs per conflict |
173
+ | `gmerge --ours` | always keep our changes |
174
+ | `gmerge --theirs` | always keep their changes |
175
+ | `gmerge --dry-run` | show conflicts without resolving |
176
+
177
+ ---
178
+
179
+ ## Auto Push Error Fix
180
+
181
+ gitfast automatically fixes the most common push error:
182
+
183
+ error: failed to push some refs
184
+ hint: Updates were rejected because the remote
185
+ hint: contains work that you do not have locally
186
+
187
+
188
+ When this happens gitfast:
189
+ detects the error automatically
190
+ pulls remote changes
191
+ merges with your changes
192
+ resolves conflicts if any
193
+ pushes again
194
+
195
+ You never see this error with gitfast.
196
+
197
+ ---
198
+
199
+ ## Token Security
200
+
201
+ gitfast stores your GitHub token in OS secure storage:
202
+
203
+ | OS | Storage |
204
+ |----|---------|
205
+ | macOS | Keychain |
206
+ | Linux | GNOME Keyring |
207
+ | Windows | Credential Manager |
208
+ | Any OS | ~/.netrc (chmod 600) |
209
+
210
+ Token is never stored in plain text. Never in .bashrc. Never logged.
211
+
212
+ ---
213
+
214
+ ## Shell Support
215
+
216
+ | Shell | Support |
217
+ |-------|---------|
218
+ | Bash | full |
219
+ | Zsh | full |
220
+ | Fish | full |
221
+ | PowerShell | full |
222
+
223
+ ---
224
+
225
+ ## OS Support
226
+
227
+ | OS | Support |
228
+ |----|---------|
229
+ | Ubuntu / Debian | full |
230
+ | Arch / Manjaro | full |
231
+ | Fedora / RHEL | full |
232
+ | macOS | full |
233
+ | WSL2 | full |
234
+ | Git Bash | full |
235
+ | Any OS | netrc fallback |
236
+
237
+ ---
238
+
239
+ ## Uninstall
240
+
241
+ ```bash
242
+ gitshorts uninstall
243
+ pip uninstall gitshorts
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Update
249
+
250
+ ```bash
251
+ gitshorts update
252
+ ```
253
+
254
+ ---
255
+
256
+ ## License
257
+
258
+ MIT — see LICENSE file
259
+
260
+ ---
261
+
262
+ ## Author
263
+
264
+ Built for developers who live in the terminal.
265
+ # gitshorts — 42 git shortcuts
@@ -0,0 +1,220 @@
1
+ # gitshorts
2
+
3
+ 42 git shortcuts + auto merge conflict resolver — zero AI, pure Python
4
+
5
+ ```bash
6
+ pip install gitshorts
7
+ gitshorts install
8
+ ghelp
9
+ ```
10
+
11
+ ---
12
+
13
+ ## Why gitfast?
14
+
15
+ Before gitfast — 3 commands every commit:
16
+ ```bash
17
+ git add .
18
+ git commit -m "fix login bug"
19
+ git push origin main
20
+ ```
21
+
22
+ After gitfast — 1 command:
23
+ ```bash
24
+ gcp "fix login bug"
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ # install
33
+ pip install gitshorts
34
+
35
+ # setup
36
+ gitshorts install
37
+
38
+ # reload your shell
39
+ source ~/.bashrc # bash
40
+ source ~/.zshrc # zsh
41
+ source ~/.config/fish/config.fish # fish
42
+
43
+ # verify
44
+ ghelp
45
+ ```
46
+
47
+ ---
48
+
49
+ ## All Commands
50
+
51
+ ### TIER 1 — Daily
52
+
53
+ | Command | Does | Replaces |
54
+ |---------|------|---------|
55
+ | `gs` | git status short | `git status` |
56
+ | `gc "msg"` | add + commit | `git add . && git commit -m` |
57
+ | `gcp "msg"` | add + commit + push | 3 separate commands |
58
+ | `gpl` | pull current branch | `git pull origin <branch>` |
59
+
60
+ ### TIER 2 — Weekly
61
+
62
+ | Command | Does | Replaces |
63
+ |---------|------|---------|
64
+ | `gb` | list all branches | `git branch -a` |
65
+ | `gnb "name"` | new branch + push upstream | 2 commands |
66
+ | `gsw "branch"` | switch branch | `git switch` |
67
+ | `gm "branch"` | merge branch | `git merge` |
68
+ | `gl` | pretty log last 20 | `git log --oneline --graph` |
69
+ | `gll` | log with file stats | `git log --stat` |
70
+ | `gd` | diff summary | `git diff --stat` |
71
+ | `gdf "file"` | diff one file | `git diff <file>` |
72
+ | `gcl "url"` | clone repo | `git clone` |
73
+
74
+ ### TIER 3 — Rescue
75
+
76
+ | Command | Does | Replaces |
77
+ |---------|------|---------|
78
+ | `gundo` | undo last commit keep staged | `git reset --soft HEAD~1` |
79
+ | `gundo2` | undo last commit unstage | `git reset HEAD~1` |
80
+ | `gsave "label"` | stash with label | `git stash push -m` |
81
+ | `gpop` | pop latest stash | `git stash pop` |
82
+ | `gstashes` | list all stashes | `git stash list` |
83
+ | `gdrop N` | drop stash N | `git stash drop stash@{N}` |
84
+ | `gsquash N` | squash last N commits | `git rebase -i HEAD~N` |
85
+ | `gabort` | abort merge or rebase | `git merge --abort` |
86
+ | `gnuke` | wipe all uncommitted changes | `git reset --hard HEAD` |
87
+
88
+ ### TIER 4 — Power
89
+
90
+ | Command | Does | Replaces |
91
+ |---------|------|---------|
92
+ | `gf` | fetch all remotes | `git fetch --all --prune` |
93
+ | `gtag v1.0` | tag + push release | 2 commands |
94
+ | `gtags` | list all tags | `git tag -l` |
95
+ | `gwho "file"` | blame file | `git blame` |
96
+ | `greflog` | full history + deleted | `git reflog` |
97
+ | `gshow "hash"` | inspect commit | `git show --stat` |
98
+ | `gclean` | delete merged branches | complex command |
99
+ | `gremotes` | show all remotes | `git remote -v` |
100
+
101
+ ### AUTH
102
+
103
+ | Command | Does |
104
+ |---------|------|
105
+ | `gtest_ssh` | test SSH to GitHub/GitLab/Bitbucket |
106
+ | `gsetup_ssh` | full SSH key setup in one command |
107
+ | `gsetup_creds` | configure OS credential helper |
108
+ | `ghttps_to_ssh` | convert HTTPS remote to SSH |
109
+ | `gauth_info` | show full auth status |
110
+
111
+ ### TOKEN
112
+
113
+ | Command | Does |
114
+ |---------|------|
115
+ | `gtoken setup` | store GitHub PAT securely |
116
+ | `gtoken test` | verify token works |
117
+ | `gtoken refresh` | update expired token |
118
+ | `gtoken revoke` | remove stored token |
119
+ | `gtoken info` | show token status + expiry |
120
+
121
+ ### MERGE — The Killer Feature
122
+
123
+ | Command | Does |
124
+ |---------|------|
125
+ | `gconflicts` | scan + list all conflicts |
126
+ | `gmerge` | auto resolve all conflicts |
127
+ | `gmerge -i` | interactive — pick ours/theirs per conflict |
128
+ | `gmerge --ours` | always keep our changes |
129
+ | `gmerge --theirs` | always keep their changes |
130
+ | `gmerge --dry-run` | show conflicts without resolving |
131
+
132
+ ---
133
+
134
+ ## Auto Push Error Fix
135
+
136
+ gitfast automatically fixes the most common push error:
137
+
138
+ error: failed to push some refs
139
+ hint: Updates were rejected because the remote
140
+ hint: contains work that you do not have locally
141
+
142
+
143
+ When this happens gitfast:
144
+ detects the error automatically
145
+ pulls remote changes
146
+ merges with your changes
147
+ resolves conflicts if any
148
+ pushes again
149
+
150
+ You never see this error with gitfast.
151
+
152
+ ---
153
+
154
+ ## Token Security
155
+
156
+ gitfast stores your GitHub token in OS secure storage:
157
+
158
+ | OS | Storage |
159
+ |----|---------|
160
+ | macOS | Keychain |
161
+ | Linux | GNOME Keyring |
162
+ | Windows | Credential Manager |
163
+ | Any OS | ~/.netrc (chmod 600) |
164
+
165
+ Token is never stored in plain text. Never in .bashrc. Never logged.
166
+
167
+ ---
168
+
169
+ ## Shell Support
170
+
171
+ | Shell | Support |
172
+ |-------|---------|
173
+ | Bash | full |
174
+ | Zsh | full |
175
+ | Fish | full |
176
+ | PowerShell | full |
177
+
178
+ ---
179
+
180
+ ## OS Support
181
+
182
+ | OS | Support |
183
+ |----|---------|
184
+ | Ubuntu / Debian | full |
185
+ | Arch / Manjaro | full |
186
+ | Fedora / RHEL | full |
187
+ | macOS | full |
188
+ | WSL2 | full |
189
+ | Git Bash | full |
190
+ | Any OS | netrc fallback |
191
+
192
+ ---
193
+
194
+ ## Uninstall
195
+
196
+ ```bash
197
+ gitshorts uninstall
198
+ pip uninstall gitshorts
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Update
204
+
205
+ ```bash
206
+ gitshorts update
207
+ ```
208
+
209
+ ---
210
+
211
+ ## License
212
+
213
+ MIT — see LICENSE file
214
+
215
+ ---
216
+
217
+ ## Author
218
+
219
+ Built for developers who live in the terminal.
220
+ # gitshorts — 42 git shortcuts
@@ -0,0 +1,15 @@
1
+ __version__ = "1.0.3"
2
+ __author__ = "Ekaanksh Patil"
3
+ __email__ = "pekanksh@email.com"
4
+ __license__ = "MIT"
5
+ __description__ = "42 git shortcuts + auto merge conflict resolver"
6
+
7
+ from gitfast.utils.colors import Colors
8
+
9
+ def banner():
10
+ print(f"""
11
+ {Colors.BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}
12
+ {Colors.YELLOW} ⚡ gitfast v{__version__}{Colors.RESET}
13
+ {Colors.GRAY} 42 git shortcuts. Zero friction.{Colors.RESET}
14
+ {Colors.BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}
15
+ """)
@@ -0,0 +1,72 @@
1
+ import sys
2
+ from gitfast.utils.colors import Printer
3
+ from gitfast import __version__
4
+ from gitfast.core.installer import install
5
+ from gitfast.core.uninstaller import uninstall
6
+ from gitfast.core.updater import update, check_for_updates
7
+ from gitfast.token.manager import gtoken
8
+ from gitfast.core.setup_wizard import gsetup
9
+
10
+
11
+ def main():
12
+ """Main CLI entry point — gitfast command"""
13
+ args = sys.argv[1:]
14
+
15
+ if not args:
16
+ install()
17
+ return
18
+
19
+ cmd = args[0]
20
+
21
+ if cmd == "install":
22
+ install()
23
+
24
+ elif cmd == "uninstall":
25
+ uninstall()
26
+
27
+ elif cmd == "update":
28
+ update()
29
+
30
+ elif cmd == "check":
31
+ check_for_updates()
32
+
33
+ elif cmd == "version":
34
+ print(f"gitfast v{__version__}")
35
+
36
+ elif cmd == "setup":
37
+ gsetup()
38
+
39
+ elif cmd == "token":
40
+ action = args[1] if len(args) > 1 else "info"
41
+ gtoken(action)
42
+
43
+ else:
44
+ Printer.error(f"Unknown command: {cmd}")
45
+ help_cmd()
46
+
47
+
48
+ def help_cmd():
49
+ """Show all available commands"""
50
+ Printer.header(f"gitfast v{__version__}")
51
+ print(" USAGE: gitfast <command>")
52
+ print("")
53
+ print(" COMMANDS:")
54
+ print(" install install shortcuts into your shell")
55
+ print(" uninstall remove gitfast from all shells")
56
+ print(" update update to latest version")
57
+ print(" check check if update available")
58
+ print(" version show current version")
59
+ print(" token manage GitHub token")
60
+ print("")
61
+ print(" TOKEN:")
62
+ print(" token setup store token securely")
63
+ print(" token test verify token works")
64
+ print(" token refresh update expired token")
65
+ print(" token revoke remove token")
66
+ print(" token info show token status")
67
+ print("")
68
+ print(" SHORTCUTS (after install):")
69
+ print(" ghelp show all git shortcuts")
70
+ print(" gcp 'msg' add + commit + push")
71
+ print(" gmerge auto resolve conflicts")
72
+ Printer.divider()
File without changes
@@ -0,0 +1,63 @@
1
+ import sys
2
+ from gitfast.utils.os_utils import (
3
+ get_os,
4
+ get_shell,
5
+ get_shell_config,
6
+ get_package_manager,
7
+ is_git_installed,
8
+ )
9
+ from gitfast.utils.colors import Printer
10
+
11
+
12
+ class SystemInfo:
13
+ def __init__(self):
14
+ self.os = get_os()
15
+ self.shell = get_shell()
16
+ self.config = get_shell_config()
17
+ self.pkg_mgr = get_package_manager()
18
+ self.git_ok = is_git_installed()
19
+
20
+ def display(self):
21
+ Printer.header("System Detection")
22
+ print(f" OS : {self.os}")
23
+ print(f" Shell : {self.shell}")
24
+ print(f" Config file : {self.config}")
25
+ print(f" Package manager : {self.pkg_mgr}")
26
+ print(f" Git installed : {'yes' if self.git_ok else 'no'}")
27
+ Printer.divider()
28
+
29
+ def is_supported(self):
30
+ if self.os == "unknown":
31
+ Printer.error("Unsupported OS detected")
32
+ return False
33
+
34
+ if not self.git_ok:
35
+ Printer.error("Git is not installed")
36
+ Printer.info(f"Install it with: {self._git_install_cmd()}")
37
+ return False
38
+
39
+ return True
40
+
41
+ def _git_install_cmd(self):
42
+ cmds = {
43
+ "ubuntu": "sudo apt install git",
44
+ "arch": "sudo pacman -S git",
45
+ "fedora": "sudo dnf install git",
46
+ "macos": "brew install git",
47
+ "wsl2": "sudo apt install git",
48
+ "gitbash":"winget install git",
49
+ }
50
+ return cmds.get(self.os, "sudo apt install git")
51
+
52
+
53
+ def detect():
54
+ """Run full system detection and return SystemInfo"""
55
+ info = SystemInfo()
56
+ info.display()
57
+
58
+ if not info.is_supported():
59
+ Printer.error("System not supported — exiting")
60
+ sys.exit(1)
61
+
62
+ Printer.success("System supported — ready to install")
63
+ return info