{"id":19368433,"url":"https://github.com/anchore/clio","last_synced_at":"2025-06-29T11:35:44.531Z","repository":{"id":166559751,"uuid":"641072988","full_name":"anchore/clio","owner":"anchore","description":"An easy way to bootstrap your application with batteries included.","archived":false,"fork":false,"pushed_at":"2025-04-08T18:05:38.000Z","size":208,"stargazers_count":9,"open_issues_count":2,"forks_count":5,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-08T19:24:46.863Z","etag":null,"topics":["bubbletea","cli","cobra","event-bus","go","golang","hacktoberfest","logger","viper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anchore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-15T18:11:11.000Z","updated_at":"2025-04-08T18:05:41.000Z","dependencies_parsed_at":"2023-11-17T20:02:47.546Z","dependency_job_id":"5f12c46e-ffe0-4067-9a70-56ccf529d9f0","html_url":"https://github.com/anchore/clio","commit_stats":null,"previous_names":["anchore/clio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fclio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fclio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fclio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fclio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anchore","download_url":"https://codeload.github.com/anchore/clio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250460231,"owners_count":21434228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bubbletea","cli","cobra","event-bus","go","golang","hacktoberfest","logger","viper"],"created_at":"2024-11-10T08:06:24.970Z","updated_at":"2025-04-23T15:30:38.113Z","avatar_url":"https://github.com/anchore.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLIO\n\nAn easy way to bootstrap your application with batteries included.\n\n## Status\n\n***Consider this project to be in alpha. The API is not stable and may change at any time.***\n\n## What is included?\n- Pairs well with [cobra](github.com/spf13/cobra) and [viper](github.com/spf13/viper) via [fangs](github.com/anchore/fangs), covering CLI arg parsing and config file + env var loading.\n- Provides an event bus via [partybus](github.com/wagoodman/go-partybus), enabling visibility deep in your execution stack as to what is happening.\n- Provides a logger via the [logger interface](github.com/anchore/go-logger), allowing you to swap out for any concrete logger you'd like.\n- Supplies a redactor object that can be used to remove sensitive output before it's exposed (in the log or elsewhere).\n- Defines a generic UI interface that adapts well to TUI frameworks such as [bubbletea](github.com/charmbracelet/bubbletea).\n\n## Example\n\nHere's a basic example of how to use clio + cobra to get a fully functional CLI application going:\n\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n\t\"github.com/wagoodman/go-partybus\"\n\t\"github.com/anchore/clio\"\n\t\"github.com/anchore/fangs\"\n)\n\n// Define your per-command or entire application config as a struct\ntype MyCommandConfig struct {\n\tTimestampServer string `mapstructure:\"timestamp-server\"`\n\t// ...\n}\n\n// ... add cobra flags just as you are used to doing in any other cobra application\nfunc (c *MyCommandConfig) AddFlags(flags fangs.FlagSet) {\n\tflags.StringVarP(\n\t\t\u0026c.TimestampServer, \"timestamp-server\", \"\",\n\t\t\"URL to a timestamp server to use for timestamping the signature\",\n\t)\n\t// ...\n}\n\nfunc MyCommand(app clio.Application) *cobra.Command {\n\tcfg := \u0026MyCommandConfig{\n\t\tTimestampServer: \"https://somewhere.out/there\", // a default value\n\t}\n\n\treturn app.SetupCommand(\u0026cobra.Command{\n\t\tUse:     \"my-command\",\n\t\tPreRunE: app.Setup(cfg),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t// perform command functions here\n\t\t\treturn nil\n\t\t},\n\t}, cfg)\n}\n\nfunc main() {\n\tcfg := clio.NewSetupConfig(clio.Identification{\n\t\tName: \"awesome\",\n\t\tVersion: \"v1.0.0\",\n    })\n\n\tapp := clio.New(*cfg)\n\t\n\troot := app.SetupRootCommand(\u0026cobra.Command{})\n\n\troot.AddCommand(MyCommand(app))\n\n\tif err := root.Execute(); err != nil {\n\t\tos.Exit(1)\n\t}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fclio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanchore%2Fclio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fclio/lists"}