examples/

directory
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT

README

cmdguard Examples

Three examples: the flagship taskctl plus two focused demos.

taskctl — Task Manager CLI

A complete CLI application that shows all cmdguard capabilities in a realistic context:

# From the project root:
go run examples/taskctl/main.go --help
go run examples/taskctl/main.go list
go run examples/taskctl/main.go add --title "Fix bug" --priority high
go run examples/taskctl/main.go done --id 1
go run examples/taskctl/main.go stats --format json

See examples/taskctl/README.md for the full feature matrix and usage guide.

config-explain — Config Provenance Demo

Shows the config explain command (WithConfigExplainCommand()): resolves every config field to its source (flag → env → config file → default) with secret:"true" redaction.

go run examples/config-explain/main.go config explain
go run examples/config-explain/main.go config explain --output json

docs-generator — GenerateDocs Demo

Minimal CLI exercising cli.GenerateDocs(w) — markdown documentation for the full command tree.

go run examples/docs-generator/main.go

Running Tests

go test ./examples/taskctl/... -count=1 -race

Directories

Path Synopsis
Command config-explain demonstrates cmdguard's configuration features: config files, strict key checking, value provenance (`config explain`), and the secret:"true" redaction marker.
Command config-explain demonstrates cmdguard's configuration features: config files, strict key checking, value provenance (`config explain`), and the secret:"true" redaction marker.
Command docs-generator demonstrates cmdguard's GenerateDocs API.
Command docs-generator demonstrates cmdguard's GenerateDocs API.
Package main demonstrates every major cmdguard feature in a production-grade task manager.
Package main demonstrates every major cmdguard feature in a production-grade task manager.

Jump to

Keyboard shortcuts

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