reinhardt-admin-cli
Global command-line tool for Reinhardt project management.
Overview
reinhardt-admin-cli is the Django's django-admin equivalent for Reinhardt. It provides utilities for creating new projects and applications.
Installation
Install globally using cargo. While Reinhardt is on a pre-release
(-rc.* / -alpha.*), cargo install requires an explicit --version
because pre-releases are not selected by default. Once 0.1.0 stable
ships, omit --version to pull the latest stable (or keep --version
as an opt-in reproducibility pin). The literal below is auto-bumped by
release-plz on each release.
This installs the reinhardt-admin command.
Usage
Create a New Project
# Create a RESTful API project
# Create a Pages (WASM + SSR) project
# Using --template flag (equivalent)
# Create project in a specific directory
Create a New App
# Create a RESTful API app
# Create a Pages (WASM + SSR) app
# Using --template flag (equivalent)
# Create app in a specific directory
Other Commands
# Display help
# Display version
Manage Plugins
Manage Reinhardt plugins (Dentdelion):
# List installed plugins
# Show plugin information
# Install a plugin
# Remove a plugin
# Enable / disable a plugin
# Search for plugins on crates.io
# Update plugin(s)
Format All Code
Format all Rust files in the project (Rust + page! DSL):
# Format all files in the project
# Check formatting without modifying files
Format page! Macro DSL
Format page! macro DSL in your source files:
# Format all Rust files in the current directory
# Format a specific file
# Check formatting without modifying files
# Show all files (including unchanged)
Ignore Markers
You can control which page! macros should be skipped during formatting by using special comment markers:
File-Wide Ignore
Skip formatting for the entire file by adding // reinhardt-fmt: ignore-all at the beginning (within the first 50 lines, before any code):
// reinhardt-fmt: ignore-all
use *;
page! // Will not be formatted
Range Ignore
Skip formatting for multiple macros within a range using // reinhardt-fmt: off and // reinhardt-fmt: on:
// reinhardt-fmt: off
page!
page!
// reinhardt-fmt: on
page! // This will be formatted
Individual Macro Ignore
Skip formatting for a specific macro by adding // reinhardt-fmt: ignore on the line immediately before it:
// reinhardt-fmt: ignore
page!
page! // This will be formatted
Priority Order
When multiple markers are present, they are applied in this priority order:
- Individual marker (highest) -
// reinhardt-fmt: ignore - Range marker (medium) -
// reinhardt-fmt: off/on - File-wide marker (lowest) -
// reinhardt-fmt: ignore-all
Notes
- Markers are case-sensitive and spaces are optional (e.g.,
//reinhardt-fmt:ignorealso works) - Individual markers must be on the line immediately before the macro (no blank lines)
- Range markers can span multiple macros
- Nested
offmarkers will generate a warning but use the firstoffposition - Unclosed ranges (missing
on) will extend to the end of the file
Verbosity Levels
- Default: Show formatted files, errors, and summary (with color output)
-v: Also show unchanged files-vv: Show all file processing status (deprecated, same as-v)
Output Format
- Progress display: Shows current processing position in
[1/50]format - Color output:
- Success (Formatted): Green
- Error: Red
- Unchanged: Gray (dimmed)
- Progress counter: Blue
Example Output
Django Equivalents
| Django | Reinhardt |
|---|---|
django-admin startproject myproject |
reinhardt-admin startproject myproject |
django-admin startapp myapp |
reinhardt-admin startapp myapp |
Project Templates
reinhardt-admin-cli includes two project templates:
- rest: RESTful API project (use
--with-restor--template rest) - pages: WASM + SSR project with reinhardt-pages (use
--with-pagesor--template pages)
App Templates
Apps can be created in two forms:
- Module (default): Created in
apps/directory - Workspace: Separate crate in workspace
Features
- Embedded Templates: Templates are compiled into the binary using
rust-embed - No External Dependencies: Works without internet connection
- Django-Compatible: Familiar interface for Django developers
Architecture
reinhardt-admin-cli depends on reinhardt-commands for its core functionality:
reinhardt-admin-cli (CLI binary)
↓
reinhardt-commands (Library)
↓
StartProjectCommand / StartAppCommand
License
Licensed under the BSD 3-Clause License.