Command reference
Every riskwren command. This page is written from the program itself, so it always matches
the version it ships with. Run commands with uv run riskwren … from the project directory.
Options that come before the command apply to all of them:
riskwren [-h] [--version] [-c FILE] [-v | -q] COMMAND ...Commands#
| Command | What it does |
|---|---|
riskwren init | Set up a new installation |
riskwren serve | Run the web server |
riskwren demo | Build a fictional organization to explore |
riskwren db | Look after the database schema |
riskwren users | Manage accounts from the command line |
riskwren verify | Check that the history has not been altered |
riskwren check-dossier | Check that a dossier is whole and unchanged |
riskwren frameworks | See and load what the organization is held to |
riskwren program | Move the program between installations |
riskwren backup | Back the whole installation up to one file |
riskwren restore | Restore a backup into an empty database |
riskwren tools | Serve tools to an assistant, over standard input and output |
riskwren doctor | Check that this installation is healthy |
riskwren jobs | See scheduled work, or run it now |
riskwren mail | Send waiting email, or test the mail settings |
riskwren 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.
| Option | Meaning |
|---|---|
--force | overwrite an existing configuration file |
--admin-email EMAIL | create the first administrator with this address |
--admin-name NAME | the first administrator's name |
--password-stdin | read the password from standard input instead of asking |
--program KIND | the program to start from: research-institute (the default), academic-medical-center, university, or nonprofit |
riskwren serve#
Run RiskWren's web server. It refuses to start on a database whose schema is behind; run riskwren db upgrade first.
| Option | Meaning |
|---|---|
--host | address to listen on (default: from the configuration) |
--port PORT | port to listen on (default: from the configuration) |
--workers WORKERS | server processes (default: from the configuration) |
--reload | restart when the code changes (development) |
--demo-on-network | let a demo organization listen beyond this machine (anyone who reaches it can sign in as its sample people) |
riskwren demo#
Build the Northmere Institute for Health Research, a fictional organization with two years 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.
| Option | Meaning |
|---|---|
PATH | where to build it (default: ./demo) |
--seed SEED | a different number gives a different Northmere |
--port PORT | the port its server will use (default: 8020) |
--force | rebuild a demo that is already there |
riskwren db#
Look after the database schema.
riskwren db upgrade#
Apply any migrations the database has not had, and add what is new in the default program and the starter libraries without changing what is there. Back up first, with riskwren backup: an upgrade cannot be undone except by restoring.
riskwren db current#
Show which migration the database is at, and which this version expects. Exits with 1 when they differ.
riskwren 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.
riskwren users add#
Add an account. It asks for a password unless --password-stdin or --invite is given.
| Option | Meaning |
|---|---|
EMAIL | the email address the person signs in with |
--name | the person's name |
--title | their job title |
--role ROLE | a role: admin, manager, assessor, auditor, steward=unit:CODE, or leader=unit:CODE,limit:RATING; manager and assessor may also take unit:CODE (may be repeated) |
--unit CODE | a unit they work in, by code (may be repeated) |
--password-stdin | read the password from standard input instead of asking |
--invite | add 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 |
riskwren users list#
List every account with its status and roles.
riskwren users disable#
Stop an account signing in and end its sessions. Its history is kept, and what the person alone answered for passes to the steward of its unit until someone is named for good. The last active administrator cannot be disabled.
| Option | Meaning |
|---|---|
EMAIL | the account's email address |
riskwren users enable#
Let a disabled account sign in again.
| Option | Meaning |
|---|---|
EMAIL | the account's email address |
riskwren users reset-password#
Give an account a new password and end its sessions.
| Option | Meaning |
|---|---|
EMAIL | the account's email address |
--password-stdin | read the password from standard input instead of asking |
riskwren users roles#
Show an account's roles, or with --set replace the roles granted in RiskWren. Roles mapped from an identity provider are left alone. The last active administrator cannot lose that role.
| Option | Meaning |
|---|---|
EMAIL | the account's email address |
--set ROLE | a role: admin, manager, assessor, auditor, steward=unit:CODE, or leader=unit:CODE,limit:RATING; manager and assessor may also take unit:CODE (may be repeated); with none, removes every role |
riskwren verify#
Recompute the hash chain over every event in the history and report the first one that does not hold, then check every published version of a document, and every leadership report, against the fingerprint the history took when it was published or issued. Exits with 1 if any does not hold.
riskwren check-dossier#
Check a dossier taken from RiskWren: every file its manifest lists is there with the size and SHA-256 it lists, nothing else is, and the manifest's fingerprint is its own. Needs no database. Exits with 1 if it does not hold.
| Option | Meaning |
|---|---|
FILE | the dossier's ZIP file |
riskwren frameworks#
A framework is a source of requirements: a public standard, a regulation, an agreement's terms. Four public ones ship with RiskWren and are loaded at installation. Others are loaded from a pack file, or entered in the app.
riskwren frameworks list#
List every framework.
riskwren frameworks load#
Load a framework from a pack file, or the built-in ones that are missing. A pack is checked whole first and refused whole if anything is wrong.
| Option | Meaning |
|---|---|
FILE | the pack to load, or the key of one that ships to be loaded on request, such as hipaa-breach, nist-privacy, nist-800-53-r4, or iso-27001 |
--builtin | load the built-in frameworks not yet here, and the publishers' mappings for those that are |
--dry-run | check the pack, and load nothing |
riskwren frameworks show#
Show a framework's publisher, version, license, and source.
| Option | Meaning |
|---|---|
KEY | the framework's key, such as nist-csf |
riskwren frameworks text#
For a framework that ships as its codes alone, such as iso-27001, load the titles and text from a copy your organization holds a license to: a CSV file with the columns code, title, and text. The words stay in this installation and in its backups; no pack or export carries them. A row with an empty title and text takes that requirement's words away.
| Option | Meaning |
|---|---|
KEY | the framework's key, such as iso-27001 |
FILE | the CSV file of code, title, and text |
riskwren program#
The program is everything a risk and compliance team configures: vocabularies, the risk categories and their appetite, the scoring method, cadences, and who may accept what. It lives in the database and moves as one file.
riskwren program export#
Write the whole program as one JSON document, to a file or to standard output.
| Option | Meaning |
|---|---|
--output, -o FILE | write to this file |
riskwren program import#
Load a program pack. The whole pack is checked first, and nothing is loaded unless all of it can be. A new scoring method is published as a new version; assessments already made keep the version they were made under, and every open risk is read again from what was loaded: its ratings, its standing, and its next review.
| Option | Meaning |
|---|---|
FILE | the pack to load, or the name of a starter program: research-institute, academic-medical-center, university, or nonprofit |
--dry-run | say what would change, and change nothing |
riskwren backup#
Write every table, every stored file, and a manifest of their fingerprints to one file, as of one moment, while the server goes on running. The file restores into SQLite or PostgreSQL. Keep it somewhere safe: it holds everything.
| Option | Meaning |
|---|---|
FILE | the file to write, which must not exist |
riskwren restore#
Load a backup into an empty database and data home, then check every table, every file, and the history against it. To move between SQLite and PostgreSQL, back up from one and restore into the other. Use the same version of RiskWren that took the backup, then upgrade.
| Option | Meaning |
|---|---|
FILE | the backup to restore |
--describe | only say what the backup holds |
riskwren tools#
A Model Context Protocol server for an assistant on this computer. Each tool calls a RiskWren server's API with the token in RISKWREN_TOKEN, so the assistant sees only what the token may. The tools read, and draft risks, issues, and controls that a person then opens, changes, and saves in RiskWren.
| Option | Meaning |
|---|---|
--url | the RiskWren server's address (or RISKWREN_URL) |
--no-drafts | offer only the tools that read |
riskwren doctor#
Check the configuration, the data home, the database and its schema, the history, single sign-on and email where they are set up, and scheduled work. Exits with 1 if anything must be fixed.
| Option | Meaning |
|---|---|
--production | also check what matters before real people rely on it: the https address, the database, a recent backup, a second administrator, email, and that it is not a demo |
riskwren jobs#
Scheduled work brings risks up to date with the calendar, sends reminders, sends email where that is set up, tells webhooks what has happened, takes the daily snapshot of the measures, and tidies RiskWren's own bookkeeping. The server does this by itself while it runs. These commands are for seeing how it is going, and for running it from a scheduled task where the server's own scheduler is turned off.
riskwren jobs run#
Run every job that is due and not paused. With a job's key (calendar, reminders, mail, webhooks, measures, tidy), run that one now whether or not it is due or paused. A job another process is running is left to it.
| Option | Meaning |
|---|---|
JOB | one job to run now: calendar, reminders, mail, webhooks, measures, tidy |
riskwren mail#
Email is optional. Where it is set up, the server sends it by itself while it runs. These commands are for testing the settings and for sending by hand.
riskwren mail run#
Queue notices and daily summaries, and send what is waiting. Exits with 1 if a message could not be sent.
riskwren mail test#
Send one message now to the account with this address, and say whether the mail server accepted it.
| Option | Meaning |
|---|---|
EMAIL | the account to send it to |