125 points by cat-whisperer 3 days ago | 24 comments
You can use Shelgon to:
- Create a custom shell with only a few lines of code - Build interactive debugging tools with persistent state between commands - Develop domain-specific language interpreters with shell-like interfaces - Add REPL capabilities to existing applications
Getting started is straightforward - implement a single trait that handles your command execution logic, and Shelgon takes care of the terminal UI, input handling, and async runtime integration.
For example, a simple echo shell takes less than 50 lines of code, including a full implementation of command history, cursor movement, and tab completion.
Repository: https://github.com/nishantjoshi00/shelgon
bfLives 3 days ago
1. Why async?
2. Why couple to anyhow instead of using an associated error type?
cmrdporcupine 3 days ago
Also, for async don't mandate tokio, use the "agnostic" crate to abstract it so people can use alternative runtimes.
And yes, don't use anyhow in a library like this. Anyhow is for your internal code, not public libraries/crates. Define a set of error enums, or use thiserror for it if you have to.
cat-whisperer 3 days ago
dhon_ 3 days ago
cmrdporcupine 3 days ago
dhon_ 2 days ago
cat-whisperer 2 days ago
cat-whisperer 2 days ago
cmrdporcupine 3 days ago
One suggestions: the README advertises lovely TUIs. Show us a screenshot, or screencast, so we can see what you mean!
tmpfs 3 days ago
I have done a simple shell using Rustyline and Clap and this could be something I might be interested in but it's hard to say without a visual idea, asccinema would be perfect!
cat-whisperer 3 days ago
tmpfs 1 day ago
faizshah 2 days ago
serial_dev 2 days ago
Video or gif would be nice! It’s like a UI library need at least a screenshot, this thing needs a video demo of sorts.
Q: why write that the docs is by LLM? In my opinion if it’s correct, and it makes sense, I don’t care even if an alien gave it to you.
cat-whisperer 2 days ago