Metadata-Version: 2.4
Name: kosmo-cli
Version: 0.1.0
Summary: A local developer-environment and dependency orchestration CLI for Python projects.
Author: Sanket
License-Expression: MIT
Project-URL: Homepage, https://github.com/sanket/kosmo
Project-URL: Repository, https://github.com/sanket/kosmo
Project-URL: Issues, https://github.com/sanket/kosmo/issues
Keywords: cli,developer-tools,python,dependency-management,venv
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Installation/Setup
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.27.1
Requires-Dist: rich
Requires-Dist: tomlkit
Requires-Dist: packaging>=24.0
Requires-Dist: requests>=2.34.2
Dynamic: license-file

# Kosmo

**A local developer-environment and dependency orchestration CLI for Python projects.**

Kosmo replaces the tedious `python -m venv .venv && pip install -r requirements.txt` dance with a single, opinionated workflow built around `pyproject.toml`. It creates virtual environments, manages dependencies, syncs installs, runs health checks, and even migrates legacy projects — all from one command.

---

## Installation

```bash
pip install kosmo-cli
```

> **Requires Python 3.10+**

---

## Quick Start

```bash
# Start a new project in the current directory
kosmo init

# Add a dependency (installs it & writes to pyproject.toml)
kosmo add requests

# See what's declared vs. what's installed
kosmo sync --dry-run

# Actually sync everything
kosmo sync

# Check project health
kosmo doctor
```

---

## Commands

| Command | Description |
|---------|-------------|
| `kosmo init` | Create a new `pyproject.toml` and `.venv` in the current directory |
| `kosmo status` | Show project config, venv, and dependency sync status at a glance |
| `kosmo env` | Print virtual environment details (path, Python version, pip version) |
| `kosmo add <pkg>` | Install a package and add it to `pyproject.toml` dependencies |
| `kosmo remove <pkg>` | Uninstall a package and remove it from `pyproject.toml` |
| `kosmo update <pkg>` | Upgrade a package to the latest version and update `pyproject.toml` |
| `kosmo list` | List all declared dependencies and their installed versions |
| `kosmo sync` | Reconcile installed packages with what `pyproject.toml` declares |
| `kosmo doctor` | Run a suite of health checks (venv, config, dependency drift, etc.) |
| `kosmo setup` | Migrate a legacy project (`requirements.txt`, `setup.py`) to `pyproject.toml` + venv |
| `kosmo jump` | Interactively jump to configured project directories |

All commands support `--help` for detailed usage, and you can pass `--debug` globally to see full tracebacks on errors.

---

## How It Works

Kosmo is built on a simple principle: **`pyproject.toml` is your single source of truth.**

- **`kosmo init`** scaffolds a `pyproject.toml` and creates a `.venv` using Python's built-in `venv` module.
- **`kosmo add / remove / update`** modify the `[project.dependencies]` array in `pyproject.toml` and run the corresponding `pip` operation inside `.venv` — atomic, no manual editing.
- **`kosmo sync`** computes a diff between what's declared and what's installed, then installs missing packages, removes extras, and flags version mismatches. Use `--dry-run` to preview.
- **`kosmo doctor`** runs a battery of checks (venv exists? Python version OK? dependencies in sync? config valid?) and gives you a clear pass/warn/fail report with actionable hints.
- **`kosmo setup`** detects existing `requirements.txt` or `setup.py` files and migrates them into a clean `pyproject.toml` + venv setup.

---

## Example Workflow

```bash
mkdir my-api && cd my-api

# Bootstrap
kosmo init

# Add what you need
kosmo add fastapi
kosmo add uvicorn
kosmo add sqlalchemy

# Check everything is healthy
kosmo doctor

# Later, after pulling changes from a teammate
kosmo sync
```

---

## Configuration

Kosmo reads from the standard `pyproject.toml` format:

```toml
[project]
name = "my-api"
version = "0.1.0"
dependencies = [
    "fastapi>=0.100",
    "uvicorn",
    "sqlalchemy>=2.0",
]
```

No proprietary lock files, no extra config files. Just the Python packaging standard.

---

## Contributing

Contributions are welcome! To set up a development environment:

```bash
git clone https://github.com/sanket/kosmo.git
cd kosmo
python -m venv .venv
.venv/Scripts/activate   # Windows
# or: source .venv/bin/activate   # macOS/Linux
pip install -e ".[dev]"
```

---

## License

[MIT](LICENSE)
