{"id":36676556,"url":"https://github.com/harakeishi/gscp","last_synced_at":"2026-01-12T10:51:11.061Z","repository":{"id":65163617,"uuid":"579648449","full_name":"harakeishi/gscp","owner":"harakeishi","description":"gscp is the ssh-config parser available in go.  gscp is named as an abbreviation of go ssh config parser.","archived":false,"fork":false,"pushed_at":"2023-01-08T06:54:28.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T18:02:42.787Z","etag":null,"topics":["go","golang","parser","ssh","ssh-config"],"latest_commit_sha":null,"homepage":"","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/harakeishi.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-12-18T12:11:31.000Z","updated_at":"2023-01-03T13:23:25.000Z","dependencies_parsed_at":"2023-02-08T05:15:39.065Z","dependency_job_id":null,"html_url":"https://github.com/harakeishi/gscp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/harakeishi/gscp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harakeishi%2Fgscp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harakeishi%2Fgscp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harakeishi%2Fgscp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harakeishi%2Fgscp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harakeishi","download_url":"https://codeload.github.com/harakeishi/gscp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harakeishi%2Fgscp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:40:25.642Z","status":"ssl_error","status_checked_at":"2026-01-12T10:39:27.820Z","response_time":98,"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":["go","golang","parser","ssh","ssh-config"],"created_at":"2026-01-12T10:51:08.739Z","updated_at":"2026-01-12T10:51:11.047Z","avatar_url":"https://github.com/harakeishi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gscp\n`gscp` is the ssh-config parser available in go.\n\n`gscp` is named as an abbreviation of `go ssh config parser`.\n\n\n## Importing\n```go\nimport (\n    \"github.com/harakeishi/gscp\"\n)\n```\n\n## Documentation\nVisit the docs on [GoDoc](https://pkg.go.dev/github.com/harakeishi/gscp)\n\n## usage\n\nIf no arguments are passed to `LoadConfig()`, `~/.ssh/config` will be read.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/harakeishi/gscp\"\n)\n\nfunc main() {\n\t// Reads a config file and gets it as a string\n\ts, _ := gscp.LoadConfig()\n\t// parse\n\tr, _ := gscp.Parse(s)\n\tfmt.Printf(\"%+v\", r)\n}\n```\n\n```sh\n$ go run ./cmd/main.go\n[{Name:testhost Options:[{Name:HostName Value:192.0.2.1} {Name:User Value:myuser} {Name:IdentityFile Value:~/.ssh/id_rsa} {Name:ServerAliveInterval Value:60}]}]\n```\n\nIf you want to parse a config in a specific directory, pass the path as follows.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/harakeishi/gscp\"\n)\n\nfunc main() {\n\t// Reads a config file and gets it as a string\n\tpath := gscp.Path(\"./testData/test1_config\")\n\ts, _ := gscp.LoadConfig(path)\n\t// parse\n\tfmt.Println(gscp.Parse(s))\n}\n```\n\nObtains information on the specified host and the specified options.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/harakeishi/gscp\"\n)\n\nfunc main() {\n\t// Specify path\n\tpath := gscp.Path(\"./testData/test1_config\")\n\t// Load config.\n\ts, _ := gscp.LoadConfig(path)\n\t// Parse config.\n\thosts, _ := gscp.Parse(s)\n\t// Obtain information on the specified host\n\thost := hosts.FindHost(\"testhost\")\n\tfmt.Printf(\"%+v\\n\", host)\n\t// Obtain information on specified options\n\thostname := host.FindOption(\"HostName\").Value\n\tfmt.Printf(\"%+v\\n\", hostname)\n}\n```\n\n```sh\nPS C:\\src\\smp\u003e go run .\\cmd\\main.go\n{Name:testhost Options:[{Name:HostName Value:192.0.2.1} {Name:User Value:myuser} {Name:IdentityFile Value:~/.ssh/id_rsa} {Name:ServerAliveInterval Value:60}]}\n192.0.2.1\n```\n\n## License\nCopyright (c) 2023 harakeishi\n\nLicensed under [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharakeishi%2Fgscp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharakeishi%2Fgscp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharakeishi%2Fgscp/lists"}