Skip to main content
Using uvtemplate

uvtemplate

Documentation CI status PyPI - Python Version uv Copier X (formerly Twitter) Follow

A time-saving CLI tool to quickly start new Python projects with uv using the simple-modern-uv template.

Quick Start

For Humans (Interactive Mode)

uvx uvtemplate create

This will guide you through creating a new project step by step.

For AI Agents (Non-Interactive Mode)

AI coding agents like Claude Code can create projects programmatically:

uvx uvtemplate --yes --destination my-project \
  --data package_name=my-project \
  --data package_description="My awesome project" \
  --data package_author_name="Your Name" \
  --skip-git

Do I Need uv?

Yes. You will need to have uv installed. Read that page or my template docs for background on why uv is such an improved package manager for Python.

What is uvtemplate?

It’s the tool I wish I’d had when setting up projects with uv.

uvx uvtemplate create will clone a new project template and help you set up your GitHub repo. The template is tiny and sets up uv, ruff linting and formatting, GitHub Actions, publishing to PyPI, type checking, and more.

Usage

Commands

Command Description
uvtemplate Show help and available options
uvtemplate create Start interactive project creation
uvtemplate migrate Analyze an existing project and show migration recommendations
uvtemplate update Update a template-based project to the latest template version
uvtemplate readme Print this documentation

Options

Option Description
--destination DIR Destination directory for the project
--data KEY=VALUE Set a template value (can be repeated)
--yes Auto-confirm all prompts (non-interactive mode)
--skip-git Skip GitHub repository and git setup
--template URL Use a custom copier template
--answers-file FILE Load defaults from a .copier-answers.yml file
--no-gh-cli Don't use gh CLI to create repo
--public Create a public repository (default: private)
`--git-protocol ssh https`

Template Values

Use --data KEY=VALUE to set these values:

Key Description Example
package_name Package name (kebab-case) my-project
package_module Python module name (snake_case) my_project
package_description Short description "A useful tool"
package_author_name Author's name "Jane Doe"
package_author_email Author's email "jane@example.com"
package_github_org GitHub username or org "janedev"

Examples

Interactive (Human) Usage

Start the interactive wizard:

uvx uvtemplate create

Skip git setup (just create the project files):

uvx uvtemplate create --skip-git

Non-Interactive (Agent) Usage

Create a complete project without any prompts:

uvx uvtemplate --yes --destination my-cli-tool \
  --data package_name=my-cli-tool \
  --data package_module=my_cli_tool \
  --data package_description="A command-line tool for doing things" \
  --data package_author_name="Claude" \
  --data package_author_email="ai@example.com" \
  --data package_github_org="myorg" \
  --skip-git

Create a project and set up a private GitHub repo:

uvx uvtemplate --yes --destination my-project \
  --data package_name=my-project \
  --data package_description="My project" \
  --data package_github_org="myorg"

Create a project with a public GitHub repo:

uvx uvtemplate --yes --destination my-project \
  --data package_name=my-project \
  --public

Using an Answers File

If you have a .copier-answers.yml from a previous project:

uvx uvtemplate --yes --destination new-project \
  --answers-file /path/to/existing/.copier-answers.yml

For AI Coding Agents

This tool is designed to work well with AI coding agents like Claude Code, Cursor, GitHub Copilot, etc.

Key Points for Agents

  1. Use --yes flag: This auto-confirms all prompts, making the tool fully non-interactive.

  2. Provide all values via --data: Set template values upfront to avoid interactive prompts.

  3. Use --skip-git if you want to handle git setup separately or don’t need it.

  4. The tool uses exit codes: 0 for success, 1 for failure/cancellation.

  5. Values are derived intelligently: If you provide --destination my-project, the tool will automatically derive package_name=my-project and package_module=my_project unless you override them.

Minimal Agent Example

The simplest non-interactive usage:

uvx uvtemplate --yes --destination my-project --skip-git

This creates a project with sensible defaults derived from the destination name and your git/GitHub config.

Complete Agent Example

For full control:

uvx uvtemplate --yes --destination my-project \
  --data package_name=my-project \
  --data package_module=my_project \
  --data package_description="Project description here" \
  --data package_author_name="Author Name" \
  --data package_author_email="author@example.com" \
  --data package_github_org="github-org" \
  --skip-git

What Python Project Template Does it Use?

The simple-modern-uv template. See that repo for full docs and this thread for a bit more context.

The template includes:

  • uv for project setup and dependencies

  • ruff for modern linting and formatting

  • GitHub Actions for CI and publishing workflows

  • Dynamic versioning from git tags

  • PyPI publishing workflows

  • BasedPyright for type checking

  • Pytest for tests

  • Codespell for spell checking

If you prefer, you can use that template directly; uvtemplate is just a CLI wrapper.

If you have another copier-format template you want to use, specify it with --template.

Migrating an Existing Project

Use the migrate command to analyze an existing project and get migration recommendations:

cd my-existing-project
uvx uvtemplate migrate

This will detect your current build system (Poetry, setuptools, Pipenv, etc.) and provide a step-by-step guide for migrating to uv. It analyzes your project and outputs recommendations—it does not automatically modify any files.

The migrate command works well with AI agents, providing structured recommendations that an agent can follow to perform the migration.

Alternative: Manual Migration

You can also create a fresh template as a reference and manually copy what you need:

uvtemplate create --skip-git --destination .uvtemplate-ref

Then copy the relevant files (pyproject.toml structure, Makefile, workflows, etc.) into your existing project.

Updating a Project

Projects created with uvtemplate can be updated to the latest template version:

cd my-project
uvx uvtemplate update

This uses copier under the hood to apply template updates while preserving your customizations. The command will show you what changed and let you resolve any conflicts.

For non-interactive updates (useful for AI agents):

uvx uvtemplate update --yes

Note: The update command only works on projects that were created with uvtemplate (or copier directly). If you migrated a project manually, use uvtemplate migrate to see recommendations.


This project was (of course) built using simple-modern-uv.

Metadata

Release files for uvtemplate 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uvtemplate 0.1.10
File Size Uploaded Provenance Actions
uvtemplate-0.1.10.tar.gz 61.7 kB Without provenance Details for uvtemplate-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uvtemplate 0.1.10
File Interpreter ABI Platform Actions
uvtemplate-0.1.10-py3-none-any.whl Python 3 none any Details for uvtemplate-0.1.10-py3-none-any.whl

Total release size: 89.7 kB

Release files / uvtemplate-0.1.10.tar.gz

Download URL uvtemplate-0.1.10.tar.gz
Size 61.7 kB
Tags Source
SHA-256 checksum
How to use checksums
192589252a970664ebb0b72f9fc6b78b8fa991ef1d021a99c5c602f9608ca555
BLAKE2b-256 checksum
How to use checksums
e4bdf4e4342694351c581a79352eeffd098a591ed6ff040a51552643f8bdb47f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / uvtemplate-0.1.10-py3-none-any.whl

Download URL uvtemplate-0.1.10-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
806e237fff779ad0a96d137c0607e5b63ea33900f11f527f8f08955847e3d126
BLAKE2b-256 checksum
How to use checksums
dbf477aea7e7a7699e427ba3b5d7fdd488a9ff3b34edcc9df8bb4fe7b95a55e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for uvtemplate 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page