{{ app_name }} CLI

A powerful command-line interface to create, validate, and manage systemd unit files. The CLI ships with the backend sub-project and uses the same reliable core as the web app.

Quick Start
CLI
# From the repository root
pip install -e .

# Show help
unitforge --help

# Validate a unit file
unitforge validate /etc/systemd/system/myapp.service -v -w

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