Skip to main content
Protostar Logo

High-velocity, zero-friction Python environment scaffolding.

PyPI Version CI Release Codecov Python Documentation License

Setting up a new python project often requires the same manual steps: configuring linters, writing Dockerfile, .gitignore and .dockerignore files, setting up virtual environments, and linking IDEs. Protostar automates this boilerplate so you can skip the setup and get straight to writing code.


Protostar demo

🆚 Why Protostar? (vs. Copier/Cookiecutter)

While general-purpose template engines like Copier and Cookiecutter are incredibly powerful for cross-language scaffolding, they treat configuration files as raw text templates. Protostar is deeply specialized for the modern Python ecosystem:

  • Semantic AST Merging: Instead of brittle string templates ({{ dependencies }}), Protostar natively parses and merges pyproject.toml and .gitignore files, preserving your comments and formatting.
  • Composable Tooling: No more sprawling template repos with nested Jinja conditionals. Toggle tools dynamically at runtime (--no-direnv --docker).
  • Scalable Templates: Define entire organizational standards in a single, shareable .toml file, or scale up to a full Git repository for complex multi-file architectures.
  • Agent & Machine Ready: Manifest-first architecture enables atomic --dry-run simulations and position-independent --json output for AI workflows.

Use Copier for complex, multi-language codebases needing long-term 3-way git sync. Use Protostar for fast, modular, zero-friction Python environment bootstrapping.


📖 Official Documentation

Ready to dive deeper? The README only scratches the surface.

Head over to the Official Documentation for:

  • Command Reference: Full flags and capabilities for init.
  • Agent & Machine Interface: Driving Protostar programmatically via --json and --dry-run.
  • Domain Presets: Matrices for Scientific, Astrophysics, ML, DSP, Embedded, REST API, and CLI Application workflows.
  • Configuration & Shell Autocomplete: Setting up global defaults, CLI autocompletion, and advanced AST overrides.
  • Architecture Mechanics: Deep dives into the Orchestrator, Executor, and Manifest lifecycle.

💡 Design Philosophy

Protostar is built to save you time and stay out of your way. It adheres to a strict separation of concerns to avoid generating bloated artifacts you'll inevitably just delete manually:

  1. Foundational Scaffolding: The protostar init command is designed to be run exactly once at the inception of a repository to lay the architectural groundwork, establishing your dependency managers and directory structures.

  2. Plan First, Write Later: Many setup scripts run a sequence of shell commands and fail unpredictably midway through, leaving behind half-configured files. Protostar plans all changes upfront in memory during the read-only plan() phase before touching disk or running subprocesses in execute(). This guarantees clean dry-runs and zero partial failures.

  3. AI & Agent Ready: With position-independent --json flags and atomic dry-running, AI agents and automation scripts can programmatically interrogate the CLI, plan workspace changes, resolve collisions, and execute headless scaffolding without hanging on interactive prompts.

  4. Fail Loud, Fail Early: Pre-flight checks ensure all system dependencies (like uv, git, or direnv) are present before any state is mutated.

  5. Non-Destructive by Default: Protostar never blindly overwrites your existing work. It dynamically appends to .gitignore files, intelligently merges IDE JSON configurations, uses deterministic AST modification to deep-merge TOML configurations, and safely aborts if generated files already exist.

  6. Actionable Telemetry: When things break, Protostar bubbles up the exact stderr so you know immediately if a network request or dependency resolution failed. For unexpected internal crashes, it automatically generates a URL-encoded GitHub issue containing your system environment details to make debugging painless. You can also append the global --verbose (or -v) flag to any command to enable rich, detailed stack traces and debug-level logging.


⚡️ Performance & Latency Isolation

Protostar is built to be lightweight, so Python's startup overhead never slows down your local development.

  • Fast Hook Resolution: Instead of making slow Git network calls to resolve hook versions (like pre-commit autoupdate), Protostar resolves them via a pre-compiled JSON registry fetched in milliseconds, with an offline fallback if you are disconnected.
  • Micro-Optimization: We measure initialization latency using two benchmarking approaches:
    1. Fast-Path Execution: Measures the latency of non-interactive commands (e.g., protostar help init).
    2. TUI-Path Execution: Measures the overhead of triggering the interactive questionary wizards.

Our CI pipeline enforces a strict performance budget using hyperfine, gating any PR that introduces significant regressions in either path. We maintain historical tracking to ensure long-term architectural stability rather than chasing absolute CI metrics (which are subject to heavy VM variance).


📦 Installation

Protostar offers full cross-platform support and runs natively on Linux, macOS, and Windows.

macOS (Homebrew)

brew install jacksonfergusondev/tap/protostar

Universal (uv)

For isolated CLI tool installation on any OS, uv is highly recommended:

uv tool install protostar

Universal (pipx)

pipx install protostar

Universal (pip)

pip install protostar

Note: If you install Protostar into an existing Python environment with pip, it will bring in questionary and prompt_toolkit for the interactive wizard. For guaranteed isolation and to avoid dependency conflicts, prefer uv tool or Homebrew.


🚀 Quick Start

Protostar is designed to be run right after you mkdir a new project.

The Interactive Wizard

If you run protostar without any arguments, it launches an interactive Terminal User Interface (TUI).

The wizard will first ask if you want to scaffold using a Template. Templates are the fastest way to use Protostar, instantly wiring together tools, dependencies, and directory structures. You can choose from built-in domain templates (like astro or cli), select your own custom global aliases, or build an environment from scratch.

mkdir orbital-mechanics-sim
cd orbital-mechanics-sim
protostar

Headless Scaffolding & Tri-State Toggles

For rapid, repeatable initialization, bypass the TUI entirely. Templates are the primary way to drive Protostar headlessly:

protostar init --template cli

Because Protostar uses tri-state toggling (on / off / template-default), you always remain in control. You can load a template but explicitly override its default opinions by passing --<flag> to force a tool on, or --no-<flag> to force it off:

protostar init --template cli --no-direnv --docker

Result: Scaffolds the cli template, strips out the default direnv scaffolding, and generates container artifacts (Dockerfile, .dockerignore).

To bypass any interactive collision prompts when running in headless CI environments, use --force-merge or --force-replace. You can also explicitly override the target Python version by passing --python-version 3.13.

Dry-Run Simulations & Agent Integration

You can preview the entire scaffolding plan without touching disk or running subprocesses by passing --dry-run:

protostar init --template cli --dry-run

For AI coding agents and automated scripts, append the position-independent --json flag. Protostar outputs structured, machine-parseable JSON envelopes to stdout while routing all human logs to stderr:

# Plan scaffolding via JSON
protostar init --template cli --dry-run --json

# Execute scaffolding via JSON
protostar init --template cli --force-merge --json

See the Agent & Machine Interface Guide for complete protocol documentation.

Portable Templates & Global Aliases

If you want to enforce team-wide standards across multiple repositories, you can host your own custom template TOML files remotely (or store them locally). Use the --from flag to dynamically fetch and inject them. Protostar automatically translates web UI links into raw text links for GitHub, GitLab, Bitbucket, Codeberg, and Sourcehut, and natively supports unpacking .zip/.tar.gz repository archives.

protostar init --from https://raw.githubusercontent.com/YourOrg/standards/main/backend.toml

Global Aliases: Instead of typing long URLs, you can register templates in your global configuration (~/.config/protostar/config.toml):

[templates]
backend = "https://raw.githubusercontent.com/YourOrg/standards/main/backend.toml"

Now you can run protostar init --template backend anywhere, and it will automatically appear alongside built-ins in your interactive wizard.

Note: To prevent unauthorized remote code execution, external templates containing shell tasks are secured behind an explicit Interactive Trust Dialog. Templates mapped as global aliases bypass this prompt automatically.

Authoring Custom Templates & Schema Validation

You can author custom templates to enforce organizational standards across dependencies, linter configurations, and directory structures. Protostar can export the official JSON Schema to enable real-time linting and autocompletion in editors like VS Code (via Even Better TOML):

# Export the template JSON Schema
protostar export-schema --json > protostar-template.schema.json

Add the schema header to the top of your custom template file for editor validation:

#:schema ./protostar-template.schema.json

# --- Dependencies ---
dependencies = ["fastapi", "uvicorn"]
ruff = true
pytest = true

For full template specifications, AST injections, and multi-file repository templating, visit the Template Authoring Guide.


🤝 Collaboration

This tool uses a highly decoupled, plugin-style architecture. The CLI parser dynamically evaluates module registries at runtime.

  • To add support for a new core tool (e.g., a linter or formatter): Subclass BootstrapModule.
  • To define a new domain workflow: Author a declarative TOML Template.

Protostar maintains strict engineering standards to ensure reliability, including 100% type-hinting, isolated pytest environments (mocked subprocesses and tmp_path disk isolation), and automated ruff formatting.

Please see the Documentation for full details on our development setup, architectural rules, and pull request guidelines.

📧 Contact

GitHub LinkedIn Email


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for protostar 0.9.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 protostar 0.9.0
File Size Uploaded
protostar-0.9.0.tar.gz 234.8 kB Details

Built distribution (wheel)

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

Total release size: 369.3 kB

Release files / protostar-0.9.0.tar.gz

Download URL protostar-0.9.0.tar.gz
Size 234.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f4c5b70147dd7c0f82d486d2667ab8684157d5c0da0f988feb83085a246dbb6c
BLAKE2b-256 checksum
How to use checksums
cc30ce1bbce4f55db04e2285de81e00768a7cc8cd037da4f86320192e6ed9766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / protostar-0.9.0-py3-none-any.whl

Download URL protostar-0.9.0-py3-none-any.whl
Size 134.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65afe06f384da6a0800b205dc27c60253e33382454d330673b8adc180e4ff2c9
BLAKE2b-256 checksum
How to use checksums
87d8ebfff68b6c5eaefdf2dd7153cff5b86ea362e6a7a6295825ba3b69592f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

2 release files

This release

0.9.0 This release

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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