The command
mkdir plesty-power-meter && cd plesty-power-meter
uv run --directory /path/to/plesty-sdk plesty init device
Or, if plesty-sdk is globally installed:
mkdir plesty-power-meter && cd plesty-power-meter
plesty init device
With explicit options:
plesty --project-dir ~/projects/plesty-power-meter init device \
--name power_meter \
--author "Jane Doe" \
--email jane@example.com \
--standard quantum
plesty init infers the module name from the directory: plesty-power-meter → power_meter. The --name flag overrides this.
Generated layout
plesty-power-meter/
├── plesty/
│ └── power_meter/
│ ├── __init__.py # public exports
│ ├── __main__.py # entry point (guarded by __name__ == "__main__")
│ ├── base_device.py # BaseDeviceSyncModel subclass
│ └── device.py # thin wrapper / DocDevice for manual generation
├── assets/
│ ├── param_schema.json # parameter definitions
│ └── op_schema.json # operation definitions
├── docs/
│ ├── index.md # Gate 5 requirement
│ └── toc.yaml
├── tests/
│ ├── __init__.py
│ └── test_power_meter.py # smoke tests covering all public methods
├── CHANGELOG.md # Gate 5 requirement
├── .git/
│ └── hooks/
│ └── pre-push # runs plesty check (standard from pyproject.toml)
├── .gitlab-ci.yml # plesty-standard-ci component
├── .gitignore
├── COPYING
├── LICENSE
├── LICENSES/
│ ├── GPL-3.0-or-later.txt
│ └── LGPL-3.0-or-later.txt
├── pyproject.toml
├── README.md
└── spdx.tmpl
What init does automatically
After copying the template, plesty init:
- Formats generated files — runs
ruff formatwith the SDK config, so the scaffold already passes Gate 2 from commit zero. - Creates the initial git commit — required by
versioningitto resolve a package version from git history. - Installs the pre-push hook — writes
.git/hooks/pre-pushto runplesty checkusing the standard inpyproject.toml.
First check after scaffolding
uv sync
uv run plesty check
A freshly scaffolded project passes all quantum gates immediately. If any gate fails on a fresh scaffold, that is a bug in plesty init — report it.
pyproject.toml highlights
[project]
name = "plesty-power-meter"
dynamic = ["version"]
dependencies = ["plesty-lib>=0.2,<1"]
[dependency-groups]
dev = ["plesty-sdk", "pytest", "pytest-cov", "mypy"]
[tool.plesty]
standard = "quantum"
module_type = "device"
The module_type = "device" line activates Gate d1 — the Device API Pipeline test.