GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - urfave/cli-docs: CLI documentation generator library for urfave/cli/v3

BranchesTags
Open more actions menu

Latest commit

 

History

2,982 Commits
2,982 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
testdata
testdata
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.golangci.yaml
.golangci.yaml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
docs.go
docs.go
 
 
docs_test.go
docs_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
markdown.md.gotmpl
markdown.md.gotmpl
 
 
markdown_tabular.md.gotmpl
markdown_tabular.md.gotmpl
 
 

Repository files navigation

Welcome to urfave/cli-docs/v3

Run Tests Go Reference Go Report Card

urfave/cli-docs/v3 is an extended documentation library for use with urfave/cli/v3.

Start using

  1. Add the dependency to your project
 go get github.com/urfave/cli-docs/v3@latest
  1. Add it as import
 import (
+  docs "github.com/urfave/cli-docs/v3"
 )
  1. Now use it e.g. to generate markdown document from a command
package main

import (
    "context"
    "fmt"
    "os"

    docs "github.com/urfave/cli-docs/v3"
    cli "github.com/urfave/cli/v3"
)

func main() {
    app := &cli.Command{
        Name:  "greet",
        Usage: "say a greeting",
        Action: func(ctx context.Context, c *cli.Command) error {
            fmt.Println("Greetings")
            return nil
        },
    }

    md, err := docs.ToMarkdown(app)
    if err != nil {
        panic(err)
    }

    fi, err := os.Create("cli-docs.md")
    if err != nil {
        panic(err)
    }
    defer fi.Close()
    if _, err := fi.WriteString("# CLI\n\n" + md); err != nil {
        panic(err)
    }
}

This will create a file cli-docs.md with content:

# CLI

# NAME

greet - say a greeting

# SYNOPSIS

greet

**Usage**:

```
greet [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]
```

Examples

Some examples of the cli generated using this markdown

  • https://woodpecker-ci.org/docs/cli

About

CLI documentation generator library for urfave/cli/v3

Topics

clidocumentation-generatormarkdown

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

23 stars

Watchers

15 watching

Forks

12 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.