CLI Tools in Rust

Hello,

I don’t want to start my next small project alone, and I want to be clear that it has immediate use, but I don’t think at all that it should be specific to my own goals.

I don’t want to start this entirely alone, but I would like to make a small toolset that is not a Shell, but rather the Pieces of it.

So it’s going to be a group of small algorithms done in 100% Rust, and in my mind it should come in 2 versions.

These algos should have a long name (move) and short name (mv), and any alias should also be unique.

Then we bundle them against a path that is not OsStr, but a small converted module that lets it be a path without an actual delimiter like / or . -> just a small custom path:path, and of course the "std" IO that can just be a Rust stream or template adapter. (I will find out what is by far the most no_std and just applies everywhere.)

We can use Allocator + Panic + Core3 or any Core crates of course, so no_std is not “no nothing”.

As well, the first iteration should already include Help and Args.

Command example list (min) for files

Move
List
Delete
...

Or a cool combo-command, any ideas are welcome!

CMDs for network

Network needs the smallish hull to call into network interfaces, but it’s on ANY HW in the world, close to a TCP/IP stack, and ping or such is already ICMP, so on the HW, making network commands next to files is just the bare minimum for meaningful PC use these days.

I suggest only a small ping command, and/or maybe the following:

Environment

We should give it a smallish env, because the shell is usually a centerpiece, and to know language, timezone, hostname, or more generally the "localization", already satisfies a lot of commands halfway.

Now my actual question: I don’t want to do it alone — all that want to start, we could do a Rust forum collaboration.

Kind regards,
Jonas

The reality is that you’ll need to do it yourself, especially when starting the project.

I'm sorry, I might not fully understand what you're trying to do, but my idea is to first establish a reasonable goal and project structure to lay a solid foundation for the project. It seems you want to do quite a lot; perhaps you could break it down into smaller modules and implement them gradually.

Allright i got to work and made this MIT Repository on GitHub. I believe anybody that wants a quick shell integrated into his Platform with Rust may benefit.

Shell Vessel - Ideas and clarification

First i would like to suggest that we only use core and keep it no_std. That way its very generic, as a Shell is a concept across many platforms.

#![no_std]

and perhaps

use core::task

Aswell it should be a library so Cargo.toml may look like that.

[package]
name = "sh-vessel"
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"

[lib]
path = "src/lib.rs"

The Idea is very general. At some point, a Hardware Developer would need to Surface his Driver work. That is for example with a USB Stick, that he can list the Block Device and simple or complex Filesystem to it.

The Repository includes this minimal example and a bigger one with comments that explain all too it.

Vessel gives you a Command Template and Jobs plus a small Registry Concept.
This is the most minimal use:

use shvessel::callback::{CommandCall, CommandCallback, CommandResult};
use shvessel::cmd;
use shvessel::vessel::Vessel;

// This Example is a minimal sync call (no poll needed)

fn main() {
    let mut vessel = Vessel::<1, 1>::new();
    let _ = vessel.register(cmd::ENVIRONMENT, CommandCallback::syn_call(env_sync));
    let args = []; // environment needs no args
    let _ = vessel.execute("env", &args);
}

fn env_sync(_call: CommandCall<'_>) -> CommandResult {
    for (name, value) in std::env::vars() {
        std::println!("{}={}", name, value);
    }
    Ok(())
}

In my opinion, its important to understand that std::env would be ideally your::env ( from your platform ) and that it's intended use is compiled in no_std scenarios because only then it makes actually sence to need such a Vessel.

Is there any Ideas towards what i missed or can improve?