--- id: polylith-cli version: "1.50.0" license: MIT license_treatment: permissive maintenance: active --- # polylith-cli — Python tooling support for the Polylith Architecture License: permissive · Maintenance: active · Downloads: 110.3K/mo ## 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 above — 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 pip install polylith-cli uv add polylith-cli 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_current - Install friction: low - Maintenance: active - Downloads: 110.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags polylith architecture python, modular code structure generator, component-based project scaffolding, workspace organization tool, python architecture cli, monorepo structure management, polylith workspace setup, architecture-pattern, project-scaffolding, modular-design [View on SkillFed](https://skillfed.io/packages/polylith-cli) · [View on PyPI](https://pypi.org/project/polylith-cli/)