Hackshell
Hackshell is a lightweight, customizable shell framework built in Rust. It provides an interactive command-line interface that can be easily extended with custom commands and integrated into your applications.
Features
- Task Management: Background task spawning, monitoring, and killing
- Environment Variables: Built-in environment variable storage and manipulation
- Rich Command Set: Comes with essential built-in commands like
help,set,get,env, etc. - Command History: Persistent command history between sessions
Built-in Commands
Hackshell comes with several built-in commands:
env- List all environment variablesget <name>- Get the value of an environment variableset <name> <value>- Set an environment variableunset <name>- Remove an environment variablehelp- Show available commands and their descriptionssleep <seconds>- Sleep for the specified durationexit- Exit the shelltask- Manage background tasks
Usage
You can find complete examples in the examples directory.
The following are quick examples.
Basic Example
use ;
Adding Custom Commands
You can extend Hackshell with your own commands. Commands can specify a category
which is used by the help command to group related commands together.
If not specified, commands default to the "User" category:
use ;
;
Background Tasks
Hackshell allows you to spawn and manage background tasks:
use Hackshell;
use Ordering;
It also support asynchronous tasks!
Forking Shells
Create a child shell that inherits the parent's environment:
use Hackshell;
Installation
Add Hackshell to your Cargo.toml:
[]
= "0.6.1"
License
This project is licensed under the MIT License - see the LICENSE file for details.