svdev — Dev Environment Manager

Python CLI for multi-tenant isolated dev environments · FAS @ UniTN

What is svdev?

svdev is a Python package (installable via pip install -e .) that exposes a single svdev command to manage isolated development environments on a single machine. Each tenant is a Docker Compose stack built from a shared core FastAPI image, with per-tenant routes loaded at runtime by importing a router.py via importlib — no framework code duplication across tenants.

Architecture Highlight

Docker Compose files are not committed — they are generated at runtime from a Python string.Template and stored under ~/.svdev/<tenant>/. This keeps runtime artifacts separate from source code and makes it trivial to regenerate or update the stack config without editing files by hand. The Docker SDK handles inspection (state, health, uptime); subprocess drives docker compose for lifecycle operations.

CLI Commands

  • svdev new — scaffold a new tenant with an auto-assigned port
  • svdev list / status — show state, port, uptime, health, and image via the Docker SDK
  • svdev start / stop / restart / logs — full lifecycle management for any tenant
  • svdev bash / edit — open a shell or edit the tenant config in-place
  • svdev remove — tear down the stack and delete its volumes (destructive)

Built-in Docs Tenant

svdev ships a built-in docs tenant that serves the project documentation as a FastAPI + Jinja2 web app, rendering Markdown to HTML at request time. The same Markdown source is also compiled to PDF via Docker — documentation treated as code, served and built from a single source of truth.

Tech Stack

Python Click Rich Docker SDK FastAPI Jinja2 Docker Compose Bash