RPR CLI -- React Python Rust monorepo scaffolding orchestrator
Project description
RPR CLI
React Python Rust monorepo scaffolding orchestrator.
Installation
Published package name: rpr-cli
Once published to PyPI, install by name with either:
uv add rpr-cli
uv tool install rpr-cli
Both install the rpr command.
For development, editable install is fine:
uv tool install -e .
For an actual distributable install you can use in other projects, build the wheel first and install the built artifact:
uv build
uv tool install dist/rpr_cli-*.whl
From another local project you can also install the built artifact directly:
uv add ../project-getting-started/dist/rpr_cli-*.whl
Usage
🚀 Scaffolding & Generation
Create a new NX + UV monorepo, then add apps and packages as needed.
NX monorepo uses integrated mode.
rpr init my-app # Create/init my-app with root NX + UV tooling and AI instructions
cd my-app
rpr generate domain my-app # Add a Python domain package
rpr generate api my-app # Add a FastAPI application
rpr generate ui my-app # Add a React UI library and web app
rpr generate engine my-app # Add a Rust/PyO3 computation engine
rpr generate storybook # Add Storybook for UI component development
rpr init <project-name> creates the project directory when it does not exist. If the directory already exists and is not an NX workspace, RPR initializes Git and runs nx init inside that directory.
By default, rpr init scaffolds the root workspace and AI instructions only. To create project components during initialization, repeat --scaffold or pass a comma-separated list:
rpr init todo-list --scaffold common
rpr init todo-list --scaffold domain
rpr init todo-list --scaffold api --domain-migrations
rpr init todo-list --scaffold api --scaffold web --domain-migrations
Available scaffolds are:
common: Alias forinstructions,domain,api,ui,web, andstorybook; excludesengine.instructions: AI instruction files for Cursor, Copilot, Claude Code, and Gemini.domain: Python DDD package atpackages/python/domain.api: FastAPI app atapps/<name>-api; also scaffoldsdomain.ui: React UI library atpackages/node/<name>-ui.web: React web app atapps/<name>-web; also scaffoldsui.storybook: Storybook host package; requires or scaffoldsui.engine: Rust/PyO3 package atpackages/python/<name>-engine.
Dependency Placement
RPR keeps dependencies close to the package that uses them.
- Root Python tooling such as Ruff, pytest, pyright, pre-commit, and maturin lives in the root
pyproject.toml. - Domain runtime dependencies such as
sqlmodel,asyncpg,pydantic-settings, and optionalalembicare added topackages/python/domain/pyproject.toml. - API runtime dependencies such as
fastapi,uvicorn, and the workspace domain package are added toapps/<name>-api/pyproject.toml. - Node dependencies are written to the relevant package-level
package.jsonfiles, andnpm installruns from the root workspace.
Python dependency changes are made with uv so they are tracked in pyproject.toml. Node dependency changes are made through npm workspace package metadata and root npm install.
Update project-owned package manifests from upstream registries with rpr update node or rpr update python. Node updates target package.json; Python updates target pyproject.toml by default and fall back to requirements.txt when no pyproject.toml exists. Use --file to update a nested manifest, --dry-run to preview without changing files or running installers, and --include-major to opt into major-version updates.
The scaffold version manifest that powers generated dependency specs and the synced AI tech-stack overview lives in src/rpr/dependency_manifest_data.py. Refresh it from upstream registries with rpr refresh manifest when you want the repo-owned defaults to move forward.
🧠 AI Instructions & Code Templates
Sync project context to your favorite AI tools and add common code patterns.
rpr sync rules # Sync AI instructions to Cursor, Copilot, Claude Code, and Gemini
rpr add template python mapper_util # Add a Python code template to your project
rpr add template python camel_case_model
rpr add template node sticky_navigation --include-tests
rpr add template node -l # List available Node/TSX templates
rpr add template --list # List all available code templates
Use --output-dir to write generated files to a different directory while keeping the template filenames. Templates with test companions can use --include-tests; Node browser-test templates print the extra npm dev dependencies and any Playwright setup notes they need. Existing config files such as vitest.config.ts are not merged automatically; RPR leaves them unchanged unless you rerun with --force to replace them.
💬 Interactive Shell
rpr chat is the primary interactive shell for the product. It runs a Rich-based session with slash commands for both chat controls and existing CLI workflows.
rpr chat # Start the interactive shell
rpr chat --approval-mode auto-readonly # Override the session approval mode
Inside the shell:
/help List supported slash commands
/settings Inspect and update persisted settings in-shell
/init Run workspace bootstrap from chat
/generate Run scaffolding commands from chat
/sync Sync AI instructions from chat
/add Add a registered template from chat
/check Run workspace health checks from chat
/map Generate a code map from chat
/exit End the session
There is no separate --tui mode. The unified shell is the default chat experience.
🛠️ Maintenance & Insights
Keep your project healthy and explore its structure.
rpr refresh manifest # Refresh the scaffold dependency manifest from npm, PyPI, and crates.io
rpr update node # Update package.json dependencies and run npm install
rpr update python # Update pyproject.toml or requirements.txt and sync Python dependencies
rpr check # Inspect project health and report setup status
rpr map # Generate a structured code map of your project
rpr settings # Inspect persisted shell settings
rpr settings set theme ocean # Update the terminal theme
rpr settings set approval_mode auto-all
rpr settings set startup_help false
Persisted settings currently include:
theme: Rich console themeapproval_mode: default chat approval mode (ask,auto-readonly,auto-all)startup_help: whether chat shows slash-command guidance on startup
rpr refresh manifest is a repo-maintenance command. It rewrites src/rpr/dependency_manifest_data.py, which feeds scaffold dependency versions in rpr generate ... and the versioned overview text produced by rpr sync rules. Use --dry-run to preview the manifest rewrite without writing the file.
rpr update node and rpr update python are project-maintenance commands. They update the selected package manifest, print applied and held-back dependency changes, and run the matching installer only when live changes are written. Without --include-major, RPR chooses the latest stable version inside the current major version and reports higher-major candidates as held back. Python updates cover [project].dependencies, [dependency-groups].*, and requirements.txt; build backend packages in [build-system].requires are left unchanged unless a future explicit build-system update option is added.
⚙️ Common Flags
Most commands support these global flags:
--dry-run: Preview changes without writing any files.--help: Show detailed help for any command or subcommand.
Example:
rpr init my-app --scaffold domain --dry-run
rpr generate api my-app --dry-run
Dry runs print the commands RPR would execute, the files/directories it would create or update, and the package dependencies it would add with their target scope.
The check command also supports:
--json: Output machine-readable JSON for CI/CD integration.
The chat command also supports:
--provider: Override the AI provider. The mock provider is the only supported provider today.--model: Override the active model name.--approval-mode: Override the session approval mode without changing persisted settings.
Project Development
Setup
# Install Python dependencies
uv sync
# Build the Rust extension (rpr_parser) — required for rpr map acceleration
cd rpr-parser && uv run maturin develop && cd ..
Note:
uv tool install dist/rpr-*.whluses the root hatchling build backend and does not build the Rust extension. You must runmaturin developseparately before usingrpr mapwith the Rust backend. Without it,rpr mapfalls back to the pure-Python implementation automatically.
Running Tests
# Full test suite (Python)
uv run pytest
# Single test file
uv run pytest tests/test_map_extractor.py
# Single test
uv run pytest tests/test_map_extractor.py::test_fallback_returns_correct_shape
# Rust unit tests (rpr_parser crate)
cd rpr-parser && cargo test && cd ..
# Lint and format
uv run ruff check .
uv run ruff format .
The Rust-path tests in tests/test_map_extractor.py are automatically skipped if the Rust
extension hasn't been built yet — run maturin develop first to enable them.
Publishing To PyPI
This repo is set up to publish the package rpr-cli to PyPI from GitHub Actions.
One-time setup:
- Create the PyPI project
rpr-cli. - Create a PyPI Trusted Publisher for this repository using workflow
.github/workflows/publish-pypi.ymland environmentpypi.
No PYPI_API_TOKEN secret is required when publishing through GitHub Actions OIDC.
Release flow:
# update src/rpr/__init__.py with the new version
git commit -am "Release 0.1.2"
git tag v0.1.2
git push origin main --tags
The workflow in .github/workflows/publish-pypi.yml builds the sdist and wheel, checks that the tag matches the package version, and uploads dist/* to PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rpr_cli-0.2.1.tar.gz.
File metadata
- Download URL: rpr_cli-0.2.1.tar.gz
- Upload date:
- Size: 416.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca0da97f8045eeb97f3315dc16d4cadcf12f1b040f7b10197ad3e366c6b3d4a9
|
|
| MD5 |
9455679a00dcbb7217f04628d853df07
|
|
| BLAKE2b-256 |
62ba12c882c9787d59d826365dba3450a54f859e79ec00e18b17c1603f458d85
|
Provenance
The following attestation bundles were made for rpr_cli-0.2.1.tar.gz:
Publisher:
publish-pypi.yml on harlenalvarez/project-getting-started
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rpr_cli-0.2.1.tar.gz -
Subject digest:
ca0da97f8045eeb97f3315dc16d4cadcf12f1b040f7b10197ad3e366c6b3d4a9 - Sigstore transparency entry: 2130391742
- Sigstore integration time:
-
Permalink:
harlenalvarez/project-getting-started@10293b971a81855d05879370ca130d3ddfe115d6 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/harlenalvarez
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@10293b971a81855d05879370ca130d3ddfe115d6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rpr_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: rpr_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 258.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73d278f0c15f7ee36c4cb255926713044d0d8f4a3bc794d4a0f5670ec38b16ef
|
|
| MD5 |
9798ee7037c94dac4f1fbe64804ea5de
|
|
| BLAKE2b-256 |
b7c04523895d60afe80929a55b51b8e4f3d2a1d543955c9c3fdce94eb7aae065
|
Provenance
The following attestation bundles were made for rpr_cli-0.2.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on harlenalvarez/project-getting-started
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rpr_cli-0.2.1-py3-none-any.whl -
Subject digest:
73d278f0c15f7ee36c4cb255926713044d0d8f4a3bc794d4a0f5670ec38b16ef - Sigstore transparency entry: 2130391862
- Sigstore integration time:
-
Permalink:
harlenalvarez/project-getting-started@10293b971a81855d05879370ca130d3ddfe115d6 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/harlenalvarez
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@10293b971a81855d05879370ca130d3ddfe115d6 -
Trigger Event:
push
-
Statement type: