polylith-cli
Python tooling support for the Polylith Architecture
What it is and what it does
Polylith-cli is a command-line interface that brings Polylith architecture patterns to Python projects. Polylith is an architecture pattern for organizing code into loosely coupled, highly cohesive modules called components, bases, and projects. The CLI automates workspace initialization and the creation of these structural elements, handling boilerplate setup and directory organization so developers can focus on building modular systems.
The tool integrates with popular Python package managers—Hatch, PDM, Rye, and uv—and works alongside Poetry via a dedicated plugin. It provides commands to scaffold workspaces with a chosen theme (e.g., 'loose'), then create individual components, bases (entry points), and projects within that structure. The CLI relies on five core dependencies to deliver this: pyyaml for configuration, rich for terminal output, tomlkit for pyproject.toml manipulation, typer for command-line argument handling, and typing_extensions for type hints.
Use it for:
- Initialize a new modular Python project with Polylith structure and chosen theme in a single command.
- Scaffold new components, bases, or projects within an existing workspace without manual directory creation.
- Integrate Polylith architecture into projects using Hatch, PDM, Rye, or uv as the build and dependency manager.
- Enforce consistent code organization patterns across a team by automating structural setup.
- Migrate existing Python projects to a modular architecture by generating the initial Polylith workspace layout.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A command-line tool that scaffolds and manages Polylith architecture workspaces in Python, automating the creation of components, bases, and projects within a structured codebase.
Yes, if you are adopting or exploring Polylith architecture in Python. The tool is actively maintained, has low install friction, carries no security vulnerabilities, and is licensed permissively. It is most valuable as part of a deliberate shift toward modular, component-based code organization; it is not a general-purpose utility for typical projects. Install it as a dev dependency in your chosen package manager and use it to bootstrap and manage your workspace structure.
Install
polylith-cli on PyPI
pip
pip install polylith-cliuv
uv add polylith-clipoetry
poetry add polylith-cliInstalling polylith-cli
Before you install
Low friction installation with five lightweight runtime dependencies (pyyaml, rich, tomlkit, typer, typing_extensions). Actively maintained with a release 7 days ago and consistent recent commits; the project shows solid community engagement with 553 repository stars.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial contexts with minimal legal friction.
Quickstart
pip install polylith-cli
# Then in your project directory:
poly create workspace --name my_namespace --theme loose
poly create component --name my_component
poly create base --name my_example_endpoint
Requires Python 3.8 or later; intended for use within a project initialized with a package manager like Hatch, PDM, Rye, or uv, not as a standalone tool.
Verify before relying
- Whether the tool enforces Polylith architecture constraints or only scaffolds the initial structure
- Performance characteristics when managing large workspaces with many components
- Integration depth with each supported package manager (Hatch, PDM, Rye, uv, Poetry)
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — pyyaml, rich, tomlkit, typer, typing_extensions |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,286/month — #12,473 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: polylith_cli-1.50.0-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
hatch-polylith-bricksA Hatch build hook that integrates Polylith…
permissive · top 15,000 on PyPI
cementCement is a Python application framework…
permissive · top 15,000 on PyPI
requires.ioA command-line tool and Python API client for…
unclear · top 15,000 on PyPI
ansible-creatorA CLI tool that scaffolds new Ansible projects…
permissive · top 15,000 on PyPI
pyrigpyrig scaffolds, initializes, and maintains…
permissive · top 15,000 on PyPI
NakedNaked is a command-line application framework…
permissive · top 5,000 on PyPI
hatch_build_scriptsA Hatch build plugin that runs arbitrary shell…
permissive · top 15,000 on PyPI
ms-fabric-cliA command-line interface for Microsoft Fabric…
unclear · top 15,000 on PyPI
ovos-configProvides Python and command-line access to…
permissive · top 15,000 on PyPI
pdmPDM is a modern Python package and dependency…
unclear · top 5,000 on PyPI