Skip to main content

Generate

Write the CLI, DSL and reference pages of the docs site.

It writes each generated page of the docs site from this binary, and removes each generated page that no command, DSL or group has now:

  • a page for each command, under docs/docs/sidebar/usage/cli;
  • a page for each DSL, under docs/docs/sidebar/development/dsl, from the spec that the spec get command of the DSL prints;
  • a page for each behavior, chain, endpoint group and local group, under docs/docs/sidebar/reference, from the output of its list or get command, such as osapi dsl behavior get --name dns.

A DSL page that a person wrote stays. just cli-docs-generate runs it, and just test checks that the pages match the binary.

osapi dsl docs generate [flags]

Examples​

osapi dsl docs generate
osapi dsl docs generate --root ~/src/osapi

Result​

The command prints:

$ osapi dsl docs generate
Docs:
  CLI pages:        244
  DSL pages:        4
  Reference pages:  93

With --json, the command prints:

{
"cli": 244,
"dsl": 4,
"reference": 93
}

Flags​

FlagDescriptionDefault
--rootRoot of the osapi repository.

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file; without one at the default path, osapi runs on the defaults/etc/osapi/osapi.yaml

Output tells how the result is printed, and what --json gives.