Skip to main content

gen

deno run -A jsr:@readma/cli gen [options]

The main command. It:

  1. loads and validates readma.config.ts,
  2. detects the workspace (language, registry, members — see workspace detection),
  3. builds the template args for every target (root + each member),
  4. renders and writes one README.md per target.
$ deno run -A jsr:@readma/cli gen
Starting readma generation
Rendering "workspace root" readme
Rendering "@readma/core" readme
Rendering "@readma/cli" readme
Rendering "@readma/pkg-json" readme

Options​

OptionTypeDescription
--dry-runflagRender but skip every file write
--stdoutflagPrint the rendered markdown to stdout instead of writing files
--checkflagCompare rendered output with existing files, exit 2 when different
--config <path>stringPath to the config folder or file, relative to the root path
--root-onlyflagOnly generate the workspace root readme
--members-onlyflagOnly generate the workspace member readmes
--member <path>stringOnly generate the readme of one member (by member path or folder)
--offlineflagSkip every network call (package description fetches)

Global options -d, --debug and --root <path> also apply.

Check mode in CI​

deno run -A jsr:@readma/cli gen --check --offline

--check re-renders every target in memory and diffs it against the file on disk:

  • identical → exit 0,
  • at least one differs (or is missing) → the paths are logged and the process exits with code 2.

Combine it with --offline for a hermetic CI job. Add it to your workflow right after the test step so a stale README blocks the merge:

name: CI
on: [push, pull_request]
jobs:
readmes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: deno run -A jsr:@readma/cli gen --check --offline

Selective generation​

On a large workspace you rarely need to re-render everything:

# Only the root readme
deno run -A jsr:@readma/cli gen --root-only

# Every member except the root
deno run -A jsr:@readma/cli gen --members-only

# One member, by relative path or absolute folder
deno run -A jsr:@readma/cli gen --member packages/core
tip

--member matches either the member path as detected (packages/core) or any folder path resolving to it, so both forms above work.

How member readmes differ from the root one​

AspectRoot readmeMember readme
Workspace tableLists all members (from detection)Replaced by a > [!NOTE] callout pointing to the root
InstallationRoot package install snippetMember package install snippet
Registry badge—Version badge when packageRegistry matches
Package nameBelow the titleBelow the title as <h4>

Both share the same config sections, badges and table of contents.