{"id":16752636,"url":"https://github.com/azriel91/ssh_cfg","last_synced_at":"2025-04-10T15:52:36.126Z","repository":{"id":45655440,"uuid":"347244587","full_name":"azriel91/ssh_cfg","owner":"azriel91","description":"Parses `~/.ssh/config` asynchronously.","archived":false,"fork":false,"pushed_at":"2022-12-30T04:04:19.000Z","size":133,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T00:03:38.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/azriel91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-13T01:38:31.000Z","updated_at":"2023-07-27T12:07:21.000Z","dependencies_parsed_at":"2023-01-31T10:31:12.767Z","dependency_job_id":null,"html_url":"https://github.com/azriel91/ssh_cfg","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fssh_cfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fssh_cfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fssh_cfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fssh_cfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azriel91","download_url":"https://codeload.github.com/azriel91/ssh_cfg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248245473,"owners_count":21071495,"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":[],"created_at":"2024-10-13T02:47:41.478Z","updated_at":"2025-04-10T15:52:36.108Z","avatar_url":"https://github.com/azriel91.png","language":"Rust","readme":"# 🌐 SSH Cfg\n\n[![Crates.io](https://img.shields.io/crates/v/ssh_cfg.svg)](https://crates.io/crates/ssh_cfg)\n[![docs.rs](https://img.shields.io/docsrs/ssh_cfg)](https://docs.rs/ssh_cfg)\n[![CI](https://github.com/azriel91/ssh_cfg/workflows/CI/badge.svg)](https://github.com/azriel91/ssh_cfg/actions/workflows/ci.yml)\n\nParses `~/.ssh/config` asynchronously.\n\n```rust\nuse ssh_cfg::{SshConfigParser, SshOptionKey};\nuse tokio::runtime;\n\nasync fn parse_ssh_config() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let ssh_config = SshConfigParser::parse_home().await?;\n\n    // Print first host config\n    if let Some((first_host, host_config)) = ssh_config.iter().next() {\n        println!(\"Host: {}\", first_host);\n\n        // Print its configured SSH key if any\n        if let Some(identity_file) = host_config.get(\u0026SshOptionKey::IdentityFile) {\n            println!(\"  {} {}\", SshOptionKey::IdentityFile, identity_file);\n        }\n    }\n\n    // Print all host configs\n    println!();\n    println!(\"{:#?}\", ssh_config);\n\n    Ok(())\n}\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let rt = runtime::Builder::new_current_thread().build()?;\n    rt.block_on(parse_ssh_config())\n}\n```\n\nCurrently values are stored as `String`s. Ideally we would parse them into a\nstrong data model.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazriel91%2Fssh_cfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazriel91%2Fssh_cfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazriel91%2Fssh_cfg/lists"}