docgen

package
v0.1.0-dev.20260213054539 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package docgen generates Docker-style CLI reference documentation in Markdown with Astro frontmatter from Cobra command trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTree

func GenerateTree(cmd *cobra.Command, outDir, toolName, version string) error

GenerateTree walks a Cobra command tree and generates a markdown file for each non-hidden, non-skipped command.

Types

type ChildInfo

type ChildInfo struct {
	Name        string
	Description string
	Path        string
}

ChildInfo holds a reference to a child command.

type FlagInfo

type FlagInfo struct {
	Name        string
	Default     string
	Description string
}

FlagInfo holds display information for a single flag.

type PageData

type PageData struct {
	Title       string
	Description string
	Tool        string
	Command     string
	Parent      string
	Generated   string
	Version     string
	Usage       string
	Long        string
	Options     []FlagInfo
	GlobalFlags []FlagInfo
	Examples    string
	ParentCmd   *ParentInfo
	Children    []ChildInfo
}

PageData holds all data needed to render a CLI reference page.

func BuildPageData

func BuildPageData(cmd *cobra.Command, toolName, version string) PageData

BuildPageData extracts page data from a Cobra command.

type ParentInfo

type ParentInfo struct {
	Name        string
	Description string
	Path        string
}

ParentInfo holds a reference to the parent command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL