Files
teleport/lib/utils/docs-usage.md.tmpl
T
Paul Gottschling 7e245bd716 Add generated note to CLI reference docs (#64466)
Make it clear in generated CLI reference docs that they were generated
so authors do not attempt to edit them directly. Edit the template for
generated CLI docs to add a message.

Regenerate CLI references to include the message. This also updates the
references.

Note that the CLI reference doc generation is not yet fully idempotent,
so we cannot enforce generation.

To pass linting, edit the `teleport` CLI to use "Amazon Bedrock" (the
correct product name) in an error message instead of "AWS Bedrock".
2026-03-16 13:09:55 +00:00

98 lines
2.3 KiB
Cheetah

{{define "FormatCommand" -}}
{{if .Flags|AnyVisibleFlags}}{{if .FlagSummary }} {{.FlagSummary}}{{end}}{{end -}}
{{range .Args}}{{if not .Hidden}} {{ .|FormatUsageArg}}{{end}}{{end -}}
{{end -}}
{{ define "FormatCommands" -}}
{{$appName := .Name -}}
{{range .FlattenedCommands|SortCommandsByName -}}
{{if not .Hidden -}}
## {{$appName}} {{.FullCommand}}
{{.Help|Wrap 0 }}
Usage:
```code
$ {{$appName}} {{.FullCommand}}{{template "FormatCommand" .}}
```
{{if AnyEnvVarsForCmd .Args .Flags -}}
Environment variables:
|Variable|Default|Description|
|---|---|---|
{{- EnvVarsToRows .Args .Flags|FormatThreeColMarkdownTable}}
{{end -}}
{{ if .Flags|AnyVisibleFlags -}}
Flags:
|Flag|Default|Description|
|---|---|---|
{{- (ReplaceFlagDefaults (printf "%v %v" $appName .FullCommand) .Flags)|FlagsToRows|FormatThreeColMarkdownTable }}
{{end -}}
{{ if .Args -}}
Arguments:
|Argument|Default|Description|
|---|---|---|
{{- (ReplaceArgDefaults (printf "%v %v" $appName .FullCommand) .Args)|ArgsToRows|FormatThreeColMarkdownTable }}
{{end -}}
{{end -}}
{{end -}}
{{end -}}
{{define "FormatUsage" -}}
```code
$ {{.Name}}{{template "FormatCommand" .}}{{if .Commands}} <command> [<args> ...]{{end}}
```
{{end -}}
---
title: {{.App.Name}} Reference
description: Provides a comprehensive list of commands, arguments, and flags for {{.App.Name}}.
sidebar_label: {{.App.Name}}
tags:
- reference
- {{if eq .App.Name "tbot"}}mwi{{else}}platform-wide{{end}}
---
{/*GENERATED FILE. DO NOT EDIT.*/}
{/*To generate, run: make cli-docs-{{.App.Name}}*/}
{/*vale messaging = NO*/}
This guide provides a comprehensive list of commands, arguments, and flags for
{{.App.Name}}.
{{ .App.Help|Wrap 0 }}
{{template "FormatUsage" .App -}}
{{if .Context.Flags|AnyVisibleFlags -}}
Global flags:
|Flag|Default|Description|
|---|---|---|
{{- (ReplaceFlagDefaults .App.Name .Context.Flags)|FlagsToRows|FormatThreeColMarkdownTable}}
{{end -}}
{{if AnyEnvVarsForCmd .Context.Args .Context.Flags -}}
Global environment variables:
|Variable|Default|Description|
|---|---|---|
{{- EnvVarsToRows .Context.Args .Context.Flags|FormatThreeColMarkdownTable}}
{{end -}}
{{if .Context.Args -}}
Arguments:
|Argument|Default|Description|
|---|---|---|
{{- (ReplaceArgDefaults .App.Name .Context.Args)|ArgsToRows|FormatThreeColMarkdownTable}}
{{end -}}
{{if .App.Commands -}}
{{template "FormatCommands" .App -}}
{{end -}}