Skip to main content

belazywithreact

CI

A Python CLI that creates a React + TypeScript app with Vite and a useful starter structure. Version 0.1.0 is the initial release. npm is the supported package manager.

Prerequisites

  • Python 3.10 or newer.
  • An even-numbered Node.js release >=22.13; Node.js 24 LTS is recommended.
  • npm on PATH and internet access to download packages from the npm registry.

Check python --version, node --version, and npm --version.

Installation

Install a published release from PyPI:

python -m pip install belazywithreact
belazywithreact --help

Install from a local checkout:

python -m pip install .

For development on Windows, a virtual environment avoids global changes and does not require changing PowerShell's execution policy:

py -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\belazywithreact.exe --help

On macOS/Linux use python3 -m venv .venv, then .venv/bin/python and .venv/bin/belazywithreact instead.

Usage

belazywithreact create my-app
cd my-app
npm run dev

Creation asks for confirmation. --yes skips that question and still refuses to overwrite an existing destination, including an empty directory.

Defaults include CSS + Tailwind CSS 4, React Router, Axios, Zustand, ESLint, Prettier, and Vitest. Tailwind uses its official Vite plugin and CSS import; customize its theme in CSS. ESLint is explicitly configured for TypeScript and React. npm test runs once, and npm run test:watch starts watch mode.

A minimal CSS app:

belazywithreact create my-app --styling css --no-router --no-axios --no-zustand --no-eslint --no-prettier --no-vitest --yes
Option Default Behavior
--styling css|tailwind|both both Enables Tailwind in tailwind/both; custom starter CSS is always included
--router / --no-router enabled Home and fallback routes with BrowserRouter
--axios / --no-axios enabled Axios API client and public API base URL example
--zustand / --no-zustand enabled Example counter store
--eslint / --no-eslint enabled ESLint config, dependencies, and lint script
--prettier / --no-prettier enabled Format script and ignore file
--vitest / --no-vitest enabled Test scripts and example unit test
--package-manager npm npm Only npm is supported in 0.1.0
--yes, -y disabled Skip confirmation

Use belazywithreact create --help for all options.

Generated structure

my-app/
  src/
    assets/
    components/Button.tsx
    hooks/
    layouts/
    pages/HomePage.tsx
    services/api.ts          # when Axios is enabled
    store/useAppStore.ts     # when Zustand is enabled
    styles/index.css
    styles/tailwind.css
    types/
    utils/example.test.ts    # when Vitest is enabled
    App.tsx
    main.tsx
  .env.example
  eslint.config.js          # when ESLint is enabled
  vite.config.ts
  package.json
  package-lock.json
  README.md

The Button supports native button props and children. Customize the generated components, folders, API client, and store after creation. Empty starter folders contain .gitkeep files. The scaffold does not provide authentication, backend services, deployment, or arbitrary folder/component generation flags.

Validate your generated app:

npm ci
npm test
npm run lint
npm run build

Test and lint commands require their respective enabled options. BrowserRouter deployments need a server fallback to index.html for route URLs. All VITE_ environment variables are public browser values, never secrets.

Troubleshooting

  • Missing Node/npm or WinError 2: install Node.js 24 LTS and reopen the terminal so PATH updates. On Windows, check where.exe node and where.exe npm; npm.cmd --version should work. The CLI preserves its tested call "<resolved npm.cmd>" launch method for paths containing spaces.
  • Unsupported Node version: upgrade to an even-numbered release >=22.13. The generated tooling needs a newer Node version than some older Vite releases.
  • Invalid name: use a directory name starting with a letter or number and containing only letters, numbers, dots, underscores, or hyphens. Names cannot end in a dot, exceed 214 characters, use Windows device names like CON/LPT1, or use npm-reserved names. Path separators and shell operators are rejected. Vite normalizes uppercase directory names to valid npm package names.
  • Destination exists: choose another name; existing files are preserved.
  • npm failure or interruption: read npm's output and check network/PATH. Partial projects are preserved. Inspect them before manually removing or repairing them; a retry with the same name will refuse to overwrite them.
  • Dependency advisory: run npm audit and review compatible upgrades; do not blindly force a major upgrade.

Architecture and development

cli.py parses options with Typer and prints progress/errors with Rich. validators.py validates names, destination boundaries, and Node prerequisites. scaffold.py invokes create-vite 9.2.1, writes the starter files, installs selected tools, updates package.json, and synchronizes package-lock.json. npm output remains visible, and failures return nonzero status. Interruption during creation returns 130. The CLI never deletes a partial project automatically.

The Vite creator and optional-tool install requests specify reviewed versions; Vite's base template and npm semver ranges can still resolve newer compatible dependencies. Commit the generated lockfile and use npm ci for reproducible app installations. Revalidate dependencies before a future CLI release.

python -m pytest
python -m build
python -m twine check --strict dist/*
python scripts/check_dist.py

Unit tests mock npm and run offline. CI checks Python 3.10, 3.12, and 3.14 on Windows, macOS, and Linux, validates distributions, and builds real default and minimal React apps. See CONTRIBUTING.md for contributions, SECURITY.md for security reporting, and RELEASING.md for TestPyPI-first Trusted Publishing and explicit production-release approval. GitHub and both package-index accounts must be configured separately before publication.

License

MIT.

Metadata

Release files for belazywithreact 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 belazywithreact 0.1.0
File Size Uploaded
belazywithreact-0.1.0.tar.gz 18.9 kB Details

Built distribution (wheel)

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

Total release size: 32.2 kB

Release files / belazywithreact-0.1.0.tar.gz

Download URL belazywithreact-0.1.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bc2f6017eca40374ddf92c3449c18092035466ef89bb1580d800ef365c27cbe4
BLAKE2b-256 checksum
How to use checksums
9bfd6bcfd46f606dd5fd0f815927b0058ea383d01b04ea0ca3b0d31e08c740bb
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 Oct 14, 2026.

Transparency log

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

Download URL belazywithreact-0.1.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d809f597cf7ce2bd28f22cffa405e71bdf64d54cb13b19538552ca9f30cde34
BLAKE2b-256 checksum
How to use checksums
d7ccbc3250720f8ed055a2656a29c9dc59bc63827c3417fe39400337d666056f
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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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