MCPcopy Index your code
hub / github.com/MrPicklePinosaur/shrs

github.com/MrPicklePinosaur/shrs @0.0.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.6 ↗ · + Follow
796 symbols 1,640 edges 134 files 259 documented · 33% updated 20mo ago0.0.6 · 2024-06-01★ 34096 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sh.rs

The rusty shell toolkit for hackers

crates.io Doc book MIT/Apache 2.0 Discord

PROJECT GOALS

  • hackable: almost every aspect of the shell should be easily customizable and extendable
  • developer friendly: well documented and easy to contribute to
  • rusty: implemented in and configurable in rust

FEATURES

DISCLAIMER: shrs is currently very much a work in progress, the API is subject to change frequently and things are prone to breaking. It currently may not be suitable for daily use, but is great for prototyping any experimental shell features you dream up with!

Here are what makes shrs special: - Completely configurable in rust (including your prompt, completions and more!) - Plugin system (community maintained plugins that add unique features)

GETTING STARTED

To get a taste of what shrs is capable of, without any configuration, you can run the example shrs_example shell that is bundled by running:

git clone https://github.com/MrPicklePinosaur/shrs.git
cd ./shrs/shrs_example
cargo run

To get started with building your own shell, it's as easy as creating a new cargo project with:

use shrs::prelude::*;

fn main() {
    let myshell = ShellBuilder::default()
        .build()
        .unwrap();

    myshell.run();
}

See the developer documentation for more in depth information.

CONTRIBUTING

If you encounter and bugs are have any feature requests, please don't hesitate to leave an issue! Also take a look at the section for contributors in the documentation.

COMMUNITY PLUGINS

List of cool 3rd part plugins and community built shells can be found in awesome_shrs. Some notable examples includes - shrs_insulter: port of bash insulter - shrs_openai: chatgpt for your shell - shrs_presence: show shrs on discord presence - shrs_sound: play sounds in your shell

Extension points exported contracts — how you extend this code

Plugin (Interface)
Implement this trait to build your own plugins [11 implementers]
crates/shrs_core/src/plugin.rs
Process (Interface)
(no doc) [2 implementers]
crates/shrs_job/src/process.rs
Lang (Interface)
Trait to implement a shell command language [7 implementers]
crates/shrs_core/src/lang/mod.rs
Job (Interface)
(no doc) [1 implementers]
crates/shrs_job/src/job.rs
Highlighter (Interface)
Implement this trait to define your own highlighter command [4 implementers]
crates/shrs_core/src/readline/highlight.rs
JobExt (Interface)
(no doc) [1 implementers]
crates/shrs_job/src/job.rs
SyntaxTheme (Interface)
Trait that modifies a [`StyledBuf`] inplace and applies a theme to highlight the text Can be used standalone to apply a [3 …
crates/shrs_core/src/readline/highlight.rs
AsJob (Interface)
(no doc) [1 implementers]
crates/shrs_job/src/job.rs

Core symbols most depended-on inside this repo

insert
called by 66
crates/shrs_core/src/state.rs
as_str
called by 48
crates/shrs_utils/src/cursor_buffer.rs
len
called by 38
crates/shrs_core/src/history.rs
println
called by 32
crates/shrs_core/src/output_writer.rs
run
called by 28
crates/shrs_core/src/shell.rs
iter
called by 26
crates/shrs_core/src/builtin/mod.rs
iter
called by 24
crates/shrs_core/src/env.rs
chars
called by 23
crates/shrs_utils/src/cursor_buffer.rs

Shape

Method 400
Function 182
Class 147
Enum 39
Interface 28

Languages

Rust100%

Modules by API surface

crates/shrs_utils/src/cursor_buffer.rs41 symbols
crates/shrs_job/src/job.rs41 symbols
crates/shrs_core/src/readline/line.rs28 symbols
crates/shrs_core/src/completion/completer.rs27 symbols
crates/shrs_utils/src/styled_buf.rs23 symbols
crates/shrs_lang/src/process.rs23 symbols
crates/shrs_core/src/shell.rs23 symbols
crates/shrs_core/src/readline/menu.rs21 symbols
crates/shrs_job/src/process.rs18 symbols
crates/shrs_lang/src/lexer.rs16 symbols
plugins/shrs_mux/src/lib.rs15 symbols
plugins/shrs_file_history/src/lib.rs14 symbols

For agents

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

⬇ download graph artifact