| Crates.io | color-ssh |
| lib.rs | color-ssh |
| version | 0.4.1 |
| created_at | 2025-02-03 01:13:25.452463+00 |
| updated_at | 2025-02-08 21:18:59.602268+00 |
| description | A Rust-based SSH client with syntax highlighting. |
| homepage | https://github.com/karsyboy/color-ssh |
| repository | https://github.com/karsyboy/color-ssh |
| max_upload_size | |
| id | 1540012 |
| size | 103,027 |
Color SSH, csh for short, is a Rust-based wrapper for ssh that provides syntax-highlighted output using configurable rules. This tool enhances the usability of SSH by allowing regex-based syntax highlighting for specific text patterns in the output.
ssh as a drop-in replacement.cargo install color-ssh
Clone the repository:
git clone https://github.com/karsyboy/color-ssh.git
cd color-ssh
Build the project:
cargo build --release
Install the binary (optional):
cp target/release/csh /usr/local/bin/
A Rust-based SSH client with syntax highlighting.
Usage: csh [OPTIONS] <ssh_args>...
Arguments:
<ssh_args>... SSH arguments
Options:
-d, --debug Enable debug mode
-L, --log Enable SSH logging
-h, --help Print help
-V, --version Print version
csh user@hostname
This runs an SSH session while applying the syntax highlighting rules defined in .csh-config.yaml.
The configuration file is expected to be stored either in the users home directory under .csh\.csh-config.yaml or in the current directory the csh binary tool is being ran out of.
Valid Configuration file locations:
$HOME/.csh/.csh-config.yaml$PWD/.csh-config.yamlThe syntax highlighting rules are defined in a YAML file. Each rule consists of:
description: A human-readable explanation of what the rule does.
regex: The pattern to match in SSH output.
color: The color to apply, specified as a key from the palette section.
If no configuration file is found then csh will create the configuration file ~/.csh/.csh-config.yaml using the template default.csh-config.yaml.
.\templates\default.csh-config.yaml)# Description: This is the default template created by color-ssh (csh).
# It contains information on the template layout and how to create a custom template.
# color-ssh templates can be found at https://github.com/karsyboy/color-ssh
# The palette section is used to define the colors that can be used in the rules section.
# The colors are defined in hex format.
palette:
Red: '#c71800'
Green: '#28c501'
Blue: '#5698c8'
rules:
# example rule with all possible options
# - description: Match on the word "example"
# regex: |
# (?ix)
# \b
# example
# \b
# color: Kelly-Green
# create a rule that matches on the word "connected" or "up" and color it Kelly-Green
# Example of a rule that uses a one line regex to match on "good" or "up" and color it Green
- description: Match on good keywords
regex: (?ix)\b(good|up)\b
color: Green
- description: Match on neutral keywords
regex: |
(?ix)
\b
neutral
\b
color: Blue
# create a rule that matches on the word "down" or "error" or "disabled" and color it Red
- description: Match on bad keywords
regex: |
(?ix)
\b
(down|error|disabled)
\b
color: Red
palette section defines reusable colors using hex codes (e.g., #32cd32 for green).palette.The .csh folder is also used to stored ssh logs if the -L or --log argument is used. Logs will be stored in .csh/ssh-logs/MM-DD-YYYY/HOSTNAME-MM-DD-YYYY.log
This project is licensed under the MIT License. See the full license below:
MIT License
Copyright (c) 2025 Karsyboy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Contributions are welcome! To contribute:
csh-vault.yaml encrypted file for storing host information like passwords used to connect.csh-vault.yaml after the users provides there unlock password.