{"id":15883551,"url":"https://github.com/siketyan/gh-config-rs","last_synced_at":"2025-03-17T14:31:40.608Z","repository":{"id":57714426,"uuid":"517062410","full_name":"siketyan/gh-config-rs","owner":"siketyan","description":"🐙 Loads config and hosts from gh CLI in Rust.","archived":false,"fork":false,"pushed_at":"2025-03-11T01:50:12.000Z","size":435,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-15T21:31:02.269Z","etag":null,"topics":["cli","config","github","rust-crate"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/gh-config","language":"Rust","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/siketyan.png","metadata":{"funding":{"github":"siketyan","patreon":"siketyan"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-07-23T13:15:35.000Z","updated_at":"2025-03-11T01:50:15.000Z","dependencies_parsed_at":"2022-09-11T23:52:30.044Z","dependency_job_id":"643a8ad3-1a95-4f5b-86be-0d1e1bc7be53","html_url":"https://github.com/siketyan/gh-config-rs","commit_stats":{"total_commits":148,"total_committers":3,"mean_commits":"49.333333333333336","dds":0.3716216216216216,"last_synced_commit":"646e3c5211c4cd372d25388bc42e90a66472309f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siketyan%2Fgh-config-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siketyan%2Fgh-config-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siketyan%2Fgh-config-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siketyan%2Fgh-config-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siketyan","download_url":"https://codeload.github.com/siketyan/gh-config-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243795521,"owners_count":20349249,"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","config","github","rust-crate"],"created_at":"2024-10-06T04:23:31.216Z","updated_at":"2025-03-17T14:31:40.596Z","avatar_url":"https://github.com/siketyan.png","language":"Rust","funding_links":["https://github.com/sponsors/siketyan","https://patreon.com/siketyan"],"categories":[],"sub_categories":[],"readme":"# gh-config-rs\n\n[![Rust](https://github.com/siketyan/gh-config-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/siketyan/gh-config-rs/actions/workflows/rust.yml)\n[![crates.io](https://img.shields.io/crates/v/gh-config.svg)](https://crates.io/crates/gh-config)\n[![docs](https://docs.rs/gh-config/badge.svg)](https://docs.rs/gh-config/)\n\nLoads config and hosts for gh CLI in Rust.\n\n## Getting started\n\n```toml\n[dependencies]\ngh-config = \"0.5.1\"\n```\n\n## Usage\n\n```rust\nuse std::error::Error;\nuse gh_config::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let config = Config::load()?;\n    let hosts = Hosts::load()?;\n\n    match hosts.get(GITHUB_COM) {\n        Some(host) =\u003e println!(\"Token for github.com: {}\", host.oauth_token),\n        _ =\u003e eprintln!(\"Token not found.\"),\n    }\n\n    Ok(())\n}\n```\n\n## CLI\n\ngh-config-rs is a hybrid crate that can be used as a library or a CLI.\nTo use as a CLI, can be installed using the command line below:\n\n```shell\ncargo install gh-config --features=cli\n```\n\n### Usages\n\nLists all configuration in YAML:\n\n```shell\ngh-config config show\n```\n\nUses JSON instead:\n\n```shell\ngh-config --json config show\n```\n\nUses custom path of config.yaml instead of default:\n\n```shell\ngh-config --path /path/to/config.yaml config show\n```\n\nGets an authentication for github.com:\n\n```shell\ngh-config authn get github.com\n```\n\nOutputs only the OAuth token instead:\n\n```shell\ngh-config authn get --token-only github.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiketyan%2Fgh-config-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiketyan%2Fgh-config-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiketyan%2Fgh-config-rs/lists"}