diff --git a/doc/Makefile.am b/doc/Makefile.am
index 9911f313..b26d75fe 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -55,6 +55,7 @@ man1 = \
flatpak-repo.1 \
flatpak-search.1 \
flatpak-create-usb.1 \
+ flatpak-repair.1 \
$(NULL)
man5 = \
diff --git a/doc/flatpak-docs.xml.in b/doc/flatpak-docs.xml.in
index 53e27508..31e39d73 100644
--- a/doc/flatpak-docs.xml.in
+++ b/doc/flatpak-docs.xml.in
@@ -55,6 +55,7 @@
+
diff --git a/doc/flatpak-repair.xml b/doc/flatpak-repair.xml
new file mode 100644
index 00000000..e15a2e05
--- /dev/null
+++ b/doc/flatpak-repair.xml
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+ flatpak repair
+ flatpak
+
+
+
+ Developer
+ Matthew
+ Leeds
+ matthew.leeds@endlessm.com
+
+
+
+
+
+ flatpak repair
+ 1
+
+
+
+ flatpak-repair
+ Repair a flatpak installation
+
+
+
+
+ flatpak repair
+ OPTION
+
+
+
+
+ Description
+
+
+ Repair a flatpak installation by pruning and reinstalling invalid objects. The repair command does all of the following:
+
+
+
+ Scan all locally available refs, removing any that don't correspond to a deployed ref.
+
+
+ Verify each commit they point to, removing any invalid objects and noting any missing objects.
+
+
+ Remove any refs that had an invalid object, and any non-partial refs that had missing objects.
+
+
+ Prune all objects not referenced by a ref, which gets rid of any possibly invalid non-scanned objects.
+
+
+ Enumerate all deployed refs and re-install any that are not in the repo (or are partial for a non-subdir deploy).
+
+
+
+
+
+
+ Options
+
+ The following options are understood:
+
+
+
+
+
+
+
+ Show help options and exit.
+
+
+
+
+
+
+
+ Configure per-user installation.
+
+
+
+
+
+
+
+ Configure system-wide installation.
+
+
+
+
+
+
+
+ Configure the system-wide installation
+ specified by NAME among those defined in
+ /etc/flatpak/installations.d/. Using
+ --installation=default is equivalent to using
+ --system.
+
+
+
+
+
+
+
+
+ Print debug information during command processing.
+
+
+
+
+
+
+
+ Print OSTree debug information during command processing.
+
+
+
+
+
+
+ Examples
+
+
+ $ sudo flatpak repair
+
+
+
+ $ flatpak repair --user
+
+
+
+
+
+ See also
+
+
+ flatpak1,
+
+
+
+
+