devit-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.
- devit_cli-0.1.0/LICENSE +21 -0
- devit_cli-0.1.0/PKG-INFO +273 -0
- devit_cli-0.1.0/README.md +241 -0
- devit_cli-0.1.0/_devkit_entry.py +59 -0
- devit_cli-0.1.0/devit_cli.egg-info/PKG-INFO +273 -0
- devit_cli-0.1.0/devit_cli.egg-info/SOURCES.txt +55 -0
- devit_cli-0.1.0/devit_cli.egg-info/dependency_links.txt +1 -0
- devit_cli-0.1.0/devit_cli.egg-info/entry_points.txt +2 -0
- devit_cli-0.1.0/devit_cli.egg-info/requires.txt +10 -0
- devit_cli-0.1.0/devit_cli.egg-info/top_level.txt +2 -0
- devit_cli-0.1.0/devkit_cli/__init__.py +4 -0
- devit_cli-0.1.0/devkit_cli/commands/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/commands/archive.py +166 -0
- devit_cli-0.1.0/devkit_cli/commands/clean.py +130 -0
- devit_cli-0.1.0/devkit_cli/commands/env.py +156 -0
- devit_cli-0.1.0/devkit_cli/commands/find.py +122 -0
- devit_cli-0.1.0/devkit_cli/commands/info.py +119 -0
- devit_cli-0.1.0/devkit_cli/commands/init.py +451 -0
- devit_cli-0.1.0/devkit_cli/commands/run.py +236 -0
- devit_cli-0.1.0/devkit_cli/main.py +89 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/.gitignore +43 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/README.md +23 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/requirements.txt +2 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/scripts/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/scripts/ec2.py +9 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/scripts/main.py +25 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/scripts/s3.py +10 -0
- devit_cli-0.1.0/devkit_cli/templates/aws/tests/test_scripts.py +6 -0
- devit_cli-0.1.0/devkit_cli/templates/django/.gitignore +43 -0
- devit_cli-0.1.0/devkit_cli/templates/django/README.md +15 -0
- devit_cli-0.1.0/devkit_cli/templates/django/apps/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/templates/django/apps/core/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/templates/django/apps/core/apps.py +6 -0
- devit_cli-0.1.0/devkit_cli/templates/django/apps/core/urls.py +6 -0
- devit_cli-0.1.0/devkit_cli/templates/django/apps/core/views.py +7 -0
- devit_cli-0.1.0/devkit_cli/templates/django/manage.py +20 -0
- devit_cli-0.1.0/devkit_cli/templates/django/requirements.txt +1 -0
- devit_cli-0.1.0/devkit_cli/templates/django/{{module_name}}/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/templates/django/{{module_name}}/settings.py +61 -0
- devit_cli-0.1.0/devkit_cli/templates/django/{{module_name}}/urls.py +9 -0
- devit_cli-0.1.0/devkit_cli/templates/django/{{module_name}}/wsgi.py +7 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/.gitignore +43 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/README.md +21 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/app/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/app/routers/__init__.py +0 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/app/routers/health.py +10 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/main.py +13 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/requirements.txt +6 -0
- devit_cli-0.1.0/devkit_cli/templates/fastapi/tests/test_api.py +17 -0
- devit_cli-0.1.0/devkit_cli/templates/package/.gitignore +43 -0
- devit_cli-0.1.0/devkit_cli/templates/package/README.md +15 -0
- devit_cli-0.1.0/devkit_cli/templates/package/pyproject.toml +29 -0
- devit_cli-0.1.0/devkit_cli/templates/package/tests/test_core.py +8 -0
- devit_cli-0.1.0/devkit_cli/templates/package/{{module_name}}/__init__.py +3 -0
- devit_cli-0.1.0/devkit_cli/templates/package/{{module_name}}/core.py +5 -0
- devit_cli-0.1.0/pyproject.toml +63 -0
- devit_cli-0.1.0/setup.cfg +4 -0
devit_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dipenpadhiyar
|
|
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.
|
devit_cli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devit-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A full-featured CLI framework for professional Python developers
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/dipenpadhiyar/devit-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/dipenpadhiyar/devit-cli/issues
|
|
8
|
+
Keywords: cli,developer-tools,scaffold,devkit
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
18
|
+
Classifier: Topic :: Utilities
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: click>=8.1
|
|
23
|
+
Requires-Dist: rich>=13.0
|
|
24
|
+
Requires-Dist: psutil>=5.9
|
|
25
|
+
Requires-Dist: questionary>=2.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-click>=1.1; extra == "dev"
|
|
29
|
+
Requires-Dist: black>=24.0; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img src="https://raw.githubusercontent.com/dipenpadhiyar/devit-cli/main/assets/devkit.png" alt="devit-cli" width="300"/>
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<b>A full-featured CLI toolkit for professional Python developers.</b><br/>
|
|
39
|
+
Scaffold projects · Clean builds · Inspect system · Search files · Manage archives & env vars
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/v/devit-cli.svg" alt="PyPI version"/></a>
|
|
44
|
+
<a href="https://pypistats.org/packages/devit-cli"><img src="https://img.shields.io/pypi/dm/devit-cli.svg?label=PyPI%20downloads" alt="Monthly downloads"/></a>
|
|
45
|
+
<a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/pyversions/devit-cli.svg" alt="Python versions"/></a>
|
|
46
|
+
<a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/l/devit-cli.svg" alt="License"/></a>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<a href="https://pepy.tech/project/devit-cli"><img src="https://static.pepy.tech/badge/devit-cli" alt="Total downloads"/></a>
|
|
51
|
+
<a href="https://pepy.tech/project/devit-cli"><img src="https://static.pepy.tech/badge/devit-cli/month" alt="Monthly"/></a>
|
|
52
|
+
<a href="https://pepy.tech/project/devit-cli"><img src="https://static.pepy.tech/badge/devit-cli/week" alt="Weekly"/></a>
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install devit-cli
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Requires **Python 3.10+**. Works on **Windows · Linux · macOS**.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
devkit # show help + logo
|
|
71
|
+
devkit init # interactive project wizard
|
|
72
|
+
devkit info # system snapshot
|
|
73
|
+
devkit clean # remove caches & build artifacts
|
|
74
|
+
devkit dev # start dev server / install in dev mode
|
|
75
|
+
devkit test # run tests (auto-detects pytest / django)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Commands
|
|
81
|
+
|
|
82
|
+
### `devkit init` — Project wizard
|
|
83
|
+
|
|
84
|
+
Interactively scaffold a new project. Asks for:
|
|
85
|
+
|
|
86
|
+
| Question | Options |
|
|
87
|
+
|---|---|
|
|
88
|
+
| Project type | Python Package · FastAPI · Django · AWS Scripts |
|
|
89
|
+
| Environment | New venv · Existing Python interpreter · New conda · Existing conda env · Skip |
|
|
90
|
+
| Python version | e.g. `3.11` |
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
devkit init # fully interactive
|
|
94
|
+
devkit init my-api --type fastapi --env venv
|
|
95
|
+
devkit init my-lib --type package --env conda --python 3.12
|
|
96
|
+
devkit init my-app -y # skip confirmation prompt
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Generated structures
|
|
100
|
+
|
|
101
|
+
**Python Package**
|
|
102
|
+
```
|
|
103
|
+
my-lib/
|
|
104
|
+
├── my_lib/
|
|
105
|
+
│ ├── __init__.py
|
|
106
|
+
│ └── core.py
|
|
107
|
+
├── tests/
|
|
108
|
+
│ └── test_core.py
|
|
109
|
+
├── docs/
|
|
110
|
+
├── pyproject.toml
|
|
111
|
+
├── README.md
|
|
112
|
+
└── .gitignore
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**FastAPI**
|
|
116
|
+
```
|
|
117
|
+
my-api/
|
|
118
|
+
├── main.py
|
|
119
|
+
├── app/
|
|
120
|
+
│ └── routers/
|
|
121
|
+
│ └── health.py
|
|
122
|
+
├── tests/
|
|
123
|
+
│ └── test_api.py
|
|
124
|
+
├── requirements.txt
|
|
125
|
+
├── README.md
|
|
126
|
+
└── .gitignore
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Django**
|
|
130
|
+
```
|
|
131
|
+
my-site/
|
|
132
|
+
├── manage.py
|
|
133
|
+
├── my_site/
|
|
134
|
+
│ ├── settings.py
|
|
135
|
+
│ ├── urls.py
|
|
136
|
+
│ └── wsgi.py
|
|
137
|
+
├── apps/
|
|
138
|
+
│ └── core/
|
|
139
|
+
│ ├── views.py
|
|
140
|
+
│ └── urls.py
|
|
141
|
+
├── requirements.txt
|
|
142
|
+
└── .gitignore
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**AWS Scripts**
|
|
146
|
+
```
|
|
147
|
+
my-aws/
|
|
148
|
+
├── scripts/
|
|
149
|
+
│ ├── main.py
|
|
150
|
+
│ ├── s3.py
|
|
151
|
+
│ └── ec2.py
|
|
152
|
+
├── tests/
|
|
153
|
+
├── requirements.txt
|
|
154
|
+
└── .gitignore
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### `devkit dev / run / build / test` — Unified task runner
|
|
160
|
+
|
|
161
|
+
Auto-detects project type and runs the right command:
|
|
162
|
+
|
|
163
|
+
| Command | Package | FastAPI | Django | AWS |
|
|
164
|
+
|---|---|---|---|---|
|
|
165
|
+
| `devkit dev` | `pip install -e .[dev]` | `uvicorn main:app --reload` | `manage.py runserver` | `sam local start-api` |
|
|
166
|
+
| `devkit run` | `python -m <module>` | `uvicorn main:app` | `manage.py runserver 0.0.0.0` | `python -m scripts.main` |
|
|
167
|
+
| `devkit build` | `python -m build` | `pip install -r requirements.txt` | `pip install -r requirements.txt` | `sam build` |
|
|
168
|
+
| `devkit test` | `pytest -v` | `pytest -v` | `manage.py test` | `pytest -v` |
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
devkit dev
|
|
172
|
+
devkit test
|
|
173
|
+
devkit build
|
|
174
|
+
devkit run -- --port 9000 # extra args forwarded
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### `devkit clean` — Remove artifacts
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
devkit clean # clean cwd
|
|
183
|
+
devkit clean ./my-project # clean specific dir
|
|
184
|
+
devkit clean --dry-run # preview only
|
|
185
|
+
devkit clean --include-venv # also remove .venv
|
|
186
|
+
devkit clean -y # skip confirmation
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Removes: `__pycache__`, `*.pyc`, `.pytest_cache`, `build/`, `dist/`, `*.egg-info`, `.DS_Store`, `*.log`, `node_modules`, `.coverage`, and more.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### `devkit info` — System snapshot
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
devkit info
|
|
197
|
+
devkit info --json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Shows: OS, hostname, Python version + executable, active venv/conda env, CPU count + frequency, RAM usage, disk usage.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### `devkit find` — Fast file search
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
devkit find "*.py"
|
|
208
|
+
devkit find "config" -e toml -e ini
|
|
209
|
+
devkit find "*" --min-size 1mb --newer-than 7 # >1 MB, modified in last 7 days
|
|
210
|
+
devkit find --dirs-only "src"
|
|
211
|
+
devkit find "*" -l 500 # show up to 500 results
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### `devkit zip` / `devkit unzip` — Archive utilities
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
devkit zip dist.zip src/ README.md
|
|
220
|
+
devkit zip dist.zip . -x __pycache__ -x "*.pyc" -l 9
|
|
221
|
+
devkit unzip dist.zip ./output
|
|
222
|
+
devkit unzip dist.zip --list # show contents without extracting
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
### `devkit env` — Environment variable management
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
devkit env list # list all env vars
|
|
231
|
+
devkit env list --filter AWS # filter by keyword
|
|
232
|
+
devkit env list --json # JSON output
|
|
233
|
+
|
|
234
|
+
devkit env export # save to .env (dotenv format)
|
|
235
|
+
devkit env export vars.json --format json
|
|
236
|
+
devkit env export activate.sh --format shell # bash / zsh
|
|
237
|
+
devkit env export activate.ps1 --format powershell # Windows PowerShell
|
|
238
|
+
devkit env export activate.bat --format cmd # Windows CMD
|
|
239
|
+
|
|
240
|
+
devkit env diff .env .env.production # show what changed
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Tech Stack
|
|
246
|
+
|
|
247
|
+
| Library | Purpose |
|
|
248
|
+
|---|---|
|
|
249
|
+
| [click](https://click.palletsprojects.com) | CLI framework |
|
|
250
|
+
| [rich](https://rich.readthedocs.io) | Beautiful terminal output, progress bars, tables |
|
|
251
|
+
| [questionary](https://questionary.readthedocs.io) | Interactive prompts |
|
|
252
|
+
| [psutil](https://github.com/giampaolo/psutil) | System metrics (CPU, RAM, disk) |
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Contributing
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
git clone https://github.com/dipenpadhiyar/devit-cli
|
|
260
|
+
cd devit-cli
|
|
261
|
+
pip install -e ".[dev]"
|
|
262
|
+
pytest
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Pull requests are welcome!
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT — see [LICENSE](https://github.com/dipenpadhiyar/devit-cli/blob/main/LICENSE) for details.
|
|
272
|
+
|
|
273
|
+
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/dipenpadhiyar/devit-cli/main/assets/devkit.png" alt="devit-cli" width="300"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<b>A full-featured CLI toolkit for professional Python developers.</b><br/>
|
|
7
|
+
Scaffold projects · Clean builds · Inspect system · Search files · Manage archives & env vars
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/v/devit-cli.svg" alt="PyPI version"/></a>
|
|
12
|
+
<a href="https://pypistats.org/packages/devit-cli"><img src="https://img.shields.io/pypi/dm/devit-cli.svg?label=PyPI%20downloads" alt="Monthly downloads"/></a>
|
|
13
|
+
<a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/pyversions/devit-cli.svg" alt="Python versions"/></a>
|
|
14
|
+
<a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/l/devit-cli.svg" alt="License"/></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="https://pepy.tech/project/devit-cli"><img src="https://static.pepy.tech/badge/devit-cli" alt="Total downloads"/></a>
|
|
19
|
+
<a href="https://pepy.tech/project/devit-cli"><img src="https://static.pepy.tech/badge/devit-cli/month" alt="Monthly"/></a>
|
|
20
|
+
<a href="https://pepy.tech/project/devit-cli"><img src="https://static.pepy.tech/badge/devit-cli/week" alt="Weekly"/></a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install devit-cli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Requires **Python 3.10+**. Works on **Windows · Linux · macOS**.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
devkit # show help + logo
|
|
39
|
+
devkit init # interactive project wizard
|
|
40
|
+
devkit info # system snapshot
|
|
41
|
+
devkit clean # remove caches & build artifacts
|
|
42
|
+
devkit dev # start dev server / install in dev mode
|
|
43
|
+
devkit test # run tests (auto-detects pytest / django)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Commands
|
|
49
|
+
|
|
50
|
+
### `devkit init` — Project wizard
|
|
51
|
+
|
|
52
|
+
Interactively scaffold a new project. Asks for:
|
|
53
|
+
|
|
54
|
+
| Question | Options |
|
|
55
|
+
|---|---|
|
|
56
|
+
| Project type | Python Package · FastAPI · Django · AWS Scripts |
|
|
57
|
+
| Environment | New venv · Existing Python interpreter · New conda · Existing conda env · Skip |
|
|
58
|
+
| Python version | e.g. `3.11` |
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
devkit init # fully interactive
|
|
62
|
+
devkit init my-api --type fastapi --env venv
|
|
63
|
+
devkit init my-lib --type package --env conda --python 3.12
|
|
64
|
+
devkit init my-app -y # skip confirmation prompt
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Generated structures
|
|
68
|
+
|
|
69
|
+
**Python Package**
|
|
70
|
+
```
|
|
71
|
+
my-lib/
|
|
72
|
+
├── my_lib/
|
|
73
|
+
│ ├── __init__.py
|
|
74
|
+
│ └── core.py
|
|
75
|
+
├── tests/
|
|
76
|
+
│ └── test_core.py
|
|
77
|
+
├── docs/
|
|
78
|
+
├── pyproject.toml
|
|
79
|
+
├── README.md
|
|
80
|
+
└── .gitignore
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**FastAPI**
|
|
84
|
+
```
|
|
85
|
+
my-api/
|
|
86
|
+
├── main.py
|
|
87
|
+
├── app/
|
|
88
|
+
│ └── routers/
|
|
89
|
+
│ └── health.py
|
|
90
|
+
├── tests/
|
|
91
|
+
│ └── test_api.py
|
|
92
|
+
├── requirements.txt
|
|
93
|
+
├── README.md
|
|
94
|
+
└── .gitignore
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Django**
|
|
98
|
+
```
|
|
99
|
+
my-site/
|
|
100
|
+
├── manage.py
|
|
101
|
+
├── my_site/
|
|
102
|
+
│ ├── settings.py
|
|
103
|
+
│ ├── urls.py
|
|
104
|
+
│ └── wsgi.py
|
|
105
|
+
├── apps/
|
|
106
|
+
│ └── core/
|
|
107
|
+
│ ├── views.py
|
|
108
|
+
│ └── urls.py
|
|
109
|
+
├── requirements.txt
|
|
110
|
+
└── .gitignore
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**AWS Scripts**
|
|
114
|
+
```
|
|
115
|
+
my-aws/
|
|
116
|
+
├── scripts/
|
|
117
|
+
│ ├── main.py
|
|
118
|
+
│ ├── s3.py
|
|
119
|
+
│ └── ec2.py
|
|
120
|
+
├── tests/
|
|
121
|
+
├── requirements.txt
|
|
122
|
+
└── .gitignore
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### `devkit dev / run / build / test` — Unified task runner
|
|
128
|
+
|
|
129
|
+
Auto-detects project type and runs the right command:
|
|
130
|
+
|
|
131
|
+
| Command | Package | FastAPI | Django | AWS |
|
|
132
|
+
|---|---|---|---|---|
|
|
133
|
+
| `devkit dev` | `pip install -e .[dev]` | `uvicorn main:app --reload` | `manage.py runserver` | `sam local start-api` |
|
|
134
|
+
| `devkit run` | `python -m <module>` | `uvicorn main:app` | `manage.py runserver 0.0.0.0` | `python -m scripts.main` |
|
|
135
|
+
| `devkit build` | `python -m build` | `pip install -r requirements.txt` | `pip install -r requirements.txt` | `sam build` |
|
|
136
|
+
| `devkit test` | `pytest -v` | `pytest -v` | `manage.py test` | `pytest -v` |
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
devkit dev
|
|
140
|
+
devkit test
|
|
141
|
+
devkit build
|
|
142
|
+
devkit run -- --port 9000 # extra args forwarded
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### `devkit clean` — Remove artifacts
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
devkit clean # clean cwd
|
|
151
|
+
devkit clean ./my-project # clean specific dir
|
|
152
|
+
devkit clean --dry-run # preview only
|
|
153
|
+
devkit clean --include-venv # also remove .venv
|
|
154
|
+
devkit clean -y # skip confirmation
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Removes: `__pycache__`, `*.pyc`, `.pytest_cache`, `build/`, `dist/`, `*.egg-info`, `.DS_Store`, `*.log`, `node_modules`, `.coverage`, and more.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
### `devkit info` — System snapshot
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
devkit info
|
|
165
|
+
devkit info --json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Shows: OS, hostname, Python version + executable, active venv/conda env, CPU count + frequency, RAM usage, disk usage.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### `devkit find` — Fast file search
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
devkit find "*.py"
|
|
176
|
+
devkit find "config" -e toml -e ini
|
|
177
|
+
devkit find "*" --min-size 1mb --newer-than 7 # >1 MB, modified in last 7 days
|
|
178
|
+
devkit find --dirs-only "src"
|
|
179
|
+
devkit find "*" -l 500 # show up to 500 results
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### `devkit zip` / `devkit unzip` — Archive utilities
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
devkit zip dist.zip src/ README.md
|
|
188
|
+
devkit zip dist.zip . -x __pycache__ -x "*.pyc" -l 9
|
|
189
|
+
devkit unzip dist.zip ./output
|
|
190
|
+
devkit unzip dist.zip --list # show contents without extracting
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
### `devkit env` — Environment variable management
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
devkit env list # list all env vars
|
|
199
|
+
devkit env list --filter AWS # filter by keyword
|
|
200
|
+
devkit env list --json # JSON output
|
|
201
|
+
|
|
202
|
+
devkit env export # save to .env (dotenv format)
|
|
203
|
+
devkit env export vars.json --format json
|
|
204
|
+
devkit env export activate.sh --format shell # bash / zsh
|
|
205
|
+
devkit env export activate.ps1 --format powershell # Windows PowerShell
|
|
206
|
+
devkit env export activate.bat --format cmd # Windows CMD
|
|
207
|
+
|
|
208
|
+
devkit env diff .env .env.production # show what changed
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Tech Stack
|
|
214
|
+
|
|
215
|
+
| Library | Purpose |
|
|
216
|
+
|---|---|
|
|
217
|
+
| [click](https://click.palletsprojects.com) | CLI framework |
|
|
218
|
+
| [rich](https://rich.readthedocs.io) | Beautiful terminal output, progress bars, tables |
|
|
219
|
+
| [questionary](https://questionary.readthedocs.io) | Interactive prompts |
|
|
220
|
+
| [psutil](https://github.com/giampaolo/psutil) | System metrics (CPU, RAM, disk) |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Contributing
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
git clone https://github.com/dipenpadhiyar/devit-cli
|
|
228
|
+
cd devit-cli
|
|
229
|
+
pip install -e ".[dev]"
|
|
230
|
+
pytest
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Pull requests are welcome!
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT — see [LICENSE](https://github.com/dipenpadhiyar/devit-cli/blob/main/LICENSE) for details.
|
|
240
|
+
|
|
241
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Thin bootstrap entry point for devit-cli.
|
|
3
|
+
|
|
4
|
+
Lives at the top level of site-packages so it is importable even when
|
|
5
|
+
devkit_cli itself is not installed in the active environment. Defers the
|
|
6
|
+
import of devkit_cli into a function body so an ImportError can be caught
|
|
7
|
+
and turned into a human-readable message before Python prints a traceback.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
# Enable ANSI colour codes on Windows.
|
|
13
|
+
# colorama is a transitive dependency of click on Windows, so it is
|
|
14
|
+
# almost always present whenever devkit.exe itself exists.
|
|
15
|
+
if sys.platform == "win32":
|
|
16
|
+
try:
|
|
17
|
+
import colorama
|
|
18
|
+
colorama.init()
|
|
19
|
+
except ImportError:
|
|
20
|
+
pass # Win10+ Terminal supports ANSI natively; older CMD will show plain text
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def main() -> None:
|
|
24
|
+
try:
|
|
25
|
+
from devkit_cli.main import cli # deferred — lets us catch install issues
|
|
26
|
+
except ModuleNotFoundError as exc:
|
|
27
|
+
_friendly_not_installed(exc)
|
|
28
|
+
return # unreachable — _friendly_not_installed calls sys.exit
|
|
29
|
+
|
|
30
|
+
cli() # outside the try so Click's own SystemExit propagates normally
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _friendly_not_installed(exc: ModuleNotFoundError) -> None: # noqa: ANN001
|
|
34
|
+
R = "\033[91m" # red
|
|
35
|
+
B = "\033[1m" # bold
|
|
36
|
+
Y = "\033[93m" # yellow
|
|
37
|
+
RST = "\033[0m" # reset
|
|
38
|
+
|
|
39
|
+
print(
|
|
40
|
+
f"\n{R}Error:{RST} devit-cli is not installed in the active Python environment.\n"
|
|
41
|
+
f"\n{B}Fix:{RST} pip install devit-cli\n"
|
|
42
|
+
f"\n{Y}Active Python:{RST} {sys.executable}\n"
|
|
43
|
+
f"{Y}Active env:{RST} "
|
|
44
|
+
+ _env_name()
|
|
45
|
+
+ f"\n\n{B}Details:{RST} {exc}",
|
|
46
|
+
file=sys.stderr,
|
|
47
|
+
)
|
|
48
|
+
sys.exit(1)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _env_name() -> str:
|
|
52
|
+
"""Return a short human-readable name for the active environment."""
|
|
53
|
+
import os
|
|
54
|
+
from pathlib import Path
|
|
55
|
+
|
|
56
|
+
prefix = os.environ.get("CONDA_DEFAULT_ENV") or os.environ.get("VIRTUAL_ENV")
|
|
57
|
+
if prefix:
|
|
58
|
+
return Path(prefix).name
|
|
59
|
+
return Path(sys.executable).parent.parent.name
|