# How uv Publish Works: Package Publishing Architecture and the uv-publish Crate

> Discover how uv handles package publishing with its architecture. Learn about the uv-publish crate and its role in the publishing process.

- Repository: [Astral/uv](https://github.com/astral-sh/uv)
- Tags: architecture
- Published: 2026-03-01

---

**`uv` handles package publishing through a layered architecture where the CLI command in [`crates/uv/src/commands/publish.rs`](https://github.com/astral-sh/uv/blob/main/crates/uv/src/commands/publish.rs) orchestrates the process, but the actual publishing logic resides in the dedicated `uv-publish` crate.**

The `uv publish` command in the `astral-sh/uv` repository provides a fast, Rust-native alternative to `twine` for uploading Python distributions to PyPI and compatible registries. Understanding which crate handles the heavy lifting—and how the upload flow is structured—helps developers troubleshoot authentication issues, optimize upload performance, and leverage advanced features like trusted publishing.

## The Architecture: CLI vs. Core Engine

`uv` separates