Skip to main content

pavilion

A project scaffolder built with Typer.

Install

uv tool install .        # or: uv run pavilion ...

Usage

pavilion add service list             # show available services
pavilion add service redis            # add redis to the compose file in the current dir
pavilion add service postgres        # pick a version with the arrow keys
pavilion add service postgres --version 17   # non-interactive
pavilion add service redis -f infra/compose.yaml
pavilion add service redis --force    # overwrite an existing redis service

Pavilion edits the first of compose.yaml, compose.yml, docker-compose.yaml or docker-compose.yml it finds, or creates docker-compose.yml. Existing comments and ordering are preserved.

Available services: redis (8, 7) and postgres (18, 17, 16, 15). Without --version, pavilion asks interactively; when there's no terminal (CI, pipes) it uses the newest.

Postgres defaults (postgres / postgres, database app) can be overridden with POSTGRES_USER, POSTGRES_PASSWORD and POSTGRES_DB in a .env file.

Keys

pavilion add keys                     # pick an algorithm with the arrow keys
pavilion add keys ES256               # RS256 | ES256 | EdDSA (case-insensitive)
pavilion add keys EdDSA -d config/jwt # custom directory (default: secrets)
pavilion add keys RS256 --rsa-bits 4096  # RSA key size (default 2048, prompted if omitted)
pavilion add keys RS256 --force       # replace an existing key pair
pavilion add keys EdDSA --refresh     # refresh-token pair: private_refresh.pem, public_refresh.pem

Writes private.pem (PKCS#8, mode 0600) and public.pem (SubjectPublicKeyInfo). The directory gets its own .gitignore so keys are never committed by accident.

Auth

pavilion add auth                     # answer the prompts with the arrow keys
pavilion add auth --transport cookie --algorithm ES256 --hashing argon2
pavilion add auth --transport header --strategy symmetric
pavilion add auth --algorithm RS256 --rsa-bits 3072 --refresh-keys separate
pavilion add auth --access-ttl 30m --refresh-ttl 7d

Generates a framework-agnostic auth/ package (-d to change) built on JWT access and refresh tokens. Their lifetimes default to 3h and 24h; enter them as 30m, 3h, 7d or 90s (a bare number means hours), and the refresh TTL must be the longer one.

File Contents
tokens.py create/verify access and refresh tokens
service.py AuthService.login / refresh / logout / authenticate
passwords.py hash_password / verify_password (Argon2 or bcrypt)
cookies.py (--transport cookie) HttpOnly cookie settings for response.set_cookie(**cookie.kwargs)

With --transport header clients send Authorization: Bearer <access token>; with --transport cookie the tokens are set as HttpOnly cookies (the refresh cookie is SameSite=Strict and only sent to /auth).

Implement UserRepository.get_by_username() for your user model; see the generated __init__.py for an example. Asymmetric signing reuses (or creates) the key pair in secrets/; symmetric creates secrets/jwt_secret. With --refresh-keys separate, refresh tokens are signed with their own keys/secret (secrets/private_refresh.pem and public_refresh.pem, or secrets/jwt_secret_refresh), so a leaked access key can't forge refresh tokens. The in-memory revoked-token store is for development; back it with Redis or a database in production.

Development

Each pavilion add ... feature lives in its own folder under src/pavilion/, with its command (cli.py) next to the logic behind it:

cli.py              root app; wires the feature commands together
ui.py               shared menus, prompts and error exits
compose/            add service   (file.py edits the compose file; services/ has one module per service)
keys/               add keys      (generate.py)
auth/               add auth      (config.py, scaffold.py, templates/)

To add a compose service, create compose/services/<name>.py with a ServiceSpec and register it in compose/services/__init__.py. Tests mirror this layout under tests/.

uv run pytest

Metadata

Release files for pavilion 0.1.0

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

Source distribution (sdist)

Source distribution for pavilion 0.1.0
File Size Uploaded Provenance Actions
pavilion-0.1.0.tar.gz 18.1 kB Without provenance Details for pavilion-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 45.0 kB

Release files / pavilion-0.1.0.tar.gz

Download URL pavilion-0.1.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1d114d7e249c718a130ec2c8bbb7046a72dfba3307b620b04a7a5986f3892ccb
BLAKE2b-256 checksum
How to use checksums
94323607d2d5e246489dc84ae22ba36ca4ef55b54167223eddcb074fd02508d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pavilion-0.1.0-py3-none-any.whl

Download URL pavilion-0.1.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38d11019dba82f6e2d9f401567b4eb33f5a6400403a71aa390ec2c8f9b518b44
BLAKE2b-256 checksum
How to use checksums
0a8f2216fc2f02aa35875ba4e6d76dac468972d333ca9cc31ca6a863fd9c0cab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pavilion 0.1.0

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.

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