My personal project template, flexible but mainly for Python and TypeScript projects with full formatting, type safety, environment isolation, and dependency management.
- Multi-language support: Python and TypeScript in a single project. Golang is installed too, but its just used for mvdan.cc/sh/v3/cmd/shfmt
- Type safety: Pyright for Python, Bun / TypeScript with strict settings
- Environment isolation: No actual need for virtualenvs.
direnv/env.shsets up a dedicated, scoped directory for the project in your home folder for all dependencies and modifies $PATH for you to use them. Adding support for new languages is pretty easy, just add a shell script for it in/bin. - Dependency management:
uv/ requirements.txt for Python,nodeandbunfor TypeScript (try to usebunwhere possible). Consume random 3rd party repos in an efficient, structured way via theupdate-3rdparty-depsscript. - Code formatting / Linting: Combined into one step, check out the
format-*scripts. - Cross-platform support: macOS and Linux, any arch
.
├── bin/ # Build and setup scripts
├── mc/ # Example python source code
├── ts/ # Example typeScript source code
├── typings/ # Generated python type definitions
├── .envrc / env.sh # Environment configuration
- macOS or Linux
- Bash shell
- Git
- direnv
-
Clone the repository:
git clone https://github.com/yourusername/project-template.git cd project-template -
Set up the environment:
direnv allow setup-local
This script will:
- Install Python, Node.js, and Go
- Set up virtual environments
- Install dependencies
-
(Optional) Create a
secrets.shfile:Create a
secrets.shfile in the root directory and keep any secrets in there
-
Run Python code:
python mc/hello.py
By default this will run python formatters / typecheckers before running the script. If you want to skip this, just run
python3directly -
Run TypeScript code:
bun run ts/main.ts
-
Format code:
format
This runs all formatters and linters
-
Format code:
setup-local
This will install everything needed to run the project