Skip to main content

Project scaffold generator

Project description

Templum

PyPI version PyPI downloads

CLI scaffold generator for FastAPI services and Typer CLI tools with clean layered architecture. Install the package — one command creates a ready project with dependencies.

Every generated project ships with a CLAUDE.md that encodes all architectural rules so Claude Code works within the project's patterns from the first message.

Usage

uvx templum my-service

Or install globally and use as a persistent command:

uv tool install templum
templum my-service

With options:

templum my-service --output-dir ~/projects --python 3.12
templum my-tool --type cli
Flag Default Description
--output-dir, -o . Parent directory for the new project
--python, -p 3.13 Minimum Python version
--type, -t api Project type: api, cli, or hybrid

The command runs:

  1. uv init --bare — initializes the project
  2. Copies the scaffold (app/, Dockerfile for API, .gitignore)
  3. Assembles CLAUDE.md from Jinja2 templates — type-specific architecture + shared conventions
  4. uv add — installs base dependencies

What you get

API project

my-service/
├── app/
│   ├── main.py          # FastAPI app, lifespan, router registration
│   ├── config.py        # Configuration via pydantic-settings
│   ├── auth.py          # Bearer token auth factory (do not modify)
│   ├── deps.py          # DI engine (do not modify)
│   └── setups/
│       ├── base.py      # Abstract setup (do not modify)
│       └── local.py     # Default setup — wire new services here
├── Dockerfile            # Multi-stage build with uv
├── CLAUDE.md             # Architectural rules for Claude Code
└── pyproject.toml        # Created by uv init

No domains or infrastructure implementations are included — the scaffold defines the shape; you fill it in.

CLI project

my-tool/
├── app/
│   ├── main.py          # Entry point — root Typer app, main() entry point
│   ├── config.py        # Configuration via pydantic-settings
│   └── commands/
│       └── root.py      # Default command group — add more modules here
├── CLAUDE.md             # Architectural rules for Claude Code
└── pyproject.toml        # Created by uv init, includes [project.scripts]

Hybrid project

FastAPI server + Typer management CLI sharing the same config and domain services.

my-project/
├── app/
│   ├── main.py          # FastAPI app, lifespan, router registration
│   ├── config.py        # Configuration shared with the CLI
│   ├── auth.py          # Bearer token auth factory (do not modify)
│   ├── deps.py          # DI engine (do not modify)
│   └── setups/
│       └── local.py     # Default setup — wire new services here
├── cli/
│   ├── main.py          # Typer app, imports Config from app.config
│   └── commands/
│       └── root.py      # Management command group
├── Dockerfile            # Multi-stage build with uv
├── CLAUDE.md             # Architectural rules for Claude Code
└── pyproject.toml        # Includes [project.scripts] for CLI entry point

Running the generated project

API

cd my-service
uv run fastapi dev app/main.py

Server at http://localhost:8000, docs at /docs.

Docker

docker build -t my-service .
docker run -p 8000:8000 my-service

CLI

cd my-tool
uv run my-tool --help
uv run my-tool hello --name Claude

Hybrid

cd my-project
uv run fastapi dev app/main.py   # HTTP server
uv run my-project --help         # management CLI
uv run my-project status

Architecture

API

router → service → infrastructure

Each layer has one job and depends only on the layer below it via abstract interfaces. The full dependency graph is assembled in a single setup file — swapping infrastructure means creating a new setup, not touching any service.

CLI

commands/ → app/main.py → config.py

Each command group lives in its own module under commands/. Add new groups by creating commands/<group>.py and registering them in main.py.

The full spec lives in the generated project's CLAUDE.md.

CLAUDE.md structure

The generated CLAUDE.md is assembled at scaffold time from composable Markdown fragments:

_docs/
├── api.md / cli.md      # Type-specific: architecture, principles, structure, checklists
└── shared/
    ├── code_style.md    # Naming conventions, type hints, async/sync rules, logging
    ├── done.md          # Definition of Done
    ├── tooling.md       # Data model guidance, third-party clients, dependency management
    └── testing.md       # Service tests, infrastructure tests

Jinja2 templates (claude_api.md.j2, claude_cli.md.j2) stitch the fragments together in the right order. No content is duplicated — each rule lives in exactly one file.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

templum-0.1.4.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

templum-0.1.4-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file templum-0.1.4.tar.gz.

File metadata

  • Download URL: templum-0.1.4.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for templum-0.1.4.tar.gz
Algorithm Hash digest
SHA256 06d2f5563df77fdb27da5ec2338cb00e0a9a96f85ca51ddad8dc9e0ef8b6e8c2
MD5 6d26e453b9379c01e0a8dc7fcd885a0c
BLAKE2b-256 1a51571763b89b22cfd85e113bf7911e83537ba8da442ca586405110f6ec5254

See more details on using hashes here.

File details

Details for the file templum-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: templum-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for templum-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e4f3a6683c2ac982059518dff9bfc1321c9df1bcc921b61ac11c5922759480b1
MD5 0083063d0a961979dccb38c6b295c582
BLAKE2b-256 eb1d7f5891be936ca345748e250ef94c51f961aa78884f6460445b8a11302674

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page