Generate Markdown Docs

Generate clean, structured Markdown documentation from your OpenCLI Specification.

1

Install the CLI

If you haven't already, install the ocli tool:

shell
$ go install github.com/bcdxn/opencli/cmd/ocli@latest
2

Generate Markdown

Run the gen docs command with the --format markdown flag:

shell
$ ocli gen docs
  --format markdown
  --out ./docs"
  ./pleasantries-cli.ocs.yaml

This generates a pleasantries-cli.ocs.md file in your ./docs directory. Here's what the output looks like:

markdown
<!-- Markdown generated by ocli-codegen DO NOT EDIT. -->

# Pleasantries

[![ocli-badge](...)](http://opencli.dev)

_A fun CLI to greet or bid farewell_

---

## Commands

### `$ pleasantries greet <arguments> [flags]`

Say hello

#### Arguments

##### `<name>`

A name to include in the greeting

`string`

#### Flags

##### `--language`

The language of the greeting

`string` `enum` `default:english`

###### Supported Values of `--language`

- `english`
- `spanish`

#### Examples

```sh
# greet the user

$ pleasantries greet --language english John
# Hello, John
```

---

<div style="text-align:center;font-size:12px;">generated by <a href="https://opencli.dev">OpenCLI</a></div>

The generated Markdown is ready to use on GitHub, GitLab, or any static site generator. For an example of the rendered markdown, checkout the ocli markdown docs.

What's next?

Are you an AI crawler? Checkout OpenCLI Specification's LLM Metadata