Management Commands
All administrative tasks are performed through the pw command.
Database
pw db syncCreate the database schema on a fresh database, or apply pending migrations on an existing one.
pw db exportExport data from a Django 3.2 patchwork database as SQL statements. This is used during migration from the Python version to the Go version. The output is written to stdout.
pw db importImport SQL data from stdin into the current database. Used to load data previously exported with
pw db exportinto a fresh 4.0 database.
User Management
pw admin user listList all users.
pw admin user createCreate a new user. Prompts for a password interactively.
Options:
-u,--username– Username-e,--email– Email address--admin– Grant admin privileges
pw admin user delete <username>Delete a user. Use
-fto skip confirmation.pw admin user passwd <username>Change a user’s password interactively.
Project Management
pw admin project listList all projects.
pw admin project show <linkname>Show full details for a project.
pw admin project createCreate a new project.
Required options:
-n,--name– Display name-l,--linkname– URL-safe identifier-i,--list-id– Mailing list ID-e,--list-email– Mailing list email address
Optional:
--web-url,--scm-url,--webscm-url,--list-archive-url,--subject-match,--commit-url-formatpw admin project update <linkname>Update an existing project’s fields.
pw admin project delete <linkname>Delete a project. Use
-fto skip confirmation.
Maintainers and Delegation
pw admin maintainer list <project>List maintainers for a project.
pw admin maintainer add <project> <username>Add a maintainer to a project.
pw admin maintainer remove <project> <username>Remove a maintainer from a project.
pw admin delegate-rule list <project>List autodelegation rules for a project.
pw admin delegate-rule createCreate a delegation rule with
--project,--user,--path, and--priority.pw admin delegate-rule delete <id>Delete a delegation rule. Use
-fto skip confirmation.
Garbage Collection
pw admin gcClean up expired sessions, stale email confirmations, and inactive users with no pending confirmation. Run this periodically via cron or a systemd timer.
Email Ingress
pw ingressStart the SMTP daemon for receiving emails (long-running service).
pw ingress --stdinRead a single email from stdin and process it.
pw ingress --mboxRead all emails in mbox format from stdin.
pw ingress --list-id <id>Override the List-ID header value.
Configuration
pw configPrint a default, annotated configuration file to stdout.
HTTP Server
pw httpStart the HTTP server exposing the web interface and REST API.