Skip to content

Add a generated omarchy(1) man page - #8064

Open
aleksejunas wants to merge 2 commits into
omacom:quattrofrom
aleksejunas:man-page
Open

Add a generated omarchy(1) man page#8064
aleksejunas wants to merge 2 commits into
omacom:quattrofrom
aleksejunas:man-page

Conversation

@aleksejunas

@aleksejunas aleksejunas commented Aug 24, 2026

Copy link
Copy Markdown

PR mot basecamp/omarchy (branch: man-page)

Tittel

Add a generated omarchy(1) man page

Beskrivelse

Adds omarchy(1), generated from omarchy commands --all --json rather than
hand-written.

  • tools/man-gen/ — a small Go program that reads the JSON omarchy commands --all --json already produces and emits groff markup.
  • bin/omarchy-dev-generate-manpage — wires it up as omarchy dev generate-manpage.
  • man/man1/omarchy.1 — the generated output, checked in so it's reviewable
    as a diff. Not hand-written — don't hand-edit it. Regenerate with
    omarchy dev generate-manpage instead; tools/man-gen/README.md has the
    details.

Verified with groff -man -ww -z (zero warnings) and man ./man/man1/omarchy.1.

One caveat I want to be upfront about

The per-group section headings (.SS in the page, e.g. "theme - Theme
management") come from a hand-maintained copy of GROUP_DESCRIPTIONS in
bin/omarchy, because omarchy commands --json doesn't carry group-level
metadata — only each command's own group key. I reconciled the copy against
today's bin/omarchy before opening this, but nothing keeps the two in sync
automatically going forward. A group that's renamed or added later will
silently fall back to a generic "<Group> commands" heading here until
someone updates tools/man-gen/main.go to match. Happy to add a test/cli
check that fails when the two drift, if that's useful — didn't want to add
it speculatively without knowing if you'd want it.

What this doesn't do

  • Doesn't install anywhere yet. Packaging lives in the separate
    omacom-io/omarchy-pkgs repo, not here. I've opened a companion PR there
    that installs this file to /usr/share/man/man1/ — see
    Install the omarchy(1) man page omarchy-pkgs#200.
  • Doesn't regenerate itself automatically. Nothing currently re-runs the
    generator when commands change; man/man1/omarchy.1 is a snapshot as of
    this commit. Two ways to close that gap that I did not implement, in
    case they're useful:
    • A test/cli check that regenerates and diffs against the committed
      file, failing CI-adjacent review if they've drifted.
    • Generating it at package-build time in omarchy-pkgs's PKGBUILD instead
      of committing a static file at all (would need go as a makedepends
      and a build() step there — a bigger change to a production release
      pipeline, so I left it as a suggestion rather than code).

tools/man-gen is a small Go program that reads `omarchy commands --all --json`
and emits a groff man page. omarchy-dev-generate-manpage wires it up as
`omarchy dev generate-manpage`.

man/man1/omarchy.1 is the generated output, checked in so it can be reviewed
as a diff — it is not hand-written and should not be hand-edited; regenerate
it instead. Verified with `groff -man -ww -z` (zero warnings) and `man`.

Per-group descriptions in the generator are a hand-maintained copy of
GROUP_DESCRIPTIONS in bin/omarchy, since the JSON carries no group-level
metadata. They need to be kept in sync manually when groups change there;
this pass reconciled them against the current bin/omarchy (dropped stale
groups, added missing ones). tools/man-gen/README.md documents this.

Packaging the file to /usr/share/man/man1/ is a PKGBUILD change in the
separate omarchy-pkgs repo and isn't included here.
Copilot AI balanced review requested due to automatic review settings August 24, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a generated omarchy(1) manual page based on CLI command metadata.

Changes:

  • Adds the Go man-page generator and documentation.
  • Adds a developer regeneration command.
  • Checks in the generated man page.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/man-gen/main.go Generates groff markup from command JSON.
tools/man-gen/README.md Documents regeneration and verification.
tools/man-gen/go.mod Defines the generator’s Go module.
tools/man-gen/.gitignore Ignores generator binaries.
bin/omarchy-dev-generate-manpage Adds the regeneration command.
man/man1/omarchy.1 Provides the generated manual page.
Suppressed comments (1)

tools/man-gen/README.md:22

  • AGENTS.md:22-24 requires Markdown prose to use full lines rather than hard wrapping. Keep this paragraph on one line.
`omarchy commands --json` has no group-level metadata (a command's JSON only
carries its own group key), so the per-group one-line descriptions used in
the `.SS` headings are a hand-maintained copy of `GROUP_DESCRIPTIONS` in
`bin/omarchy`. When you add, rename, or remove a group there, update
`groupDescriptions` in `main.go` to match — nothing enforces this

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/man-gen/main.go Outdated
}
if len(notes) > 0 {
fmt.Fprintln(w, ".br")
fmt.Fprintln(w, escText(strings.Join(notes, " ")))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, fixed in 227c5f4 — dropped the redundant escText pass over already-escaped notes.

Comment thread tools/man-gen/main.go Outdated
Comment on lines +129 to +133
if (r >= 0xE000 && r <= 0xF8FF) || // BMP PUA
(r >= 0xF0000 && r <= 0xFFFFD) || // Supplementary PUA-A
(r >= 0x100000 && r <= 0x10FFFD) { // Supplementary PUA-B
continue
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, fixed in 227c5f4stripPUA now replaces a run of PUA runes with a <icon> placeholder instead of dropping them, so the example stays syntactically complete.

Comment thread tools/man-gen/README.md Outdated
## Regenerating

```
omarchy commands --all --json | go run ./tools/man-gen -version "$(cat version)" -out man/man1/omarchy.1

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed (reproduced the cannot find main module error locally), fixed in 227c5f4 — README now uses the same cd-into-the-module invocation as the wrapper script.

Comment thread tools/man-gen/README.md Outdated
Comment on lines +5 to +6
The output is generated, not hand-written — don't edit `man/man1/omarchy.1`
directly, edit this generator instead and regenerate.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 227c5f4 — un-wrapped both paragraphs.

- escAliases already emits groff-escaped text (\- for hyphens); joining it
  into `notes` and running the whole thing through escText again turned
  those into \e-, rendering as a literal backslash in the output (e.g.
  "theme\-switcher" instead of "theme-switcher"). Stop re-escaping notes
  that are already safe.
- stripPUA dropped Nerd Font icon runes entirely, which could leave a
  trailing flag with no value at all (`-g` with nothing after it). Replace
  runs of PUA runes with a `<icon>` placeholder instead, so the example
  stays syntactically complete.
- README's regenerate command was `go run ./tools/man-gen` from the repo
  root, which fails ("cannot find main module") since tools/man-gen is its
  own module. Match the wrapper script's cd-into-the-module invocation.
- Un-wrap two hard-wrapped paragraphs per AGENTS.md's markdown style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants