Netrc
.netrc support for Rust
Install / Use
/learn @gribouille/NetrcREADME
netrc
A netrc library for Rust, with support for reqwest via reqwest-middleware.
reqwest-netrc
The reqwest-netrc crate is a middleware for reqwest
to support the netrc file.
Usage
To bring this crate into your repository, either add reqwest-netrc to your
Cargo.toml, or run:
> cargo add reqwest-netrc
Example
The common scenario is to have a ~/.netrc file or the NETRC environement variable defined:
use reqwest::Client;
use reqwest_middleware::ClientBuilder;
use reqwest_netrc::NetrcMiddleware;
// ...
let client = ClientBuilder::new(Client::builder().build().unwrap())
.with_init(NetrcMiddleware::new().unwrap())
.build();
let res = client.get("https://domain.io/api/hello").send().await;
// ...
rust-netrc
The rust-netrc crate is a parser for the netrc files.
Usage
To bring this crate into your repository, either add rust-netrc to your
Cargo.toml, or run:
> cargo add rust-netrc
Example
use netrc::Netrc;
fn main() {
let nrc = Netrc::new().unwrap();
for (host, auth) in nrc.hosts {
println!("{host}: {auth:?}");
}
}
Contributing
Feedback and contributions are very welcome.
License
This project is licensed under MIT.
Related Skills
himalaya
347.2kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
taskflow
347.2kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
coding-agent
347.2kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
tavily
347.2kTavily web search, content extraction, and research tools.
