Expand description
color-ssh (csh) - A Rust-based SSH client wrapper with syntax highlighting
This library provides the core functionality for the color-ssh tool, which wraps SSH connections with syntax highlighting and enhanced logging capabilities.
§Features
- Syntax Highlighting: Apply ANSI color codes to SSH output based on regex patterns
- Configuration Management: YAML-based configuration with hot-reloading
- Logging: Comprehensive debug and session logging
- Process Management: Robust SSH subprocess handling with proper error propagation
§Modules
args- Command-line argument parsingconfig- Configuration loading, watching, and managementhighlighter- Syntax highlighting engine with regex pattern matchinglog- Structured logging with multiple levels and targetsprocess- SSH subprocess spawning and I/O handling
§Examples
Basic usage as a library:
use csh::{args, config, process};
fn main() -> csh::Result<std::process::ExitCode> {
// Parse arguments
let args = args::main_args();
// Initialize config watcher
let _watcher = config::config_watcher(None);
// Run SSH process
process::process_handler(args.ssh_args, args.is_non_interactive)
}Modules§
- args
- Command-line argument parsing
- config
- Configuration management module
- highlighter
- Syntax highlighting engine
- log
- Logging module for color-ssh
- process
- SSH process management and output handling
Macros§
- debug_
enabled - Check if debug logging is enabled
- log_
debug - Log a debug message
- log_
error - Log an error message
- log_
info - Log an informational message
- log_ssh
- Log SSH session output
- log_
warn - Log a warning message
Enums§
- Error
- Top-level error type encompassing all module-specific errors
Type Aliases§
- Result
- Result type alias for color-ssh operations