giddy-cli 0.1.0__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.
- giddy_cli-0.1.0/LICENSE +21 -0
- giddy_cli-0.1.0/PKG-INFO +435 -0
- giddy_cli-0.1.0/README.md +422 -0
- giddy_cli-0.1.0/pyproject.toml +29 -0
- giddy_cli-0.1.0/setup.cfg +4 -0
- giddy_cli-0.1.0/src/giddy/__init__.py +4 -0
- giddy_cli-0.1.0/src/giddy/cli.py +169 -0
- giddy_cli-0.1.0/src/giddy/config.py +76 -0
- giddy_cli-0.1.0/src/giddy/git.py +177 -0
- giddy_cli-0.1.0/src/giddy/main.py +125 -0
- giddy_cli-0.1.0/src/giddy/ui.py +247 -0
- giddy_cli-0.1.0/src/giddy/utils.py +72 -0
- giddy_cli-0.1.0/src/giddy/workflows.py +336 -0
- giddy_cli-0.1.0/src/giddy_cli.egg-info/PKG-INFO +435 -0
- giddy_cli-0.1.0/src/giddy_cli.egg-info/SOURCES.txt +25 -0
- giddy_cli-0.1.0/src/giddy_cli.egg-info/dependency_links.txt +1 -0
- giddy_cli-0.1.0/src/giddy_cli.egg-info/entry_points.txt +2 -0
- giddy_cli-0.1.0/src/giddy_cli.egg-info/requires.txt +2 -0
- giddy_cli-0.1.0/src/giddy_cli.egg-info/top_level.txt +1 -0
- giddy_cli-0.1.0/tests/test_amend.py +104 -0
- giddy_cli-0.1.0/tests/test_clean_branch_name.py +46 -0
- giddy_cli-0.1.0/tests/test_config.py +39 -0
- giddy_cli-0.1.0/tests/test_get_remote_repo_info.py +47 -0
- giddy_cli-0.1.0/tests/test_git.py +29 -0
- giddy_cli-0.1.0/tests/test_switch_branch.py +74 -0
- giddy_cli-0.1.0/tests/test_undo.py +98 -0
- giddy_cli-0.1.0/tests/test_untrack.py +21 -0
giddy_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Antoine
|
|
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.
|
giddy_cli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: giddy-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Interactive Git assistant that helps you follow best practices and simplify your workflow.
|
|
5
|
+
Author: Antoine
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: InquirerPy>=0.3.4
|
|
11
|
+
Requires-Dist: rich>=13.0.0
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# Giddy
|
|
15
|
+
|
|
16
|
+
An interactive Git assistant that simplifies your workflow and helps you follow best practices.
|
|
17
|
+
|
|
18
|
+
[]([https://www.python.org/downloads/](https://www.python.org/downloads/))
|
|
19
|
+
[](https://opensource.org/licenses/MIT)
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
Giddy is a command-line tool that makes Git workflows smoother and more intuitive. Whether you're starting a new feature, committing changes, or syncing with your team, Giddy guides you through the process with interactive prompts and clear feedback.
|
|
24
|
+
|
|
25
|
+
### Why Giddy?
|
|
26
|
+
|
|
27
|
+
- **Enforce Best Practices**: Follow conventional commits automatically
|
|
28
|
+
- **Interactive Workflow**: Intuitive prompts guide you through each step
|
|
29
|
+
- **Smart Defaults**: Handles branch naming, stashing, and cleanup intelligently
|
|
30
|
+
- **Minimal Dependencies**: Lightweight and fast
|
|
31
|
+
- **Beautiful Output**: Rich, colorful terminal UI for better readability
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### Requirements
|
|
36
|
+
- Python 3.11 or higher
|
|
37
|
+
- Git 2.0 or higher
|
|
38
|
+
|
|
39
|
+
### To use giddy globally
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/AntoineMamou/giddy/
|
|
43
|
+
cd giddy
|
|
44
|
+
pipx install -e .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
### 1. Initialize configuration (Optional)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
giddy init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Generates a `.giddy.toml` file to customize your base branch and commit scopes.
|
|
56
|
+
|
|
57
|
+
### 2. Start a New Feature
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
giddy start
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Giddy will interactively ask for the branch type and name, then:
|
|
64
|
+
- Switch to the base branch (e.g., `main`)
|
|
65
|
+
- Pull the latest changes from remote
|
|
66
|
+
- Create a new formatted branch: `feat/add-user-authentication`
|
|
67
|
+
- Optionally carry or stash your current uncommitted changes
|
|
68
|
+
|
|
69
|
+
### 3. Check Status
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
giddy status
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
View:
|
|
76
|
+
- Current branch
|
|
77
|
+
- Modified files and their status
|
|
78
|
+
- Next steps
|
|
79
|
+
|
|
80
|
+
### 4. Commit Changes
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
giddy done
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Giddy will:
|
|
87
|
+
- Show your modified files and let you select which to stage
|
|
88
|
+
- Guide you through creating a conventional commit message
|
|
89
|
+
- Push changes to your remote repository
|
|
90
|
+
- Show you the Pull Request / Merge Request link if needed (GitHub & GitLab supported!)
|
|
91
|
+
|
|
92
|
+
### 5. Sync with Main
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
giddy sync
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Giddy will:
|
|
99
|
+
- Switch back to the base branch
|
|
100
|
+
- Pull latest changes from remote
|
|
101
|
+
- Clean up deleted remote branches
|
|
102
|
+
|
|
103
|
+
## Commands
|
|
104
|
+
|
|
105
|
+
### `giddy init`
|
|
106
|
+
|
|
107
|
+
Generate a default `.giddy.toml` configuration file in your current directory.
|
|
108
|
+
|
|
109
|
+
**Features:**
|
|
110
|
+
- Safely checks if a configuration already exists to prevent overwriting
|
|
111
|
+
- Generates a commented template
|
|
112
|
+
- Allows you to define your custom `base_branch` (e.g., `develop`, `master`)
|
|
113
|
+
- Allows you to define predefined `scopes` (transforms the text input into a dropdown menu during `giddy done`)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### `giddy start`
|
|
118
|
+
|
|
119
|
+
Start an interactive wizard to create and checkout a new branch.
|
|
120
|
+
|
|
121
|
+
**Features:**
|
|
122
|
+
- Interactive prompts for branch type (`feat`, `fix`, `docs`, etc.) and name
|
|
123
|
+
- Automatic branch naming: `type/clean-feature-name`
|
|
124
|
+
- Interactive stash handling if you have uncommitted changes
|
|
125
|
+
- Pulls latest code from remote before creating the branch
|
|
126
|
+
|
|
127
|
+
**Example:**
|
|
128
|
+
```bash
|
|
129
|
+
giddy start
|
|
130
|
+
# Prompts: What type of branch? -> feat
|
|
131
|
+
# Prompts: What is the name? -> implement dark mode
|
|
132
|
+
# Creates: feat/implement-dark-mode
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### `giddy switch`
|
|
138
|
+
|
|
139
|
+
Switch to a different branch interactively.
|
|
140
|
+
|
|
141
|
+
**Features:**
|
|
142
|
+
- Fuzzy search to quickly find the branch you need
|
|
143
|
+
- Branches are sorted by recent commit date
|
|
144
|
+
- Safety guard: handles uncommitted changes before switching
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### `giddy done`
|
|
149
|
+
|
|
150
|
+
Create a commit and push changes to remote.
|
|
151
|
+
|
|
152
|
+
**Features:**
|
|
153
|
+
- Interactive file selection (choose which files to stage)
|
|
154
|
+
- Conventional commits format with auto-formatting
|
|
155
|
+
- Automatic push to current branch
|
|
156
|
+
- Clear feedback on success or failure
|
|
157
|
+
|
|
158
|
+
**Commit Types:**
|
|
159
|
+
- `feat` ✨ - New feature
|
|
160
|
+
- `fix` 🐛 - Bug fix
|
|
161
|
+
- `refactor` 🔨 - Code improvement
|
|
162
|
+
- `docs` 📚 - Documentation
|
|
163
|
+
- `test` 🧪 - Add/Update tests
|
|
164
|
+
- `chore` 🧹 - Dependencies, configuration
|
|
165
|
+
|
|
166
|
+
**Example:**
|
|
167
|
+
```bash
|
|
168
|
+
giddy done
|
|
169
|
+
# Follow the interactive prompts:
|
|
170
|
+
# 1. Select files with Spacebar
|
|
171
|
+
# 2. Select commit type: feat
|
|
172
|
+
# 3. Add scope (optional): auth
|
|
173
|
+
# 4. Describe change: add password reset functionality
|
|
174
|
+
# 5. Commit and push!
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### `giddy amend`
|
|
180
|
+
|
|
181
|
+
Quickly fix your last commit by adding forgotten files.
|
|
182
|
+
|
|
183
|
+
**Features:**
|
|
184
|
+
- Perfect for the classic "oops, I forgot to save this file before committing"
|
|
185
|
+
- Interactively select forgotten files to stage
|
|
186
|
+
- Amends the last commit silently without changing its message
|
|
187
|
+
- Safe force-push (`--force-with-lease`)
|
|
188
|
+
- Safety guard: blocked on main/base branch to protect project history
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### `giddy undo`
|
|
193
|
+
|
|
194
|
+
Undo the last commit without losing your changes.
|
|
195
|
+
|
|
196
|
+
**Features:**
|
|
197
|
+
- Uses `git reset --soft HEAD~1` safely
|
|
198
|
+
- Your code is kept exactly as it is in your working directory
|
|
199
|
+
- Perfect for reverting a `giddy done` to change the commit message
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### `giddy untrack`
|
|
204
|
+
|
|
205
|
+
Stop tracking a file in Git without deleting it locally.
|
|
206
|
+
|
|
207
|
+
**Features:**
|
|
208
|
+
- Fuzzy search through all tracked files
|
|
209
|
+
- Safely removes the file from Git's index (`--cached`)
|
|
210
|
+
- Optionally appends the file automatically to your `.gitignore`
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### `giddy status`
|
|
215
|
+
|
|
216
|
+
Display repository status dashboard.
|
|
217
|
+
|
|
218
|
+
**Shows:**
|
|
219
|
+
- Current branch name
|
|
220
|
+
- List of modified files with status indicators:
|
|
221
|
+
- 🆕 Untracked (new files)
|
|
222
|
+
- 🛠️ Modified (changed files)
|
|
223
|
+
- ✅ Added (staged files)
|
|
224
|
+
- ❌ Deleted (removed files)
|
|
225
|
+
- Next action suggestion
|
|
226
|
+
|
|
227
|
+
**Example:**
|
|
228
|
+
```bash
|
|
229
|
+
giddy status
|
|
230
|
+
# Displays a rich panel with current state
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### `giddy sync`
|
|
236
|
+
|
|
237
|
+
Switch back to the base branch, pull updates, and clean up dead branches.
|
|
238
|
+
|
|
239
|
+
**Features:**
|
|
240
|
+
- Safe switch to base branch
|
|
241
|
+
- Pulls latest changes from remote
|
|
242
|
+
- Removes local branches that no longer exist on remote
|
|
243
|
+
- Ideal after merging pull requests
|
|
244
|
+
|
|
245
|
+
**Example:**
|
|
246
|
+
```bash
|
|
247
|
+
giddy sync
|
|
248
|
+
# Clean up after your PR is merged
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Conventional Commits Format
|
|
252
|
+
|
|
253
|
+
Giddy uses the [Conventional Commits](https://www.conventionalcommits.org/) specification:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
<type>(<scope>): <description>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Examples
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
feat(api): add user authentication endpoint
|
|
263
|
+
fix(ui): resolve button alignment issue
|
|
264
|
+
refactor(db): optimize query performance
|
|
265
|
+
docs: update installation instructions
|
|
266
|
+
chore(deps): upgrade Flask to 2.0.0
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Why Conventional Commits?
|
|
270
|
+
|
|
271
|
+
- Automatically generate changelogs
|
|
272
|
+
- Enable semantic versioning
|
|
273
|
+
- Provide clear project history
|
|
274
|
+
- Link commits to issues
|
|
275
|
+
- Enable automation workflows
|
|
276
|
+
|
|
277
|
+
## Workflow Example
|
|
278
|
+
|
|
279
|
+
### Complete Feature Development
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# 1. Start new feature
|
|
283
|
+
giddy start
|
|
284
|
+
# You're now on: feat/add-email-notifications
|
|
285
|
+
|
|
286
|
+
# 2. Make your changes
|
|
287
|
+
# ... edit files ...
|
|
288
|
+
|
|
289
|
+
# 3. Check what changed
|
|
290
|
+
giddy status
|
|
291
|
+
|
|
292
|
+
# 4. Commit and push
|
|
293
|
+
giddy done
|
|
294
|
+
# Select files → Choose type → Add description → Push!
|
|
295
|
+
|
|
296
|
+
# 5. Open a pull/merge request on GitHub/GitLab
|
|
297
|
+
|
|
298
|
+
# 6. After PR is merged, sync back to main
|
|
299
|
+
giddy sync
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Tips & Tricks
|
|
303
|
+
|
|
304
|
+
### 1. Branch Naming
|
|
305
|
+
Giddy automatically converts your branch type and feature name to a valid Git branch:
|
|
306
|
+
```bash
|
|
307
|
+
# User inputs "feat" and "Add User Login" -> feat/add-user-login
|
|
308
|
+
# User inputs "fix" and "bug_in API" -> fix/bug-in-api
|
|
309
|
+
# User inputs "docs" and "REFACTOR docs" -> docs/refactor-docs
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### 2. Stashing Changes
|
|
313
|
+
When starting or switching a branch with uncommitted changes:
|
|
314
|
+
- **Take them**: Moves modifications to the new branch
|
|
315
|
+
- **Leave them (Stash)**: Safely stores them, retrieve later with `git stash pop`
|
|
316
|
+
- **Cancel**: Stay on current branch
|
|
317
|
+
|
|
318
|
+
### 3. File Selection
|
|
319
|
+
When running `giddy done` or `giddy amend`, select specific files instead of staging everything:
|
|
320
|
+
- Choose files you want to commit
|
|
321
|
+
- Leave others for the next commit
|
|
322
|
+
- Keeps commits focused and organized
|
|
323
|
+
|
|
324
|
+
### 4. Multiple Commits
|
|
325
|
+
Make focused commits on related changes:
|
|
326
|
+
```bash
|
|
327
|
+
# Commit set 1
|
|
328
|
+
giddy done # Select files A, B
|
|
329
|
+
# Commit set 2
|
|
330
|
+
giddy done # Select files C, D
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Troubleshooting
|
|
334
|
+
|
|
335
|
+
### "main branch not found"
|
|
336
|
+
Make sure your repository has a `main` branch. If using `master`, initialize Giddy to set your custom base branch:
|
|
337
|
+
```bash
|
|
338
|
+
giddy init
|
|
339
|
+
# Then edit .giddy.toml and set base_branch = "master"
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Changes not staged after stash pop
|
|
343
|
+
Conflicts may occur when popping a stash. Check status:
|
|
344
|
+
```bash
|
|
345
|
+
giddy status
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Accidental commit on wrong branch?
|
|
349
|
+
Reset and try again using the built-in undo tool:
|
|
350
|
+
```bash
|
|
351
|
+
giddy undo
|
|
352
|
+
giddy switch
|
|
353
|
+
giddy done
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## Development
|
|
357
|
+
|
|
358
|
+
### Setup Development Environment
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# Clone repository
|
|
362
|
+
git clone https://github.com/AntoineMamou/giddy.git
|
|
363
|
+
cd giddy
|
|
364
|
+
|
|
365
|
+
# Create virtual environment
|
|
366
|
+
python -m venv .venv
|
|
367
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
368
|
+
|
|
369
|
+
# Install in development mode
|
|
370
|
+
pip install -e .
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Project Structure
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
giddy/
|
|
377
|
+
├── src/giddy/
|
|
378
|
+
│ ├── __init__.py # Package metadata
|
|
379
|
+
│ ├── main.py # CLI entry point & router
|
|
380
|
+
│ ├── workflows.py # Main command logic and workflows
|
|
381
|
+
│ ├── ui.py # InquirerPy prompts and Rich UI
|
|
382
|
+
│ ├── git.py # Pure Git command wrappers
|
|
383
|
+
│ └── utils.py # Helper functions and config loading
|
|
384
|
+
├── pyproject.toml # Project configuration
|
|
385
|
+
└── README.md # This file
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Code Style
|
|
389
|
+
|
|
390
|
+
This project uses:
|
|
391
|
+
- **Ruff** for linting
|
|
392
|
+
- **Type hints** for static typing
|
|
393
|
+
- **Google-style docstrings** for documentation
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# Check code style
|
|
397
|
+
ruff check src/
|
|
398
|
+
|
|
399
|
+
# Format code
|
|
400
|
+
ruff format src/
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
## Contributing
|
|
404
|
+
|
|
405
|
+
Contributions are welcome! Here's how to help:
|
|
406
|
+
|
|
407
|
+
1. **Fork** the repository
|
|
408
|
+
2. **Create** a feature branch: `giddy start`
|
|
409
|
+
3. **Make** your changes and add tests if possible
|
|
410
|
+
4. **Commit** using `giddy done`
|
|
411
|
+
5. **Push** to your fork
|
|
412
|
+
6. **Open** a pull request
|
|
413
|
+
|
|
414
|
+
### Development Guidelines
|
|
415
|
+
|
|
416
|
+
- Follow PEP 8 style guide
|
|
417
|
+
- Write clear, descriptive commit messages
|
|
418
|
+
- Add docstrings to functions
|
|
419
|
+
- Test your changes locally (`pytest tests/`)
|
|
420
|
+
|
|
421
|
+
## Roadmap
|
|
422
|
+
|
|
423
|
+
- [ ] Commit templates
|
|
424
|
+
- [x] Integration with GitHub/GitLab APIs
|
|
425
|
+
- [x] Undo/rollback functionality
|
|
426
|
+
- [x] Branch switching helpers
|
|
427
|
+
- [ ] Automated changelog generation
|
|
428
|
+
|
|
429
|
+
## License
|
|
430
|
+
|
|
431
|
+
This project is licensed under the MIT License - see [LICENSE](LICENSE) file for details.
|
|
432
|
+
|
|
433
|
+
## Author
|
|
434
|
+
|
|
435
|
+
Created by **Antoine** ([GitHub](https://github.com/AntoineMamou))
|