{"id":44070479,"url":"https://github.com/memclutter/confparse","last_synced_at":"2026-02-08T04:12:07.326Z","repository":{"id":62846260,"uuid":"150109283","full_name":"memclutter/confparse","owner":"memclutter","description":"Declarative command line argument parser for golang projects.","archived":false,"fork":false,"pushed_at":"2022-11-07T22:29:43.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-20T22:33:00.647Z","etag":null,"topics":["12-factor","configuration","environment-configuration","golang"],"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/memclutter.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}},"created_at":"2018-09-24T13:45:48.000Z","updated_at":"2024-06-20T22:33:00.648Z","dependencies_parsed_at":"2023-01-21T06:02:19.917Z","dependency_job_id":null,"html_url":"https://github.com/memclutter/confparse","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/memclutter/confparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memclutter%2Fconfparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memclutter%2Fconfparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memclutter%2Fconfparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memclutter%2Fconfparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memclutter","download_url":"https://codeload.github.com/memclutter/confparse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memclutter%2Fconfparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29219582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T03:18:47.732Z","status":"ssl_error","status_checked_at":"2026-02-08T03:15:31.985Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["12-factor","configuration","environment-configuration","golang"],"created_at":"2026-02-08T04:12:06.757Z","updated_at":"2026-02-08T04:12:07.314Z","avatar_url":"https://github.com/memclutter.png","language":"Go","readme":"# Confparse\n\n[![Language Golang](https://img.shields.io/badge/language-golang-blue.svg)](https://img.shields.io/badge/language-golang-blue.svg)\n[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/memclutter/confparse)\n[![codecov](https://codecov.io/gh/memclutter/confparse/branch/main/graph/badge.svg?token=G0U5MRSSFZ)](https://codecov.io/gh/memclutter/confparse)\n[![Go](https://github.com/memclutter/confparse/actions/workflows/go.yml/badge.svg)](https://github.com/memclutter/confparse/actions/workflows/go.yml)\n\nDeclarative command line argument parser for golang projects. \n\n## Install\n\nInstall go module\n\n```shell\ngo get github.com/memclutter/confparse\n```\n\n## Usage\n\nUse `struct` tags to declare command-line arguments. \n\n```go\n// ...\n\ntype Config struct {\n\tArgument1 string `name:\"arg1\" usage:\"Argument 1 help text\"`\n\tTimeout time.Duration `name:\"timeout\" value:\"200ms\" usage:\"Timeout argument\"`\n}\n\n// ...\n```\n\n## Supported Types\n\nDifferent types of arguments are supported:\n\n- `string` by default any arguments is a string\n- `int` like `1`, `2`, `300`, `-23` etc\n- `time.Duration` for time interval argument, like `10s`, `500ms`, `20us` etc\n- `bool` for boolean argument\n\n## Environment Extension\n\nUse special struct tag `envVar` if you application read configuration from environment variables. \nSet environment variable name in `envVar` and confparse read value from there.\n\n## Example\n\nThe following is an example of defining a configuration for a simple web server\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/memclutter/confparse\"\n)\n\ntype Config struct {\n\tAddr string `name:\"addr\" value:\":8000\" usage:\"Listen and serve address\"`\n\tApiKey string `name:\"apiKey\" envVar:\"API_KEY\" usage:\"API key\"`\n}\n\nvar appConfig = \u0026Config{}\n\nfunc main() {\n\tif err := confparse.Parse(appConfig); err != nil {\n\t\tlog.Fatalf(\"Error parse configuration: %s\", err)\n\t}\n\n        log.Printf(\"API Key: %s\", appConfig.ApiKey)\n\n\tlog.Printf(\"Listen and serve on %s\", appConfig.Addr)\n\tif err := http.ListenAndServe(appConfig.Addr, nil); err != nil {\n\t\tlog.Fatalf(\"Listen and serve error: %s\", err)\n\t}\n}\n\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemclutter%2Fconfparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemclutter%2Fconfparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemclutter%2Fconfparse/lists"}