MCPcopy Index your code
hub / github.com/conradkleinespel/rpassword

github.com/conradkleinespel/rpassword @v7.5.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v7.5.4 ↗ · + Follow
106 symbols 218 edges 13 files 21 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rustastic Password

rpassword makes it easy to read passwords from Rust code in console applications on all platforms, Unix, Windows, WASM and more. It's similar to Linux's C function getpass() or Python's getpass module.

rpassword logo and headline

Usage

Add rpassword as a dependency in Cargo.toml:

[dependencies]
rpassword = "7.5"

Then use it in your code:

use std::io::{Cursor, Write};
use rpassword::{ConfigBuilder};

fn main() {
    // By default, reads and writes to the console, hides password as it is typed 
    let password = rpassword::prompt_password("Your password: ").unwrap();
    println!("Your password is {}", password);

    // Behavior is customizable to accommodate custom use-cases and testing
    // See documentation for more details
     let config = rpassword::ConfigBuilder::new()
         .input_data("my-password\n")
         .output_discard()
         .password_feedback_mask('*')
         .build();

     let password = rpassword::read_password_with_config(config).unwrap();
     println!("Your password is {}", password);
}

See examples and docs at https://docs.rs/rpassword.

See the upgrade path in UPGRADE.md.

License

The source code is released under the Apache 2.0 license.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 49
Method 45
Class 6
Enum 5
Interface 1

Languages

Rust100%

Modules by API surface

src/windows.rs22 symbols
src/feedback.rs20 symbols
src/config.rs17 symbols
src/unix.rs13 symbols
src/lib.rs13 symbols
src/wasm.rs8 symbols
tests/no-terminal.rs5 symbols
examples/read_password_with_config.rs2 symbols
examples/read_password.rs2 symbols
src/utf8.rs1 symbols
examples/prompt_password_with_config.rs1 symbols
examples/prompt_password.rs1 symbols

For agents

$ claude mcp add rpassword \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page