GovWrenv0.10.0
GitHub

Command reference

Every govwren command. This page is written from the program itself, so it always matches the version it ships with. Run commands with uv run govwren … from the project directory.

Options that come before the command apply to all of them:

govwren [-h] [--version] [-c FILE] [-v | -q] COMMAND ...

Commands#

CommandWhat it does
govwren initSet up a new installation
govwren serveRun the web server
govwren demoBuild a fictional organization to explore
govwren dbLook after the database schema
govwren usersManage accounts from the command line
govwren jobsList scheduled work, or run what is due
govwren mailSend waiting email, or test the mail settings
govwren programExport or load the governance program as a file
govwren dossierMake or check the complete package for one record
govwren registerPublish the transparency register
govwren backupWrite the whole installation to one file
govwren restoreLoad a backup into an empty installation
govwren toolsLet an AI assistant read GovWren and draft requests
govwren verifyCheck that the history has not been altered
govwren doctorCheck that this installation is healthy

govwren init#

Write a configuration file if there is none, create the data home, create or upgrade the database, and create the first administrator if there is none. Safe to run again.

OptionMeaning
--forceoverwrite an existing configuration file
--admin-email EMAILcreate the first administrator with this address
--admin-name NAMEthe first administrator's name
--password-stdinread the password from standard input instead of asking
--program STARTERbegin from a starter program, such as starter-university (see: govwren program packs)

govwren serve#

Run GovWren's web server. It refuses to start on a database whose schema is behind; run govwren db upgrade first.

OptionMeaning
--hostaddress to listen on (default: from the configuration)
--port PORTport to listen on (default: from the configuration)
--workers WORKERSserver processes (default: from the configuration)
--reloadrestart when the code changes (development)
--demo-on-networklet a demo organization listen beyond this machine (anyone who reaches it can sign in as its sample people)

govwren demo#

Build the Alderpoint Institute for Medical Research, a fictional organization with thirty months of history, in its own directory. Everything in it is made by the same code the app uses. Start it with the command it prints.

OptionMeaning
PATHwhere to build it (default: ./demo)
--seed SEEDa different number gives a different Alderpoint
--port PORTthe port its server will use (default: 8010)
--forcerebuild a demo that is already there

govwren db#

Look after the database schema.

govwren db upgrade#

Apply any migrations the database has not had. Export first: an upgrade cannot be undone except by restoring.

govwren db current#

Show which migration the database is at, and which this version expects. Exits with 1 when they differ.

govwren users#

Manage accounts from the command line: for setting up, and for getting back in when nobody can sign in. Everyday account management is in the app, under Admin. Changes made here are recorded in the history as made at the command line.

govwren users add#

Add an account. It asks for a password unless --password-stdin or --invite is given.

OptionMeaning
EMAILthe email address the person signs in with
--namethe person's name
--titletheir job title
--role ROLEa role: admin, governance, auditor, reviewer, reviewer=function:KEY, or steward=unit:CODE (may be repeated)
--unit CODEa unit they work in, by code (may be repeated)
--password-stdinread the password from standard input instead of asking
--inviteadd them without a password: they can be named on records now, and sign in once they are given a password or use single sign-on

govwren users list#

List every account with its status and roles.

govwren users disable#

Stop an account signing in and end its sessions. Its records and history are kept. The last active administrator cannot be disabled.

OptionMeaning
EMAILthe account's email address

govwren users enable#

Let a disabled account sign in again.

OptionMeaning
EMAILthe account's email address

govwren users reset-password#

Give an account a new password and end its sessions.

OptionMeaning
EMAILthe account's email address
--password-stdinread the password from standard input instead of asking

govwren users roles#

Show an account's roles, or with --set replace the roles granted in GovWren. Roles mapped from an identity provider are left alone. The last active administrator cannot lose that role.

OptionMeaning
EMAILthe account's email address
--set ROLEa role: admin, governance, auditor, reviewer, reviewer=function:KEY, or steward=unit:CODE (may be repeated); with none, removes every role

govwren jobs#

GovWren does some work by itself: it opens periodic reviews, marks approvals that have run out, sends reminders, and sends email. The server does this while it runs. With no command, this lists each job and when it is next due.

govwren jobs run#

Run every job that is due, once, and exit. Give a job's name to run that one now whether or not it is due. Safe to run while the server is up: a job is never run by two processes at once. Exits with 1 if a job failed.

OptionMeaning
JOBthe job to run now

govwren mail#

The server sends email by itself while it runs. These commands are for testing the settings, and for sending what is waiting when the server is not running.

govwren mail run#

Turn waiting notices into messages, put together daily summaries if it is time, and send what is in the outbox. Exits with 1 if anything could not be sent.

govwren mail test#

Send one message now, to the address of an existing account, and say whether the mail server accepted it.

OptionMeaning
EMAILthe account to send it to

govwren program#

The governance program (forms, the scoring model, and vocabularies) can be written out as one file, kept under version control, reviewed, and loaded into another installation.

govwren program export#

Write the published forms, the scoring model, and every vocabulary as one program pack.

OptionMeaning
--out FILEwrite to this file instead of the screen

govwren program import#

Load a program pack. The whole file is checked first, and nothing is loaded if anything is wrong. What differs from the published program becomes a new version; earlier versions are kept, so past requests still show the form they were answered on.

OptionMeaning
FILEthe pack to load: a file, or the name of one that comes with GovWren
--checkcheck the file and change nothing

govwren program packs#

List the starter programs and content packs that come with GovWren. Load one by name with govwren program import.

govwren dossier#

A dossier is everything the record holds about one thing, as a zip with a manifest that lists each file with its SHA-256.

govwren dossier make#

Write the dossier of one record as a zip: the record as data and as a page to print, its evidence files, and a manifest.

OptionMeaning
REFthe record's reference, such as UC-0042
--out FILEwhere to write it (default: REF-dossier.zip)

govwren dossier verify#

Recompute the SHA-256 of every file in a dossier and compare it with the manifest. Exits with 1 if a file was altered, added, or removed. Needs no installation unless --history is given.

OptionMeaning
FILEthe dossier, a zip
--historyalso check that the event the manifest names is in this installation's history

govwren register#

The transparency register is the set of approved uses governance has chosen to publish, as plain pages for any web server.

govwren register build#

Write an index, a page for each use on the register whose approval is in force, and a stylesheet. Pages for uses no longer on the register are removed. Run it on a schedule to keep a published copy current.

OptionMeaning
--out DIRwhere to write the pages

govwren backup#

Write every table, every evidence and brand file, and a manifest to one gzipped tar. It can be made while the server is running. The file does not depend on the kind of database, so it restores into SQLite or PostgreSQL. It holds everything in the installation: keep it as carefully as the database itself.

OptionMeaning
--out FILEwhere to write it (default: govwren-backup-DATE.tar.gz)

govwren restore#

Load a backup into the configured database and data home. The database must hold no accounts and no history: nothing is ever overwritten. The history is verified once it is loaded. To move between SQLite and PostgreSQL, back up, point the configuration at the new database, and restore.

OptionMeaning
FILEthe backup, a .tar.gz written by govwren backup

govwren tools#

An optional tool server for AI assistants, speaking the Model Context Protocol. It is not needed to run GovWren.

govwren tools serve#

Serve GovWren's tools to an AI assistant over standard input and output. An assistant's host program starts this command; it is not run by hand. It calls the GovWren at GOVWREN_URL with the API token in GOVWREN_TOKEN, and so sees and does only what that token's account can. It reads records and drafts requests. It cannot submit, decide, or change anything.

govwren verify#

Recompute the hash chain over every event in the history and report the first one that does not hold. Exits with 1 if the history is broken.

govwren doctor#

Check the configuration, the data home, the database and its schema, and the history. Exits with 1 if anything must be fixed.

OptionMeaning
--productionalso check what matters once people depend on it: https, backups, a second administrator, single sign-on, email, and scheduled work
Describes GovWren 0.10.0. Apache License 2.0. Screenshots show an invented organization; every person and record in them is fictional.