Skip to main content

nguyenpanda logo

🐼 nptmpl - Distributed CLI Template Manager

PyPI version License: MIT Python 3.10+

nptmpl is a high-performance, distributed CLI template manager designed for professional software engineers. It automates boilerplate generation with a robust local registry, versioning, Jinja2-powered variable injection, and seamless remote HTTP/SSH registry support.


🌐 Public Registry

We host an official template registry for the community! Browse, search, and clone templates directly from our public instance.


✨ Features

  • Distributed Registry: Host your own private registry with a Web UI and REST API.
  • Enterprise-Grade Security: Built-in path traversal mitigation, automatic tarball memory limits (max 1MB payload inspection), and robust paramiko SSH policies.
  • Blazing Fast Concurrency: Server runs SQLite operations within thread pools using Write-Ahead Logging (WAL) to guarantee non-blocking AsyncIO loops.
  • Smart Compression: Optimized tar.gz archives preserving symlinks and permissions.
  • Dynamic Injection: Full Jinja2 support for contents and paths, automatically skipping binary files.
  • Post-Clone Hooks: Automatically run shell commands after cloning.
  • Auto-Discovery: Respects .gitignore and global patterns via pathspec.

🛠️ Installation & Setup

Option 1: Install via uv (Fastest)

nptmpl uses uv for lightning-fast installation.

uv tool install nptmpl

Option 2: Install via pip

If you don't use uv, you can install standardly from PyPI:

pip install nptmpl

Option 3: Install from Source

Ideal for development or contributing to nptmpl.

Using uv (Recommended):

# Clone the repository
git clone https://github.com/nguyenpanda/nptmpl
cd nptmpl

# Install as a global tool in editable mode
uv tool install --editable . --force

Using pip:

# Clone the repository
git clone https://github.com/nguyenpanda/nptmpl
cd nptmpl

# Install in editable mode
pip install -e .

2. Enable Tab Completion (Recommended)

# Install completion helper
uv tool install argcomplete

# Add to your ~/.zshrc or ~/.bashrc
eval "$(register-python-argcomplete nptmpl)"

📖 Usage Guide

1. Initialize a Template

nptmpl init ./my-project

2. Add to Local Registry

nptmpl add ./my-project web/starter

3. Clone and Render

nptmpl clone web/starter ./new-app --var project_name="My App"

4. Remote Operations

Push to server (requires authentication token):

nptmpl push web/starter https://registry.example.com

Search and clone from remote:

nptmpl search fullstack --remote https://registry.example.com
nptmpl clone https://registry.example.com/api/v1/templates/web/starter ./my-app

🏗️ Variable Injection (Jinja2)

nptmpl leverages the full power of Jinja2 to make your templates dynamic. It safely skips binary files to avoid corruption.

1. Define Variables

In your project's .nptmpl file (created via nptmpl init), define the variables you want to prompt for:

variables:
  project_name: "The human-readable name of your project"
  author_name: "The main developer's name"
  enable_docker: "Set to 'true' to include Dockerfile"

2. Use in File Content

Use the standard {{ variable_name }} syntax inside any file in your template:

# settings.py
PROJECT_NAME = "{{ project_name }}"
AUTHOR = "{{ author_name }}"

3. Use in Filenames & Directories

You can also use variables in the names of files and folders. For example:

  • src/{{ project_name }}/main.py
  • docs/{{ author_name }}_guide.md

4. Provide Variables via CLI

When cloning, use the --var (or -v) flag:

nptmpl clone web/starter ./my-new-app -v project_name="My Cool App" -v author_name="Alice"

If a variable is defined in .nptmpl but not provided via the CLI, nptmpl will interactively prompt you for its value.


⚙️ Configuration

nptmpl looks for ~/.config/nptmpl/config.yaml. See the exhaustive Configuration Guide for all available options.

core:
  store_path: "$HOME/.local/share/nptmpl/db"
  auth_token: "your-secure-api-token" # Required for pushing to server
  
defaults:
  author: "Your Name"
  email: "you@example.com"
  license: "MIT"

📄 License

MIT License. See LICENSE for details.

Metadata

Release files for nptmpl 1.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 nptmpl 1.1.0
File Size Uploaded Provenance
nptmpl-1.1.0.tar.gz 156.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 334.6 kB

Release files / nptmpl-1.1.0.tar.gz

Download URL nptmpl-1.1.0.tar.gz
Size 156.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dff4f81d6f39f8603185de2c7bf1c723ddba3e40a45838091a8df27610d69164
BLAKE2b-256 checksum
How to use checksums
7a75699f1aa762dab919e9411437382afceab7d34837316e5bd32aa3e850bd02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nptmpl-1.1.0-py3-none-any.whl

Download URL nptmpl-1.1.0-py3-none-any.whl
Size 178.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a648c1784493fd23700045086a81f36325e1a42e5b92f2f5a7574b08cee273b
BLAKE2b-256 checksum
How to use checksums
b24ed99a3f3d9fc9606fe0d7b671a1c6b258cce17f51c71778beb20749e79a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for nptmpl 1.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.

Release history Release notifications | RSS feed

This release

1.1.0 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