{"modulePath":"github.com/osapi-io/osapi","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package commandgen\n\nPackage commandgen writes the cobra commands of a group of the command layer, gen/cli.go: one command for each method, with its help, its flags and its examples, for the local generator, the endpoint generator and the behavior generator alike. A local group's command runs its method in the CLI with command.Run; an endpoint group's sends a request with the endpoint layer's Run.\n\n## Constants\n\n```go\nconst ExampleTraceID = \"26e448c9dbe1c4a8d216a98c675079c9\"\n```\nExampleTraceID is the trace that each example output ends with, and ExampleNow is the time that an age in one is from, so a page is the same on each run. A sample output gives its times relative to ExampleNow.\n\n## Variables\n\n```go\nvar ExampleNow = time.Date(2026, time.January, 15, 10, 0, 0, 0, time.UTC)\n```\nExampleNow is the time that an age in an example output is from.\n\n## Functions\n\n```go\nfunc Commands(\n\tf *jen.File,\n\tg command.Group,\n\tpkg string,\n)\n```\nCommands writes gen/cli.go: one cobra command for each method, with its help, its permission, its examples and a flag for each input field, and the init that registers them under osapi client \\\u003cgroup\u003e, or under osapi for a local group.\n\n```go\nfunc Outputs(\n\tg command.Group,\n\tm command.Command,\n\tline string,\n) string\n```\nOutputs are the outputs of the examples of m: each example that Prints gave one, or, for a method that answers with no body, each example without --json. For each, the command line and what the CLI prints for it, in a fenced ansi block, then what --json prints. line is the command with its group, such as osapi client agent list.\n\n","path":"github.com/osapi-io/osapi/internal/cli/command/gen","name":"commandgen","synopsis":"Package commandgen writes the cobra commands of a group of the command layer, gen/cli.go: one command for each method, with its help, its flags and its examples, for the local generator, the endpoint generator and the behavior generator alike.","isRedistributable":true}
