dz-devkit-cli 0.1.0__py3-none-any.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.
devkit/__init__.py ADDED
@@ -0,0 +1,8 @@
1
+ # Copyright (c) 2026 Oussama Boudinar <lionweb01@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+ """DevKit — a modern CLI toolkit for developers."""
4
+
5
+ __version__ = "0.1.0"
6
+ __author__ = "Oussama Boudinar"
7
+ __email__ = "lionweb01@gmail.com"
8
+ __license__ = "MIT"
devkit/cli.py ADDED
@@ -0,0 +1,23 @@
1
+ # Copyright (c) 2026 Oussama Boudinar <lionweb01@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+ """Entry point for the DevKit CLI."""
4
+
5
+ import click
6
+
7
+ from devkit.commands import git_stats, organize, scaffold
8
+
9
+
10
+ @click.group()
11
+ @click.version_option(package_name="devkit-cli")
12
+ def main() -> None:
13
+ """DevKit — a modern CLI toolkit for developers."""
14
+ pass
15
+
16
+
17
+ main.add_command(organize.organize)
18
+ main.add_command(scaffold.scaffold)
19
+ main.add_command(git_stats.git_stats)
20
+
21
+
22
+ if __name__ == "__main__":
23
+ main()
@@ -0,0 +1,3 @@
1
+ # Copyright (c) 2026 Oussama Boudinar <lionweb01@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+ """DevKit subcommands."""
@@ -0,0 +1,50 @@
1
+ # Copyright (c) 2026 Oussama Boudinar <lionweb01@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+ """Show quick statistics for a git repository."""
4
+
5
+ import subprocess
6
+ from pathlib import Path
7
+
8
+ import click
9
+ from rich.console import Console
10
+ from rich.table import Table
11
+
12
+ console = Console()
13
+
14
+
15
+ def _git(path: Path, *args: str) -> str:
16
+ return subprocess.check_output(
17
+ ["git", "-C", str(path), *args], text=True
18
+ ).strip()
19
+
20
+
21
+ @click.command()
22
+ @click.argument(
23
+ "path",
24
+ type=click.Path(exists=True, file_okay=False, path_type=Path),
25
+ default=".",
26
+ )
27
+ def git_stats(path: Path) -> None:
28
+ """Show git statistics for the repository in PATH."""
29
+ if not (path / ".git").exists():
30
+ console.print(f"[red]✗[/] No git repository found in {path}")
31
+ raise SystemExit(1)
32
+
33
+ try:
34
+ branch = _git(path, "rev-parse", "--abbrev-ref", "HEAD")
35
+ commits = _git(path, "rev-list", "--count", "HEAD")
36
+ last_commit = _git(path, "log", "-1", "--pretty=%s")
37
+ author = _git(path, "log", "-1", "--pretty=%an")
38
+ except subprocess.CalledProcessError:
39
+ console.print("[red]✗[/] Failed to read git history.")
40
+ raise SystemExit(1)
41
+
42
+ table = Table(title=f"Git Stats — {path.resolve().name}")
43
+ table.add_column("Metric", style="cyan", no_wrap=True)
44
+ table.add_column("Value", style="green")
45
+ table.add_row("Branch", branch)
46
+ table.add_row("Total commits", commits)
47
+ table.add_row("Last commit", last_commit)
48
+ table.add_row("Last author", author)
49
+
50
+ console.print(table)
@@ -0,0 +1,52 @@
1
+ # Copyright (c) 2026 Oussama Boudinar <lionweb01@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+ """Organize files in a directory into category folders."""
4
+
5
+ import shutil
6
+ from pathlib import Path
7
+
8
+ import click
9
+ from rich.console import Console
10
+
11
+ console = Console()
12
+
13
+ CATEGORIES: dict[str, list[str]] = {
14
+ "Images": [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp", ".bmp"],
15
+ "Documents": [".pdf", ".doc", ".docx", ".txt", ".md", ".odt", ".xlsx", ".pptx"],
16
+ "Videos": [".mp4", ".mkv", ".avi", ".mov", ".webm"],
17
+ "Audio": [".mp3", ".wav", ".flac", ".ogg", ".m4a"],
18
+ "Archives": [".zip", ".rar", ".7z", ".tar", ".gz"],
19
+ "Code": [".py", ".js", ".ts", ".html", ".css", ".json", ".yml", ".yaml", ".sh"],
20
+ }
21
+
22
+
23
+ @click.command()
24
+ @click.argument("path", type=click.Path(exists=True, file_okay=False, path_type=Path))
25
+ @click.option("--dry-run", is_flag=True, help="Preview changes without moving files.")
26
+ def organize(path: Path, dry_run: bool) -> None:
27
+ """Organize files in PATH into category folders."""
28
+ console.print(f"[bold cyan]Organizing:[/] {path}")
29
+ if dry_run:
30
+ console.print("[yellow]Dry-run mode — no files will be moved.[/]")
31
+
32
+ moved = 0
33
+ for file in sorted(path.iterdir()):
34
+ if not file.is_file():
35
+ continue
36
+
37
+ category = next(
38
+ (cat for cat, exts in CATEGORIES.items() if file.suffix.lower() in exts),
39
+ "Other",
40
+ )
41
+ target_dir = path / category
42
+
43
+ if dry_run:
44
+ console.print(f" [dim]→[/] {file.name} → {category}/")
45
+ else:
46
+ target_dir.mkdir(exist_ok=True)
47
+ shutil.move(str(file), str(target_dir / file.name))
48
+
49
+ moved += 1
50
+
51
+ verb = "Would move" if dry_run else "Moved"
52
+ console.print(f"[green]✓[/] {verb} {moved} file(s).")
@@ -0,0 +1,64 @@
1
+ # Copyright (c) 2026 Oussama Boudinar <lionweb01@gmail.com>
2
+ # SPDX-License-Identifier: MIT
3
+ """Scaffold new projects from built-in templates."""
4
+
5
+ from pathlib import Path
6
+
7
+ import click
8
+ from rich.console import Console
9
+
10
+ console = Console()
11
+
12
+ TEMPLATES: dict[str, dict[str, str]] = {
13
+ "web": {
14
+ "index.html": (
15
+ "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n"
16
+ " <meta charset=\"UTF-8\" />\n"
17
+ " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n"
18
+ " <title>New Project</title>\n"
19
+ " <link rel=\"stylesheet\" href=\"style.css\" />\n"
20
+ "</head>\n<body>\n <h1>Hello, world!</h1>\n"
21
+ " <script src=\"script.js\"></script>\n</body>\n</html>\n"
22
+ ),
23
+ "style.css": "body {\n font-family: system-ui, sans-serif;\n margin: 2rem;\n}\n",
24
+ "script.js": "console.log('Ready.');\n",
25
+ },
26
+ "python-cli": {
27
+ "main.py": (
28
+ "import click\n\n\n"
29
+ "@click.command()\n"
30
+ "def main() -> None:\n"
31
+ ' """My CLI tool."""\n'
32
+ " click.echo('Hello!')\n\n\n"
33
+ 'if __name__ == "__main__":\n'
34
+ " main()\n"
35
+ ),
36
+ "requirements.txt": "click>=8.1.0\n",
37
+ },
38
+ }
39
+
40
+
41
+ @click.command()
42
+ @click.argument("name")
43
+ @click.option(
44
+ "--type",
45
+ "template",
46
+ type=click.Choice(TEMPLATES.keys()),
47
+ default="web",
48
+ show_default=True,
49
+ )
50
+ def scaffold(name: str, template: str) -> None:
51
+ """Create a new project NAME from a template."""
52
+ target = Path(name)
53
+ if target.exists():
54
+ console.print(f"[red]✗[/] Directory '{name}' already exists.")
55
+ raise SystemExit(1)
56
+
57
+ files = TEMPLATES[template]
58
+ for filename, content in files.items():
59
+ file_path = target / filename
60
+ file_path.parent.mkdir(parents=True, exist_ok=True)
61
+ file_path.write_text(content)
62
+
63
+ console.print(f"[green]✓[/] Created '{name}' ({template}) — {len(files)} file(s).")
64
+ console.print(f"[dim] cd {name}[/]")
@@ -0,0 +1,342 @@
1
+ Metadata-Version: 2.4
2
+ Name: dz-devkit-cli
3
+ Version: 0.1.0
4
+ Summary: A modern CLI toolkit for developers: organize files, scaffold projects, inspect git repos.
5
+ Author-email: Oussama Boudinar <lionweb01@gmail.com>
6
+ Maintainer-email: Oussama Boudinar <lionweb01@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/dzopensource-lab/devkit-cli
9
+ Project-URL: Repository, https://github.com/dzopensource-lab/devkit-cli
10
+ Project-URL: Issues, https://github.com/dzopensource-lab/devkit-cli/issues
11
+ Keywords: cli,developer-tools,productivity,python
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.9
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: click>=8.1.0
18
+ Requires-Dist: rich>=13.0.0
19
+ Dynamic: license-file
20
+
21
+ markdown
22
+
23
+ # 🛠️ DevKit CLI
24
+
25
+ **A modern CLI toolkit for developers — organize files, scaffold projects, and inspect git repositories. All in one command.**
26
+
27
+ [![Tests](https://github.com/dzopensource-lab/devkit-cli/actions/workflows/test.yml/badge.svg)](https://github.com/dzopensource-lab/devkit-cli/actions/workflows/test.yml)
28
+ [![Python](https://img.shields.io/badge/Python-3.9%2B-3776AB?style=flat&logo=python&logoColor=white)](https://www.python.org/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
30
+
31
+ > Stop wasting time on repetitive tasks. `devkit` handles the boring stuff so you can focus on writing code.
32
+
33
+ ---
34
+
35
+ ## 🎬 Quick Start (60 seconds)
36
+
37
+ ```bash
38
+ # 1. Clone and install
39
+ git clone https://github.com/dzopensource-lab/devkit-cli.git
40
+ cd devkit-cli
41
+ pip install -e .
42
+
43
+ # 2. Try it immediately
44
+ devkit organize ~/Downloads --dry-run
45
+ devkit scaffold my-new-project --type web
46
+ devkit git-stats
47
+
48
+ That's it. You're ready to go. 🚀
49
+ 📖 What is DevKit?
50
+
51
+ devkit is a command-line toolkit that solves three daily problems every developer faces:
52
+ Problem Solution Command
53
+ 🗂️ "My Downloads folder is a mess" Auto-sort files into categories devkit organize
54
+ 🧱 "I waste 10 minutes setting up every new project" Generate project structure instantly devkit scaffold
55
+ 📊 "I forget my repo's commit count and current branch" See git stats in one command devkit git-stats
56
+ ✨ Features
57
+
58
+ 📂 Smart file organizer — Sorts files into Images/, Documents/, Code/, Audio/, Videos/, Archives/ automatically
59
+
60
+ 🧱 Project scaffolder — Creates ready-to-use templates for web and python-cli projects
61
+
62
+ 📊 Git inspector — Quick overview: branch, commit count, last author, last commit message
63
+
64
+ 🎨 Beautiful terminal output — Colors, tables, and clear feedback powered by rich
65
+
66
+ 🛡️ Safe by default — --dry-run mode lets you preview changes before executing
67
+
68
+ 🧪 Tested — Fully covered by pytest and GitHub Actions CI
69
+
70
+ ⚡ Fast — No dependencies beyond click and rich
71
+
72
+ 🚀 Installation
73
+ Option 1: Install from source (recommended for now)
74
+ bash
75
+
76
+ git clone https://github.com/dzopensource-lab/devkit-cli.git
77
+ cd devkit-cli
78
+ pip install -e .
79
+
80
+ Option 2: Install from PyPI (coming soon)
81
+ bash
82
+
83
+ pip install devkit-cli
84
+
85
+ Verify installation
86
+ bash
87
+
88
+ devkit --version
89
+ # devkit-cli, version 0.1.0
90
+
91
+ devkit --help
92
+ # Usage: devkit [OPTIONS] COMMAND [ARGS]...
93
+
94
+ 📚 Commands Reference
95
+ 📂 devkit organize — Sort files into folders
96
+
97
+ Syntax:
98
+ bash
99
+
100
+ devkit organize <PATH> [--dry-run]
101
+
102
+ What it does:
103
+ Scans the folder <PATH> and moves files into categorized subfolders based on their extension.
104
+
105
+ Categories:
106
+ Folder Extensions
107
+ Images/ .jpg, .jpeg, .png, .gif, .svg, .webp, .bmp
108
+ Documents/ .pdf, .doc, .docx, .txt, .md, .odt, .xlsx, .pptx
109
+ Videos/ .mp4, .mkv, .avi, .mov, .webm
110
+ Audio/ .mp3, .wav, .flac, .ogg, .m4a
111
+ Archives/ .zip, .rar, .7z, .tar, .gz
112
+ Code/ .py, .js, .ts, .html, .css, .json, .yml, .yaml, .sh
113
+ Other/ Everything else
114
+
115
+ Example:
116
+
117
+ Before:
118
+ text
119
+
120
+ Downloads/
121
+ ├── photo.jpg
122
+ ├── report.pdf
123
+ ├── song.mp3
124
+ ├── project.zip
125
+ └── script.py
126
+
127
+ Run:
128
+ bash
129
+
130
+ devkit organize ~/Downloads
131
+
132
+ After:
133
+ text
134
+
135
+ Downloads/
136
+ ├── Images/
137
+ │ └── photo.jpg
138
+ ├── Documents/
139
+ │ └── report.pdf
140
+ ├── Audio/
141
+ │ └── song.mp3
142
+ ├── Archives/
143
+ │ └── project.zip
144
+ └── Code/
145
+ └── script.py
146
+
147
+ Safe preview:
148
+ bash
149
+
150
+ devkit organize ~/Downloads --dry-run
151
+
152
+ Shows what would happen without moving anything. Always use this first!
153
+ 🧱 devkit scaffold — Create a new project
154
+
155
+ Syntax:
156
+ bash
157
+
158
+ devkit scaffold <NAME> [--type web|python-cli]
159
+
160
+ What it does:
161
+ Creates a new folder <NAME> with a ready-to-use starter template.
162
+
163
+ Available templates:
164
+ Template 1: web (default)
165
+
166
+ Creates:
167
+
168
+ index.html — Starter HTML5 page
169
+
170
+ style.css — Basic styles
171
+
172
+ script.js — Starter JS file
173
+
174
+ bash
175
+
176
+ devkit scaffold my-website
177
+
178
+ Output:
179
+ text
180
+
181
+ my-website/
182
+ ├── index.html
183
+ ├── style.css
184
+ └── script.js
185
+
186
+ Template 2: python-cli
187
+
188
+ Creates:
189
+
190
+ main.py — CLI starter using click
191
+
192
+ requirements.txt — Dependencies
193
+
194
+ bash
195
+
196
+ devkit scaffold my-tool --type python-cli
197
+
198
+ Output:
199
+ text
200
+
201
+ my-tool/
202
+ ├── main.py
203
+ └── requirements.txt
204
+
205
+ 📊 devkit git-stats — Inspect a git repository
206
+
207
+ Syntax:
208
+ bash
209
+
210
+ devkit git-stats [PATH]
211
+
212
+ What it does:
213
+ Displays key statistics about a git repository in a formatted table.
214
+
215
+ Example:
216
+ bash
217
+
218
+ devkit git-stats
219
+
220
+ Output:
221
+ text
222
+
223
+ Git Stats — devkit-cli
224
+ ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
225
+ ┃ Metric ┃ Value ┃
226
+ ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
227
+ │ Branch │ main │
228
+ │ Total commits │ 5 │
229
+ │ Last commit │ feat: add clean command │
230
+ │ Last author │ Oussama Boudinar │
231
+ └───────────────┴──────────────────────────────┘
232
+
233
+ On another repo:
234
+ bash
235
+
236
+ devkit git-stats /path/to/any/repo
237
+
238
+ 💡 Use Cases
239
+ Use Case 1: Monthly Downloads cleanup
240
+ bash
241
+
242
+ devkit organize ~/Downloads
243
+
244
+ Use Case 2: Start a new web project instantly
245
+ bash
246
+
247
+ devkit scaffold my-landing-page
248
+ cd my-landing-page
249
+ # Open in browser, start coding!
250
+
251
+ Use Case 3: Quick repo status before a standup meeting
252
+ bash
253
+
254
+ devkit git-stats
255
+
256
+ 🗂️ Project Structure
257
+ text
258
+
259
+ devkit-cli/
260
+ ├── devkit/
261
+ │ ├── __init__.py # Package metadata
262
+ │ ├── cli.py # Main entry point (Click group)
263
+ │ └── commands/
264
+ │ ├── organize.py # File organizer command
265
+ │ ├── scaffold.py # Project scaffolder command
266
+ │ └── git_stats.py # Git stats command
267
+ ├── tests/
268
+ │ └── test_cli.py # Basic tests
269
+ ├── .github/
270
+ │ └── workflows/
271
+ │ └── test.yml # CI pipeline
272
+ ├── docs/
273
+ │ ├── quickstart.md # 60-second guide
274
+ │ ├── commands.md # Full command reference
275
+ │ └── examples.md # Real-world examples
276
+ ├── pyproject.toml # Package config
277
+ ├── README.md # This file
278
+ ├── CONTRIBUTING.md # How to contribute
279
+ ├── CHANGELOG.md # Version history
280
+ └── LICENSE # MIT License
281
+
282
+ 🛡️ Safety Notes
283
+ ⚠️ Warning Reason
284
+ Always run --dry-run first on organize To preview before moving files
285
+ Don't organize system folders (C:\Windows, Program Files) May require permissions and break the system
286
+ Backup important folders before organizing Though safe, always be careful
287
+ 🤝 Contributing
288
+
289
+ See CONTRIBUTING.md for guidelines.
290
+
291
+ Quick version:
292
+
293
+ Fork the repo
294
+
295
+ Create a branch: git checkout -b feature/my-feature
296
+
297
+ Make changes + add tests
298
+
299
+ Push and open a Pull Request
300
+
301
+ 🧪 Testing
302
+ bash
303
+
304
+ pytest
305
+ pytest -v
306
+
307
+ 🗺️ Roadmap
308
+
309
+ ☑
310
+
311
+ organize — Sort files into categories
312
+ ☑
313
+
314
+ scaffold — Create project templates
315
+ ☑
316
+
317
+ git-stats — Show repository statistics
318
+ ☑
319
+
320
+ GitHub Actions CI
321
+ ☑
322
+
323
+ clean command — Remove node_modules, __pycache__, .venv
324
+ ☑
325
+
326
+ organize --recursive — Support subfolders
327
+ ☑
328
+
329
+ Custom categories from devkit.toml
330
+ ☑
331
+
332
+ More scaffold templates (react, fastapi, vue)
333
+ ☑
334
+
335
+ Publish to PyPI
336
+
337
+ 📄 License
338
+
339
+ MIT © 2026 Oussama Boudinar lionweb01@gmail.com — dzopensource-lab
340
+ ⭐ Show your support
341
+
342
+ If devkit helped you, please give it a ⭐ on GitHub — it means a lot!
@@ -0,0 +1,12 @@
1
+ devkit/__init__.py,sha256=Z3I1hx3ykVY3PSjE3KhcQwMPBBcvCPX6SJveY89atCQ,260
2
+ devkit/cli.py,sha256=iIr8TVjnLr0Zbo5bUx7c_lvU_bfj0mUt9C4Dl0_eNDI,528
3
+ devkit/commands/__init__.py,sha256=Ya6dNnnWAWnD8CXIResD2gMHLFvnAUVBTQC2J93iMS8,118
4
+ devkit/commands/git_stats.py,sha256=sZRfXhZCLiKGjO7Ax2Ohmw66ZkSbScHHC0ljucinnHY,1588
5
+ devkit/commands/organize.py,sha256=rEu-ashLAlIKV9EjBFmcbuznNnEIZlQAK8nYxFkCH7o,1840
6
+ devkit/commands/scaffold.py,sha256=sJnlK6iuixqdCYMcR6Tpqd1_ZgbUSiqzURxqS_Tu0aA,2112
7
+ dz_devkit_cli-0.1.0.dist-info/licenses/LICENSE,sha256=iobIM_H-i8CbCtcWlsvlKWvf78zL2eNmU8PR0gV5hL8,1112
8
+ dz_devkit_cli-0.1.0.dist-info/METADATA,sha256=YwGu2EUrqisXpMHqL94FsG-msFiYILbcmfXKOG-jPqw,8946
9
+ dz_devkit_cli-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
10
+ dz_devkit_cli-0.1.0.dist-info/entry_points.txt,sha256=cp9XH93n8MQocJk2pIMbetXCda8C5_ZaDI375co9FyU,43
11
+ dz_devkit_cli-0.1.0.dist-info/top_level.txt,sha256=5-7qWb-lawQBFJmCyx9FZJkWasklwAPxD0_0PaRkBlY,7
12
+ dz_devkit_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ devkit = devkit.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Oussama Boudinar lionweb01@gmail.com
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 @@
1
+ devkit