{"id":47751676,"url":"https://github.com/alehechka/json2go","last_synced_at":"2026-04-03T03:21:14.143Z","repository":{"id":37252877,"uuid":"505615314","full_name":"alehechka/json2go","owner":"alehechka","description":"JSON to Go CLI converter","archived":false,"fork":false,"pushed_at":"2022-07-04T20:20:14.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-28T12:54:22.039Z","etag":null,"topics":["cli","command-line","go","json"],"latest_commit_sha":null,"homepage":"https://json2go.dev","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/alehechka.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":"2022-06-20T22:24:35.000Z","updated_at":"2023-02-04T22:27:17.000Z","dependencies_parsed_at":"2022-06-27T17:14:06.444Z","dependency_job_id":null,"html_url":"https://github.com/alehechka/json2go","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/alehechka/json2go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehechka%2Fjson2go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehechka%2Fjson2go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehechka%2Fjson2go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehechka%2Fjson2go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alehechka","download_url":"https://codeload.github.com/alehechka/json2go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehechka%2Fjson2go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31331228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T03:20:36.090Z","status":"ssl_error","status_checked_at":"2026-04-03T03:20:35.133Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["cli","command-line","go","json"],"created_at":"2026-04-03T03:21:11.328Z","updated_at":"2026-04-03T03:21:13.569Z","avatar_url":"https://github.com/alehechka.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2go\n\nThis CLI tool allows for the simple conversion of a JSON payload into ready-to-use Go types. The JSON payload can be supplied via file, STDIN, or URL fetching. The generation is able to correctly parse all top-level data types as well as deeply nested arrays and objects. Optional CLI arguments allow the customization of the outputted Go files.\n\n### Installation\n\n```bash\ngo install github.com/alehechka/json2go/cmd/json2go@latest\n```\n\n### Usage\n\nFrom local JSON file:\n\n```bash\njson2go generate --file=example.json\n```\n\nFrom STDIN:\n\n```bash\ncat example.json | json2go generate\n```\n\nFrom URL fetching:\n\n```bash\njson2go generate --url=\"https://gorest.co.in/public/v2/users\"\n```\n\n### CLI Arguments\n\n| Argument           | Example                      | Type     | Purpose                                                                                                                                                                                            | Default    |\n| ------------------ | ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |\n| File name          | `--file=example.json`        | `string` | Valid path to local file on disk                                                                                                                                                                   |\n| URL                | `--url=\"https://example.com` | `string` | Valid URL that JSON can be fetched via GET request from.                                                                                                                                           |\n| Root Object Name   | `--root=RootObject`          | `string` | Name for top-level object in JSON payload                                                                                                                                                          | `Root`     |\n| Package Name       | `--package=api`              | `string` | Name of package to generate types into. A nested package path is valid                                                                                                                             | `main`     |\n| Output File Name   | `--output`                   | `string` | The name of the file that is generated. If a file is provided as input, will use matching name unless explicitly provided. The \".go\" extension is not required and will be automatically appended. | `types.go` |\n| Time Format        | `--time=2006-01-02`          | `string` | Time format to use while parsing strings for potential time.Time variables. View time.Time constants for possible defaults: https://pkg.go.dev/time#pkg-constants                                  | `RFC3339`  |\n| Omit Empty         | `--omitempty`                | `bool`   | Appends the omitempty to all object variable tags.                                                                                                                                                 | `false`    |\n| Alphabetical Order | `--alpha`                    | `bool`   | Sorts all keys into alphabetical order before generation.                                                                                                                                          | `false`    |\n| Debug logging      | `--debug`                    | `bool`   | Will output debugging console logs.                                                                                                                                                                | `false`    |\n| Quiet              | `--quiet`                    | `bool`   | Will quiet fatal errors.                                                                                                                                                                           | `false`    |\n| STDOUT             | `--out`                      | `bool`   | Instead of generating a Go file, will instead print the contents to STDOUT                                                                                                                         | `false`    |\n\n### Local Development\n\nWhile developing locally, the CLI can be used directly with the `go run` option as follows:\n\n```bash\ngo run cmd/json2go/main.go generate --file=example.json \u003c...args\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falehechka%2Fjson2go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falehechka%2Fjson2go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falehechka%2Fjson2go/lists"}