Metadata-Version: 2.4
Name: devit-cli
Version: 0.1.8
Summary: A full-featured CLI framework for professional Python developers
Author-email: Dipenkumar <dipen0padhiyar@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/dipenpadhiyar/devit-cli
Project-URL: Issues, https://github.com/dipenpadhiyar/devit-cli/issues
Keywords: cli,developer-tools,scaffold,devkit
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1
Requires-Dist: rich>=13.0
Requires-Dist: psutil>=5.9
Requires-Dist: questionary>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-click>=1.1; extra == "dev"
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Dynamic: license-file

﻿<p align="center">
  <img src="https://raw.githubusercontent.com/dipenpadhiyar/devit-cli/main/assets/devit.png" alt="devit-cli" width="300"/>
</p>

<p align="center">
  <b>A full-featured CLI toolkit for professional Python developers.</b><br/>
  Scaffold projects &nbsp;·&nbsp; Clean builds &nbsp;·&nbsp; Inspect system &nbsp;·&nbsp; Search files &nbsp;·&nbsp; Manage archives &amp; env vars &nbsp;·&nbsp; Track &amp; rollback dependencies
</p>

<p align="center">
  <a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/v/devit-cli.svg" alt="PyPI version"/></a>
  <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>
  <a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/pyversions/devit-cli.svg" alt="Python versions"/></a>
  <a href="https://pypi.org/project/devit-cli/"><img src="https://img.shields.io/pypi/l/devit-cli.svg" alt="License"/></a>
</p>


---

## Installation

```bash
pip install devit-cli
```

Requires **Python 3.10+**. Works on **Windows · Linux · macOS**.

---

## Quick Start

```bash
devit           # show help + logo
devit init      # interactive project wizard
devit info      # system snapshot
devit clean     # remove caches & build artifacts
devit dev       # start dev server / install in dev mode
devit test      # run tests (auto-detects pytest / django)
devit deps      # manage, snapshot & rollback dependencies
```

---

## Commands

### `devit init` — Project wizard

Interactively scaffold a new project. Asks for:

| Question | Options |
|---|---|
| Project type | Python Package · FastAPI · Django · AWS Scripts |
| Environment  | New venv · Existing Python interpreter · New conda · Existing conda env · Skip |
| Python version | e.g. `3.11` |

```bash
devit init                          # fully interactive
devit init my-api --type fastapi --env venv
devit init my-lib --type package --env conda --python 3.12
devit init my-app -y                # skip confirmation prompt
```

#### Generated structures

**Python Package**
```
my-lib/
├── my_lib/
│   ├── __init__.py
│   └── core.py
├── tests/
│   └── test_core.py
├── docs/
├── pyproject.toml
├── README.md
└── .gitignore
```

**FastAPI**
```
my-api/
├── main.py
├── app/
│   └── routers/
│       └── health.py
├── tests/
│   └── test_api.py
├── requirements.txt
├── README.md
└── .gitignore
```

**Django**
```
my-site/
├── manage.py
├── my_site/
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── apps/
│   └── core/
│       ├── views.py
│       └── urls.py
├── requirements.txt
└── .gitignore
```

**AWS Scripts**
```
my-aws/
├── scripts/
│   ├── main.py
│   ├── s3.py
│   └── ec2.py
├── tests/
├── requirements.txt
└── .gitignore
```

---

### `devit dev / run / build / test` — Unified task runner

Auto-detects project type and runs the right command:

| Command | Package | FastAPI | Django | AWS |
|---|---|---|---|---|
| `devit dev` | `pip install -e .[dev]` | `uvicorn main:app --reload` | `manage.py runserver` | `sam local start-api` |
| `devit run` | `python -m <module>` | `uvicorn main:app` | `manage.py runserver 0.0.0.0` | `python -m scripts.main` |
| `devit build` | `python -m build` | `pip install -r requirements.txt` | `pip install -r requirements.txt` | `sam build` |
| `devit test` | `pytest -v` | `pytest -v` | `manage.py test` | `pytest -v` |

```bash
devit dev
devit test
devit build
devit run -- --port 9000    # extra args forwarded
```

---

### `devit clean` — Remove artifacts

```bash
devit clean                  # clean cwd
devit clean ./my-project     # clean specific dir
devit clean --dry-run        # preview only
devit clean --include-venv   # also remove .venv
devit clean -y               # skip confirmation
```

Removes: `__pycache__`, `*.pyc`, `.pytest_cache`, `build/`, `dist/`, `*.egg-info`, `.DS_Store`, `*.log`, `node_modules`, `.coverage`, and more.

---

### `devit info` — System snapshot

```bash
devit info
devit info --json
```

Shows: OS, hostname, Python version + executable, active venv/conda env, CPU count + frequency, RAM usage, disk usage.

---

### `devit find` — Fast file search

```bash
devit find "*.py"
devit find "config" -e toml -e ini
devit find "*" --min-size 1mb --newer-than 7    # >1 MB, modified in last 7 days
devit find --dirs-only "src"
devit find "*" -l 500                           # show up to 500 results
```

---

### `devit zip` / `devit unzip` — Archive utilities

```bash
devit zip dist.zip src/ README.md
devit zip dist.zip . -x __pycache__ -x "*.pyc" -l 9
devit unzip dist.zip ./output
devit unzip dist.zip --list     # show contents without extracting
```

---

### `devit env` — Environment variable management

```bash
devit env list                        # list all env vars
devit env list --filter AWS           # filter by keyword
devit env list --json                 # JSON output

devit env export                      # save to .env  (dotenv format)
devit env export vars.json --format json
devit env export activate.sh  --format shell       # bash / zsh
devit env export activate.ps1 --format powershell  # Windows PowerShell
devit env export activate.bat --format cmd         # Windows CMD

devit env diff .env .env.production   # show what changed
```

---

### `devit deps` — Dependency manager with history & rollback

Wraps `pip` with a clean interface, tracks dependency snapshots, and lets you roll back when an upgrade breaks things.

#### Install & uninstall

```bash
devit deps add requests                   # install + save to requirements.txt
devit deps add "flask>=3.0" sqlalchemy    # multiple packages
devit deps add numpy --no-save           # install without touching requirements.txt
devit deps remove flask                  # uninstall + remove from requirements.txt
```

#### Inspect

```bash
devit deps list                # list all installed packages in the project env
devit deps list --json         # JSON output
devit deps outdated            # show packages that have newer versions available
devit deps outdated --json
```

#### Upgrade all at once

```bash
devit deps add .               # upgrade every outdated package & update requirements.txt
```

#### Snapshot history

Save the current working state before making changes:

```bash
devit deps snapshot                        # save current packages
devit deps snapshot -m "works with v3.0"  # save with a label
devit deps history                         # list all saved snapshots
```

Example output of `devit deps history`:

```
┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━
┃ ID  ┃ Message                   ┃ Packages ┃ Saved At
┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━
│ #2  │ works with v3.0           │       14 │ 2026-04-03T12:00:00
│ #1  │ Snapshot #1               │       12 │ 2026-04-01T09:30:00
```

#### Diff — see what changed and spot issues

```bash
devit deps diff        # compare current env to latest snapshot
devit deps diff 1      # compare to snapshot #1
```

Example output when an upgrade broke something:

```
 Diff: current  vs  Snapshot #1
┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━
┃ Package  ┃ Snapshot ┃ Current  ┃ Status
┡━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━
│ flask    │ 2.3.3    │ 3.1.0    │ ~changed
│ werkzeug │ 2.3.7    │ —        │ -removed

Issues detected:
  • flask version changed  2.3.3 → 3.1.0
  • werkzeug was removed (snapshot had 2.3.7)

  Run devit deps rollback 1 to restore this snapshot.
```

#### Rollback — restore exact pinned versions

```bash
devit deps rollback        # restore latest snapshot
devit deps rollback 1      # restore snapshot #1
devit deps rollback 1 -y   # skip confirmation
```

Snapshots are stored in `.devit/dep_snapshots.json` inside your project directory.

---

## Tech Stack

| Library | Purpose |
|---|---|
| [click](https://click.palletsprojects.com) | CLI framework |
| [rich](https://rich.readthedocs.io) | Beautiful terminal output, progress bars, tables |
| [questionary](https://questionary.readthedocs.io) | Interactive prompts |
| [psutil](https://github.com/giampaolo/psutil) | System metrics (CPU, RAM, disk) |

---

## Contributing

```bash
git clone https://github.com/dipenpadhiyar/devit-cli
cd devit-cli
pip install -e ".[dev]"
pytest
```

Pull requests are welcome!

---

## License

MIT — see [LICENSE](https://github.com/dipenpadhiyar/devit-cli/blob/main/LICENSE) for details.



