{"id":27061174,"url":"https://github.com/urfave/cli-altsrc","last_synced_at":"2025-04-05T14:19:46.523Z","repository":{"id":65134402,"uuid":"563485772","full_name":"urfave/cli-altsrc","owner":"urfave","description":"Read values for urfave/cli/v3 flags from config files","archived":false,"fork":false,"pushed_at":"2025-04-05T00:31:53.000Z","size":209,"stargazers_count":23,"open_issues_count":6,"forks_count":5,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-05T01:24:52.160Z","etag":null,"topics":["cli","golang","golang-cli","golang-library","json","toml","yaml"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/urfave/cli-altsrc/v3","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urfave.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-11-08T18:00:42.000Z","updated_at":"2025-04-05T00:31:03.000Z","dependencies_parsed_at":"2024-06-20T01:27:03.802Z","dependency_job_id":"68dd081d-07cc-4009-94e7-8ab92dd64156","html_url":"https://github.com/urfave/cli-altsrc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urfave%2Fcli-altsrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urfave%2Fcli-altsrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urfave%2Fcli-altsrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urfave%2Fcli-altsrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urfave","download_url":"https://codeload.github.com/urfave/cli-altsrc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247346487,"owners_count":20924218,"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":["cli","golang","golang-cli","golang-library","json","toml","yaml"],"created_at":"2025-04-05T14:19:45.880Z","updated_at":"2025-04-05T14:19:46.517Z","avatar_url":"https://github.com/urfave.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to `urfave/cli-altsrc/v3`\n\n[![Run Tests](https://github.com/urfave/cli-altsrc/actions/workflows/main.yml/badge.svg)](https://github.com/urfave/cli-altsrc/actions/workflows/main.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/urfave/cli-altsrc/v3.svg)](https://pkg.go.dev/github.com/urfave/cli-altsrc/v3)\n[![Go Report Card](https://goreportcard.com/badge/github.com/urfave/cli-altsrc/v3)](https://goreportcard.com/report/github.com/urfave/cli-altsrc/v3)\n\n[`urfave/cli-altsrc/v3`](https://pkg.go.dev/github.com/urfave/cli-altsrc/v3) is an extension for [`urfave/cli/v3`] to read\nflag values from JSON, YAML, and TOML. The extension keeps third-party libraries for these features away from [`urfave/cli/v3`].\n\n[`urfave/cli/v3`]: https://github.com/urfave/cli\n\n### Example\n\n```go\n\tconfigFiles := []string{\n\t\tfilepath.Join(testdataDir, \"config.yaml\"),\n\t\tfilepath.Join(testdataDir, \"alt-config.yaml\"),\n\t}\n\n\tapp := \u0026cli.Command{\n\t\tName: \"greet\",\n\t\tFlags: []cli.Flag{\n\t\t\t\u0026cli.StringFlag{\n\t\t\t\tName:    \"name\",\n\t\t\t\tAliases: []string{\"n\"},\n\t\t\t\tSources: yaml.YAML(\"greet.name\", configFiles...),\n\t\t\t},\n\t\t\t\u0026cli.IntFlag{\n\t\t\t\tName:    \"enthusiasm\",\n\t\t\t\tAliases: []string{\"!\"},\n\t\t\t\tSources: yaml.YAML(\"greet.enthusiasm\", configFiles...),\n\t\t\t},\n\t\t},\n\t\tAction: func(ctx context.Context, cmd *cli.Command) error {\n\t\t\tpunct := \"\"\n\t\t\tif cmd.Int(\"enthusiasm\") \u003e 9000 {\n\t\t\t\tpunct = \"!\"\n\t\t\t}\n\n\t\t\tfmt.Fprintf(os.Stdout, \"Hello, %[1]v%[2]v\\n\", cmd.String(\"name\"), punct)\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\t// Simulating os.Args\n\tos.Args = []string{\"greet\"}\n\n\tif err := app.Run(context.Background(), os.Args); err != nil {\n\t\tfmt.Fprintf(os.Stdout, \"OH NO: %[1]v\\n\", err)\n\t}\n\n\t// Output:\n\t// Hello, Berry!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furfave%2Fcli-altsrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furfave%2Fcli-altsrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furfave%2Fcli-altsrc/lists"}