CLI reference
Every opend command and option.
Each command takes the docs root, the folder that holds opend.config.yaml, as
its argument. It defaults to the current folder. Run pnpm opend help <command>
for the same information.
opend validate [dir]
Runs every check and prints the problems. Exits with status 1 on any error, or on any problem with
--strict.
| Option | Default | Meaning |
|---|---|---|
--ref <ref> | working tree | Validate a git branch or tag instead of the files on disk. |
--strict | off | Treat warnings as failures. |
--format <format> | text | text prints file:line:column: severity [code] message and a summary. json prints the problems as a JSON array. github prints GitHub Actions workflow annotations, so problems show inline on pull requests. |
opend build [dir]
Compiles the docs into the release snapshot the hosted build stores: JSON holding every topic with its conditions, the navigation, publications, context-sensitive help keys and the reuse index. Fails without writing anything when there is an error.
| Option | Default | Meaning |
|---|---|---|
--ref <ref> | working tree | Build a git branch or tag. |
--out <file> | .opend/build/<release>.json | Where to write the snapshot. The default is inside the docs root. |
opend preview [dir]
Serves the docs locally and rebuilds on save. See Preview as different readers.
| Option | Default | Meaning |
|---|---|---|
--as <name> | Preview as a named reader from preview-contexts.yaml. An unknown name is an error that lists the known ones. | |
--product <list> | Preview as a reader holding these products, comma-separated. Can be repeated. | |
--feature <list> | Preview as a reader holding these features, comma-separated. Can be repeated. | |
--version <version> | the project's release | The reader's release, such as 0.1. |
--all | on | The staff view: everything, with conditions marked. Used when no reader option is given. |
--ref <ref> | working tree | Preview a git branch or tag. Not watched. |
-p, --port <port> | 4000 | Port to listen on. 0 picks a free port. |
--host <host> | 127.0.0.1 | Interface to bind. Only change it on a trusted network: the staff view shows everything. |
--no-watch | watching | Do not rebuild when files change. |