pygitgo 1.7.1__tar.gz → 1.8.1__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 (73) hide show
  1. {pygitgo-1.7.1/src/pygitgo.egg-info → pygitgo-1.8.1}/PKG-INFO +94 -16
  2. {pygitgo-1.7.1 → pygitgo-1.8.1}/README.md +94 -16
  3. {pygitgo-1.7.1 → pygitgo-1.8.1}/pyproject.toml +1 -1
  4. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/auth/account.py +25 -1
  5. pygitgo-1.8.1/src/pygitgo/auth/manager.py +134 -0
  6. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/auth/ssh_utils.py +87 -32
  7. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/git_branch.py +4 -4
  8. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/git_core.py +14 -11
  9. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/git_remote.py +9 -11
  10. pygitgo-1.8.1/src/pygitgo/commands/init.py +324 -0
  11. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/jump.py +26 -26
  12. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/link.py +21 -18
  13. pygitgo-1.8.1/src/pygitgo/commands/new.py +21 -0
  14. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/pull.py +3 -5
  15. pygitgo-1.8.1/src/pygitgo/commands/repo.py +148 -0
  16. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/stash.py +14 -12
  17. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/undo.py +4 -6
  18. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/exceptions.py +0 -11
  19. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/main.py +111 -0
  20. pygitgo-1.8.1/src/pygitgo/utils/bootstrap.py +15 -0
  21. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/utils/config.py +6 -4
  22. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/utils/executor.py +10 -2
  23. pygitgo-1.8.1/src/pygitgo/utils/platform.py +50 -0
  24. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/utils/validators.py +1 -1
  25. {pygitgo-1.7.1 → pygitgo-1.8.1/src/pygitgo.egg-info}/PKG-INFO +94 -16
  26. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo.egg-info/SOURCES.txt +6 -0
  27. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_account.py +49 -1
  28. pygitgo-1.8.1/tests/test_bootstrap.py +29 -0
  29. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_config_command.py +1 -1
  30. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_config_utils.py +0 -5
  31. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_git_branch.py +6 -5
  32. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_git_core.py +22 -17
  33. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_git_remote.py +13 -18
  34. pygitgo-1.8.1/tests/test_init.py +113 -0
  35. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_jump.py +17 -17
  36. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_link.py +6 -5
  37. pygitgo-1.8.1/tests/test_manager.py +146 -0
  38. pygitgo-1.8.1/tests/test_new.py +27 -0
  39. pygitgo-1.8.1/tests/test_platform.py +62 -0
  40. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_pull.py +8 -7
  41. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_push.py +1 -2
  42. pygitgo-1.8.1/tests/test_repo.py +123 -0
  43. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_ssh_utils.py +72 -6
  44. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_stash.py +16 -8
  45. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_undo.py +4 -9
  46. pygitgo-1.7.1/src/pygitgo/auth/manager.py +0 -99
  47. pygitgo-1.7.1/src/pygitgo/utils/bootstrap.py +0 -26
  48. pygitgo-1.7.1/src/pygitgo/utils/platform.py +0 -27
  49. pygitgo-1.7.1/tests/test_bootstrap.py +0 -54
  50. pygitgo-1.7.1/tests/test_manager.py +0 -79
  51. pygitgo-1.7.1/tests/test_platform.py +0 -30
  52. {pygitgo-1.7.1 → pygitgo-1.8.1}/LICENSE +0 -0
  53. {pygitgo-1.7.1 → pygitgo-1.8.1}/setup.cfg +0 -0
  54. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/__init__.py +0 -0
  55. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/auth/__init__.py +0 -0
  56. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/__init__.py +0 -0
  57. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/config.py +0 -0
  58. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/push.py +0 -0
  59. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/staging.py +0 -0
  60. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/state.py +0 -0
  61. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/commands/user.py +0 -0
  62. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/utils/__init__.py +0 -0
  63. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/utils/colors.py +0 -0
  64. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo/utils/update_checker.py +0 -0
  65. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo.egg-info/dependency_links.txt +0 -0
  66. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo.egg-info/entry_points.txt +0 -0
  67. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo.egg-info/requires.txt +0 -0
  68. {pygitgo-1.7.1 → pygitgo-1.8.1}/src/pygitgo.egg-info/top_level.txt +0 -0
  69. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_staging.py +0 -0
  70. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_state.py +0 -0
  71. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_update_checker.py +0 -0
  72. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_user.py +0 -0
  73. {pygitgo-1.7.1 → pygitgo-1.8.1}/tests/test_validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygitgo
3
- Version: 1.7.1
3
+ Version: 1.8.1
4
4
  Summary: GitGo CLI - Your Fast Git Companion. Simplifies git push, link, stash, and user management.
5
5
  Author: Huerte
6
6
  License: GPL-3.0-or-later
@@ -32,7 +32,7 @@ Dynamic: license-file
32
32
  [![PyPI Downloads](https://img.shields.io/pypi/dm/pygitgo?color=blue)](https://pypi.org/project/pygitgo)
33
33
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
34
34
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
35
- [![Ko-fi](https://img.shields.io/badge/Support-Ko--fi-FF5E5B?logo=ko-fi&logoColor=white)](https://ko-fi.com/huerte)
35
+ [![GitHub Sponsors](https://img.shields.io/github/sponsors/Huerte?label=Sponsor&logo=github&color=EA4AAA)](https://github.com/sponsors/Huerte)
36
36
  [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS%20%7C%20Termux-lightgrey)](https://github.com/Huerte/GitGo)
37
37
 
38
38
  **Stop typing the same five Git commands. Run one instead.**
@@ -41,24 +41,24 @@ Dynamic: license-file
41
41
 
42
42
  <br />
43
43
 
44
- If GitGo saves you time, consider buying me a coffee. It helps keep the project going.
44
+ If GitGo saves you time, give it a star. If you want to go further, sponsoring helps keep it going.
45
45
 
46
- <a href="https://ko-fi.com/huerte">
47
- <img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support on Ko-fi" />
46
+ <a href="https://github.com/sponsors/Huerte">
47
+ <img src="https://img.shields.io/badge/Sponsor%20on%20GitHub-%E2%9D%A4-EA4AAA?style=for-the-badge&logo=github" alt="Sponsor on GitHub" />
48
48
  </a>
49
49
 
50
50
  </div>
51
51
 
52
52
  ---
53
53
 
54
- GitGo wraps your most-typed git commands into shorter ones. It covers init, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, and a named stash interface called state management.
54
+ GitGo wraps your most-typed git commands into shorter ones. It covers init, scaffold, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, a named stash interface called state management, and a one-shot quickstart command that takes you from nothing to a live GitHub repo in seconds.
55
55
 
56
56
  ```bash
57
57
  # Instead of this:
58
- git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
58
+ mkdir my-app && cd my-app && git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
59
59
 
60
60
  # Run this:
61
- gitgo link https://github.com/username/repo.git "init"
61
+ gitgo new my-app python
62
62
  ```
63
63
 
64
64
  ---
@@ -88,6 +88,9 @@ gitgo link https://github.com/username/repo.git "init"
88
88
  ## Features
89
89
 
90
90
  - **Single commands for linking, pushing, and stashing.** No more chaining five commands together.
91
+ - **Quickstart with `new`:** One command to scaffold your project, create the GitHub repo, and push it. No switching tabs, no manual steps.
92
+ - **Project scaffolding with `init`:** Generates a language-specific project structure with a `.gitignore` from GitHub's official templates. Supports Python, Node, Rust, Go, C#, and more.
93
+ - **Remote repo creation with `repo`:** Creates a GitHub repo directly from the terminal without touching a browser.
91
94
  - **Undo:** Roll back commits, unstage files, discard local changes, or revert pushes. The subcommands say what they do: `undo commit`, `undo add`, `undo changes`, `undo link`, `undo push`.
92
95
  - **Branch switching with `jump`:** Stashes your uncommitted work, moves to the target branch, syncs with main, and pops the stash. If a merge conflict occurs, the Try-and-Revert engine offers to roll the whole operation back.
93
96
  - **State management:** Named, indexed stash. Run `state list` to see what you saved. No more `stash@{2}` archaeology.
@@ -155,21 +158,47 @@ pip install -e .
155
158
 
156
159
  ### 1. Set Up Your Identity
157
160
 
158
- Run this once on a new machine. GitGo generates an SSH key, adds it to `ssh-agent`, prints the public key, and opens your GitHub SSH settings page so you can add it for both authentication and commit signing.
161
+ Run this once on each machine you use. GitGo generates an SSH key, prints it for you to copy, and opens GitHub so you can add it. You add the same key twice: once as an **Authentication Key** (to push and pull), once as a **Signing Key** (so your commits show Verified). After that, GitGo tests the connection and sets up your Git identity automatically.
159
162
 
160
163
  ```bash
161
164
  gitgo user login
162
165
  ```
163
166
 
164
- ### 2. Link a New Project to GitHub
167
+ For a full walkthrough with screenshots, see the [Login Guide](docs/login-guide.md).
165
168
 
166
- Point GitGo at an existing empty GitHub repo. It initializes Git, stages everything, commits, and pushes — including pulling unrelated histories if the remote isn't empty.
169
+ ### 2. Start a New Project From Scratch
170
+
171
+ One command scaffolds the local project, creates the GitHub repo, and pushes it. No tab switching.
172
+
173
+ ```bash
174
+ gitgo new my-app python
175
+ gitgo new my-app rust --private
176
+ gitgo new my-app # no scaffold, just the repo and push
177
+ ```
178
+
179
+ Or use the individual steps if you want more control:
180
+
181
+ ```bash
182
+ # Step 1: scaffold the project locally
183
+ gitgo init my-app python
184
+
185
+ # Step 2: create the remote GitHub repo
186
+ cd my-app
187
+ gitgo repo my-app --private
188
+
189
+ # Step 3: connect and push
190
+ gitgo link https://github.com/username/my-app.git
191
+ ```
192
+
193
+ ### 3. Link an Existing Project to GitHub
194
+
195
+ Point GitGo at an existing empty GitHub repo. It initializes Git, stages everything, commits, and pushes, including pulling unrelated histories if the remote isn't empty.
167
196
 
168
197
  ```bash
169
198
  gitgo link https://github.com/username/repo.git "Initial commit"
170
199
  ```
171
200
 
172
- ### 3. Push Changes
201
+ ### 4. Push Changes
173
202
 
174
203
  ```bash
175
204
  # Push to an existing branch
@@ -179,7 +208,7 @@ gitgo push main "Fix auth bug"
179
208
  gitgo push -n feat/login "Add login flow"
180
209
  ```
181
210
 
182
- ### 4. Switch Branches
211
+ ### 5. Switch Branches
183
212
 
184
213
  Switch branches with uncommitted work in progress. `jump` stashes your changes, moves to the target branch, syncs with main, and pops the stash. If the pop triggers a conflict, it offers to abort and restore the repo to its prior state.
185
214
 
@@ -187,7 +216,7 @@ Switch branches with uncommitted work in progress. `jump` stashes your changes,
187
216
  gitgo jump feat/new-login
188
217
  ```
189
218
 
190
- ### 5. Undo Mistakes
219
+ ### 6. Undo Mistakes
191
220
 
192
221
  Undo recent mistakes with commands named for what they undo.
193
222
 
@@ -199,7 +228,7 @@ gitgo undo link # Remove remote and undo initial commit
199
228
  gitgo undo push # DANGER: Revert last push with a force-push
200
229
  ```
201
230
 
202
- ### 6. Save Your Work-in-Progress
231
+ ### 7. Save Your Work-in-Progress
203
232
 
204
233
  ```bash
205
234
  gitgo state save "halfway through refactor"
@@ -207,7 +236,7 @@ gitgo state list
207
236
  gitgo state load 1
208
237
  ```
209
238
 
210
- ### 7. Custom Defaults
239
+ ### 8. Custom Defaults
211
240
 
212
241
  ```bash
213
242
  gitgo config set default-branch develop
@@ -219,6 +248,55 @@ gitgo config get default-branch
219
248
 
220
249
  ## Command Reference
221
250
 
251
+ ### `gitgo new`
252
+
253
+ One-shot quickstart. Scaffolds a local project, creates the GitHub remote repo, and pushes, all in one command.
254
+
255
+ ```bash
256
+ gitgo new <name> [lang]
257
+ gitgo new my-app python # scaffold Python project and push
258
+ gitgo new my-app rust --private # private Rust project
259
+ gitgo new my-app # no scaffold, just create repo and push
260
+ ```
261
+
262
+ | Flag | Description |
263
+ |------|-------------|
264
+ | `lang` | Language to scaffold. Options: `python`, `node`, `rust`, `go`, `cs`, and more |
265
+ | `--template OWNER/REPO` | Use a GitHub template repo instead of a language scaffold |
266
+ | `-p`, `--private` | Create a private repository |
267
+ | `-d`, `--description TEXT` | Short description shown on GitHub |
268
+
269
+ ### `gitgo init`
270
+
271
+ Scaffolds a project folder locally. Creates a README, `.gitignore` (fetched from GitHub's official templates), and language-specific starter files.
272
+
273
+ ```bash
274
+ gitgo init my-app python # generates pyproject.toml and .python-version
275
+ gitgo init my-app node # generates package.json and index.js
276
+ gitgo init my-app cs # generates .csproj and Program.cs
277
+ gitgo init my-app --template owner/repo # slug format
278
+ gitgo init my-app --template https://github.com/owner/repo # full URL accepted too
279
+ ```
280
+
281
+ Supported languages: `python` (`py`), `node` (`js`, `ts`), `rust` (`rs`), `go` (`golang`), `csharp` (`cs`), and any language with a `.gitignore` template on GitHub.
282
+
283
+ ### `gitgo repo`
284
+
285
+ Creates a remote GitHub repository without touching your local files.
286
+
287
+ ```bash
288
+ gitgo repo [name] # use current directory name if no name given
289
+ gitgo repo my-app --private
290
+ gitgo repo my-app -d "My project description"
291
+ ```
292
+
293
+ | Flag | Description |
294
+ |------|-------------|
295
+ | `-p`, `--private` | Create a private repository |
296
+ | `-d`, `--description TEXT` | Short description shown on GitHub |
297
+
298
+ On first run, GitGo opens GitHub's PAT page and prompts you to paste a token with `repo` scope. The token is saved to git config for future calls. If the token expires, GitGo detects the 401 and re-prompts automatically.
299
+
222
300
  ### `gitgo push`
223
301
 
224
302
  Stage, commit, and push in one command.
@@ -7,7 +7,7 @@
7
7
  [![PyPI Downloads](https://img.shields.io/pypi/dm/pygitgo?color=blue)](https://pypi.org/project/pygitgo)
8
8
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
9
9
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
10
- [![Ko-fi](https://img.shields.io/badge/Support-Ko--fi-FF5E5B?logo=ko-fi&logoColor=white)](https://ko-fi.com/huerte)
10
+ [![GitHub Sponsors](https://img.shields.io/github/sponsors/Huerte?label=Sponsor&logo=github&color=EA4AAA)](https://github.com/sponsors/Huerte)
11
11
  [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS%20%7C%20Termux-lightgrey)](https://github.com/Huerte/GitGo)
12
12
 
13
13
  **Stop typing the same five Git commands. Run one instead.**
@@ -16,24 +16,24 @@
16
16
 
17
17
  <br />
18
18
 
19
- If GitGo saves you time, consider buying me a coffee. It helps keep the project going.
19
+ If GitGo saves you time, give it a star. If you want to go further, sponsoring helps keep it going.
20
20
 
21
- <a href="https://ko-fi.com/huerte">
22
- <img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support on Ko-fi" />
21
+ <a href="https://github.com/sponsors/Huerte">
22
+ <img src="https://img.shields.io/badge/Sponsor%20on%20GitHub-%E2%9D%A4-EA4AAA?style=for-the-badge&logo=github" alt="Sponsor on GitHub" />
23
23
  </a>
24
24
 
25
25
  </div>
26
26
 
27
27
  ---
28
28
 
29
- GitGo wraps your most-typed git commands into shorter ones. It covers init, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, and a named stash interface called state management.
29
+ GitGo wraps your most-typed git commands into shorter ones. It covers init, scaffold, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, a named stash interface called state management, and a one-shot quickstart command that takes you from nothing to a live GitHub repo in seconds.
30
30
 
31
31
  ```bash
32
32
  # Instead of this:
33
- git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
33
+ mkdir my-app && cd my-app && git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
34
34
 
35
35
  # Run this:
36
- gitgo link https://github.com/username/repo.git "init"
36
+ gitgo new my-app python
37
37
  ```
38
38
 
39
39
  ---
@@ -63,6 +63,9 @@ gitgo link https://github.com/username/repo.git "init"
63
63
  ## Features
64
64
 
65
65
  - **Single commands for linking, pushing, and stashing.** No more chaining five commands together.
66
+ - **Quickstart with `new`:** One command to scaffold your project, create the GitHub repo, and push it. No switching tabs, no manual steps.
67
+ - **Project scaffolding with `init`:** Generates a language-specific project structure with a `.gitignore` from GitHub's official templates. Supports Python, Node, Rust, Go, C#, and more.
68
+ - **Remote repo creation with `repo`:** Creates a GitHub repo directly from the terminal without touching a browser.
66
69
  - **Undo:** Roll back commits, unstage files, discard local changes, or revert pushes. The subcommands say what they do: `undo commit`, `undo add`, `undo changes`, `undo link`, `undo push`.
67
70
  - **Branch switching with `jump`:** Stashes your uncommitted work, moves to the target branch, syncs with main, and pops the stash. If a merge conflict occurs, the Try-and-Revert engine offers to roll the whole operation back.
68
71
  - **State management:** Named, indexed stash. Run `state list` to see what you saved. No more `stash@{2}` archaeology.
@@ -130,21 +133,47 @@ pip install -e .
130
133
 
131
134
  ### 1. Set Up Your Identity
132
135
 
133
- Run this once on a new machine. GitGo generates an SSH key, adds it to `ssh-agent`, prints the public key, and opens your GitHub SSH settings page so you can add it for both authentication and commit signing.
136
+ Run this once on each machine you use. GitGo generates an SSH key, prints it for you to copy, and opens GitHub so you can add it. You add the same key twice: once as an **Authentication Key** (to push and pull), once as a **Signing Key** (so your commits show Verified). After that, GitGo tests the connection and sets up your Git identity automatically.
134
137
 
135
138
  ```bash
136
139
  gitgo user login
137
140
  ```
138
141
 
139
- ### 2. Link a New Project to GitHub
142
+ For a full walkthrough with screenshots, see the [Login Guide](docs/login-guide.md).
140
143
 
141
- Point GitGo at an existing empty GitHub repo. It initializes Git, stages everything, commits, and pushes — including pulling unrelated histories if the remote isn't empty.
144
+ ### 2. Start a New Project From Scratch
145
+
146
+ One command scaffolds the local project, creates the GitHub repo, and pushes it. No tab switching.
147
+
148
+ ```bash
149
+ gitgo new my-app python
150
+ gitgo new my-app rust --private
151
+ gitgo new my-app # no scaffold, just the repo and push
152
+ ```
153
+
154
+ Or use the individual steps if you want more control:
155
+
156
+ ```bash
157
+ # Step 1: scaffold the project locally
158
+ gitgo init my-app python
159
+
160
+ # Step 2: create the remote GitHub repo
161
+ cd my-app
162
+ gitgo repo my-app --private
163
+
164
+ # Step 3: connect and push
165
+ gitgo link https://github.com/username/my-app.git
166
+ ```
167
+
168
+ ### 3. Link an Existing Project to GitHub
169
+
170
+ Point GitGo at an existing empty GitHub repo. It initializes Git, stages everything, commits, and pushes, including pulling unrelated histories if the remote isn't empty.
142
171
 
143
172
  ```bash
144
173
  gitgo link https://github.com/username/repo.git "Initial commit"
145
174
  ```
146
175
 
147
- ### 3. Push Changes
176
+ ### 4. Push Changes
148
177
 
149
178
  ```bash
150
179
  # Push to an existing branch
@@ -154,7 +183,7 @@ gitgo push main "Fix auth bug"
154
183
  gitgo push -n feat/login "Add login flow"
155
184
  ```
156
185
 
157
- ### 4. Switch Branches
186
+ ### 5. Switch Branches
158
187
 
159
188
  Switch branches with uncommitted work in progress. `jump` stashes your changes, moves to the target branch, syncs with main, and pops the stash. If the pop triggers a conflict, it offers to abort and restore the repo to its prior state.
160
189
 
@@ -162,7 +191,7 @@ Switch branches with uncommitted work in progress. `jump` stashes your changes,
162
191
  gitgo jump feat/new-login
163
192
  ```
164
193
 
165
- ### 5. Undo Mistakes
194
+ ### 6. Undo Mistakes
166
195
 
167
196
  Undo recent mistakes with commands named for what they undo.
168
197
 
@@ -174,7 +203,7 @@ gitgo undo link # Remove remote and undo initial commit
174
203
  gitgo undo push # DANGER: Revert last push with a force-push
175
204
  ```
176
205
 
177
- ### 6. Save Your Work-in-Progress
206
+ ### 7. Save Your Work-in-Progress
178
207
 
179
208
  ```bash
180
209
  gitgo state save "halfway through refactor"
@@ -182,7 +211,7 @@ gitgo state list
182
211
  gitgo state load 1
183
212
  ```
184
213
 
185
- ### 7. Custom Defaults
214
+ ### 8. Custom Defaults
186
215
 
187
216
  ```bash
188
217
  gitgo config set default-branch develop
@@ -194,6 +223,55 @@ gitgo config get default-branch
194
223
 
195
224
  ## Command Reference
196
225
 
226
+ ### `gitgo new`
227
+
228
+ One-shot quickstart. Scaffolds a local project, creates the GitHub remote repo, and pushes, all in one command.
229
+
230
+ ```bash
231
+ gitgo new <name> [lang]
232
+ gitgo new my-app python # scaffold Python project and push
233
+ gitgo new my-app rust --private # private Rust project
234
+ gitgo new my-app # no scaffold, just create repo and push
235
+ ```
236
+
237
+ | Flag | Description |
238
+ |------|-------------|
239
+ | `lang` | Language to scaffold. Options: `python`, `node`, `rust`, `go`, `cs`, and more |
240
+ | `--template OWNER/REPO` | Use a GitHub template repo instead of a language scaffold |
241
+ | `-p`, `--private` | Create a private repository |
242
+ | `-d`, `--description TEXT` | Short description shown on GitHub |
243
+
244
+ ### `gitgo init`
245
+
246
+ Scaffolds a project folder locally. Creates a README, `.gitignore` (fetched from GitHub's official templates), and language-specific starter files.
247
+
248
+ ```bash
249
+ gitgo init my-app python # generates pyproject.toml and .python-version
250
+ gitgo init my-app node # generates package.json and index.js
251
+ gitgo init my-app cs # generates .csproj and Program.cs
252
+ gitgo init my-app --template owner/repo # slug format
253
+ gitgo init my-app --template https://github.com/owner/repo # full URL accepted too
254
+ ```
255
+
256
+ Supported languages: `python` (`py`), `node` (`js`, `ts`), `rust` (`rs`), `go` (`golang`), `csharp` (`cs`), and any language with a `.gitignore` template on GitHub.
257
+
258
+ ### `gitgo repo`
259
+
260
+ Creates a remote GitHub repository without touching your local files.
261
+
262
+ ```bash
263
+ gitgo repo [name] # use current directory name if no name given
264
+ gitgo repo my-app --private
265
+ gitgo repo my-app -d "My project description"
266
+ ```
267
+
268
+ | Flag | Description |
269
+ |------|-------------|
270
+ | `-p`, `--private` | Create a private repository |
271
+ | `-d`, `--description TEXT` | Short description shown on GitHub |
272
+
273
+ On first run, GitGo opens GitHub's PAT page and prompts you to paste a token with `repo` scope. The token is saved to git config for future calls. If the token expires, GitGo detects the 401 and re-prompts automatically.
274
+
197
275
  ### `gitgo push`
198
276
 
199
277
  Stage, commit, and push in one command.
@@ -331,4 +409,4 @@ Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the full
331
409
 
332
410
  Distributed under the **GPLv3** License. See [`LICENSE`](LICENSE) for details.
333
411
 
334
- ---
412
+ ---
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pygitgo"
7
- version = "1.7.1"
7
+ version = "1.8.1"
8
8
  description = "GitGo CLI - Your Fast Git Companion. Simplifies git push, link, stash, and user management."
9
9
  readme = "README.md"
10
10
  license = {text = "GPL-3.0-or-later"}
@@ -21,7 +21,6 @@ def get_user():
21
21
 
22
22
  return name, email
23
23
 
24
-
25
24
  def set_user(name, email):
26
25
  run_command(["git", "config", "--global", "user.name", name])
27
26
  run_command(["git", "config", "--global", "user.email", email])
@@ -66,4 +65,29 @@ def ensure_user_configure(default_email=None, default_username=None):
66
65
  error("Invalid configuration. Name and Email are required.")
67
66
  return False
68
67
 
68
+ def sanitize_signing_config():
69
+ try:
70
+ gpgsign = run_command(["git", "config", "--global", "commit.gpgsign"]).strip().lower()
71
+ except GitCommandError:
72
+ return
73
+
74
+ if gpgsign != "true":
75
+ return
76
+
77
+ try:
78
+ fmt = run_command(["git", "config", "--global", "gpg.format"]).strip().lower()
79
+ except GitCommandError:
80
+ fmt = ""
81
+
82
+ if fmt == "ssh":
83
+ return
84
+
85
+ warning("Detected 'commit.gpgsign=true' with no GPG key configured.")
86
+ warning("Disabling global GPG signing to prevent commit failures.")
87
+
88
+ try:
89
+ run_command(["git", "config", "--global", "--unset", "gpg.program"])
90
+ except GitCommandError:
91
+ pass
92
+
69
93
 
@@ -0,0 +1,134 @@
1
+ from pygitgo.utils.colors import info, success, warning, error
2
+ from pygitgo.utils.platform import get_platform
3
+ from pygitgo.utils.executor import run_command
4
+ from pygitgo.exceptions import GitCommandError
5
+ from pygitgo.utils.platform import open_url
6
+ from . import ssh_utils
7
+ import os
8
+
9
+
10
+ def _configure_ssh_signing(key_path):
11
+ try:
12
+ run_command(["git", "config", "--global", "gpg.format", "ssh"])
13
+ run_command(["git", "config", "--global", "user.signingkey", str(key_path)])
14
+ except Exception:
15
+ pass
16
+
17
+
18
+ def login():
19
+ from .account import sanitize_signing_config, ensure_user_configure
20
+
21
+ sanitize_signing_config()
22
+
23
+ key_path = ssh_utils.get_ssh_key_path()
24
+ already_logged_in = key_path.exists()
25
+ ok_text = "Already logged in via GitGo." if already_logged_in else "GitHub connection verified."
26
+
27
+ if ssh_utils.check_connection(ok_text=ok_text):
28
+ if already_logged_in:
29
+ _configure_ssh_signing(key_path)
30
+ ensure_user_configure(default_username=ssh_utils.get_github_username())
31
+ else:
32
+ warning("GitHub SSH connection is active, but NOT via a GitGo-managed key.")
33
+ warning("To use GitGo's full login (SSH + verified commits), you must log out first.")
34
+ info("Run: gitgo user logout")
35
+ info("Then run: gitgo user login")
36
+
37
+ return True
38
+
39
+ info("Initiating login sequence...")
40
+ while True:
41
+ email = input("Enter your email for GitHub: ").strip()
42
+ if "@" in email and "." in email:
43
+ break
44
+ else:
45
+ error("Please enter a valid email address.")
46
+
47
+ key_path = ssh_utils.generate_ssh_key(email=email)
48
+ pub_key_path = str(key_path) + ".pub"
49
+
50
+ with open(pub_key_path, "r") as f:
51
+ pub_key = f.read()
52
+
53
+ if not pub_key:
54
+ error("Failed to read the generated public key.")
55
+ return False
56
+
57
+ success("SSH Key generated successfully!")
58
+
59
+ print()
60
+ print(" Your SSH public key:")
61
+ print()
62
+ print(f" {pub_key.strip()}")
63
+ print()
64
+
65
+ info("Copy the key above, then add it TWICE on GitHub:")
66
+ info(" 1. Authentication Key — for pushing and pulling")
67
+ info(" 2. Signing Key — for Verified commits")
68
+ info("Same key text for both.")
69
+
70
+ input("\nOnce you've copied the key, press Enter to open GitHub...")
71
+
72
+ open_url("https://github.com/settings/ssh/new")
73
+
74
+ input(
75
+ "\nAfter adding both keys on GitHub,\n"
76
+ "come back here and press Enter to verify the connection..."
77
+ )
78
+
79
+ ssh_utils.ensure_ssh_agent(ssh_utils.get_ssh_key_path())
80
+
81
+ ssh_utils.clear_ssh_cache()
82
+
83
+ if ssh_utils.check_connection(ok_text="Login successful. You are connected.", fail_text="SSH key not recognised by GitHub."):
84
+ github_username = ssh_utils.get_github_username()
85
+ ensure_user_configure(default_email=email, default_username=github_username)
86
+ return True
87
+
88
+ error("Login Failed. The SSH key may not have been added to GitHub correctly.")
89
+ info("Possible causes:")
90
+ info(" 1. The key was not pasted on GitHub")
91
+
92
+ if get_platform() == "windows":
93
+ info(" 2. SSH agent is not running — run in PowerShell (as Administrator):")
94
+ info(" Set-Service ssh-agent -StartupType Automatic")
95
+ info(" Start-Service ssh-agent")
96
+ info(" Then run 'gitgo user login' again.")
97
+ else:
98
+ info(" 2. SSH agent is not running (try: eval $(ssh-agent) && ssh-add)")
99
+
100
+ info(" 3. Network or firewall is blocking SSH connections")
101
+ info("Need help? Full guide: https://github.com/Huerte/GitGo/blob/main/docs/login-guide.md")
102
+ return False
103
+
104
+
105
+ def logout():
106
+ key_path = ssh_utils.get_ssh_key_path()
107
+ if not key_path.exists():
108
+ warning("You are already logged out (no keys found).")
109
+ return False
110
+
111
+ try:
112
+
113
+ os.remove(key_path)
114
+
115
+ pub_key_path = str(key_path) + ".pub"
116
+ if os.path.exists(pub_key_path):
117
+ os.remove(pub_key_path)
118
+
119
+ try:
120
+ run_command(["git", "config", "--global", "--unset-all", "user.name"])
121
+ except GitCommandError:
122
+ pass
123
+
124
+ try:
125
+ run_command(["git", "config", "--global", "--unset-all", "user.email"])
126
+ except GitCommandError:
127
+ pass
128
+
129
+ success("User successfully logout")
130
+ return True
131
+
132
+ except Exception as e:
133
+ error(f"Failed to remove SSH keys\nCAUSE OF ERROR: {e}")
134
+ return False