skillfed

polylith-cli

Python tooling support for the Polylith Architecture

polylith-cli v1.50.0 110.3K downloads/30d#12,473 on PyPI553
Permissive license MIT Active released

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-cli

uv

uv add polylith-cli

poetry

poetry add polylith-cli

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

polylith architecture pythonmodular code structure generatorcomponent-based project scaffoldingworkspace organization toolpython architecture climonorepo structure managementpolylith workspace setup
architecture-patternproject-scaffoldingmodular-design

More Build Tools packages