Project templates
Project templates
bunpy create scaffolds a new project from a built-in template. No network
access needed - templates are embedded in the bunpy binary.
Usage
bunpy create <template> <project-name> [--yes]--yes skips interactive prompts and accepts all defaults.
Available templates
bunpy create --list| Template | Description |
|---|---|
app | Application with __main__.py entry point |
lib | Library package with __init__.py |
script | Single-file standalone script |
workspace | Monorepo workspace with [tool.bunpy.workspace] |
app
A runnable application with a src/ layout:
bunpy create app myapp --yesGenerated structure:
myapp/
├── pyproject.toml
├── README.md
└── src/
└── myapp/
├── __init__.py
└── __main__.pypyproject.toml:
[project]
name = "myapp"
version = "0.1.0"
requires-python = ">=3.12"__main__.py:
def main():
print("Hello from myapp!")
if __name__ == "__main__":
main()Run:
cd myapp
bunpy src/myapp/__main__.pylib
A reusable library with an __init__.py and test scaffold:
bunpy create lib mylib --yesGenerated structure:
mylib/
├── pyproject.toml
├── README.md
└── src/
└── mylib/
└── __init__.pyscript
A single-file script - minimal boilerplate, just a .py file:
bunpy create script myscript --yesGenerated structure:
myscript/
└── myscript.pymyscript.py:
#!/usr/bin/env bunpy
"""myscript - a standalone bunpy script."""
def main():
print("Hello!")
if __name__ == "__main__":
main()Run directly:
bunpy myscript.pyOr make it executable:
chmod +x myscript.py
./myscript.pyworkspace
A monorepo root with two starter member packages:
bunpy create workspace myws --yesGenerated structure:
myws/
├── pyproject.toml
└── pkgs/
├── alpha/
│ └── pyproject.toml
└── beta/
└── pyproject.tomlRoot pyproject.toml:
[project]
name = "myws"
version = "0.1.0"
[tool.bunpy.workspace]
members = ["pkgs/alpha", "pkgs/beta"]Inspect the workspace:
cd myws
bunpy workspace --listInteractive mode
Without --yes, bunpy prompts for project name, version, and description:
$ bunpy create app
Project name: myapp
Version (0.1.0):
Description: My new bunpy app
✓ Created myapp/