Installation
From repository (editable)
Install directly from the repository so changes are picked up automatically.
pip install -e .
Verify installation
Use the built-in version and help commands to confirm the CLI is available.
unitforge --version
unitforge --help
Common Commands
Validate
Validate an existing systemd unit file. Add -v for verbose
details and -w to include warnings.
unitforge validate /etc/systemd/system/myapp.service -v -w
Create
Create a new unit file from scratch with helpful flags and validation.
unitforge create \
--type service \
--name myapp \
--exec-start "/usr/bin/myapp" \
--restart on-failure \
--output myapp.service \
--validate-output
Templates
Explore and generate units from curated templates.
# List templates
unitforge template list
# Show details
unitforge template show webapp
# Generate (non-interactive)
unitforge template generate webapp \
--param name=mywebapp \
--param exec_start="/usr/bin/node server.js" \
--param user=www-data \
--param working_directory=/opt/mywebapp \
--validate-output
# Generate (interactive)
unitforge template generate webapp --interactive
Info
Extract metadata and section/key counts from a unit file.
unitforge info myapp.service
Edit
Modify values in an existing unit file by setting or removing keys.
unitforge edit source.service dest.service \
--set Service.ExecStart=/usr/bin/myapp \
--set Unit.Description="My Service" \
--remove Service.Environment \
--validate-output
Tips
-
Use
--validate-outputafter generation or editing to catch issues early. -
Prefer interactive template generation (
--interactive) to fill required fields smoothly. - The CLI is part of the backend package. See the repository for the backend/CLI source: {{ github_url }}