Crate nut_shell

Crate nut_shell 

Source
Expand description

§nut-shell

Lightweight CLI library for embedded systems with zero heap allocation.

Key features:

  • Static allocation - Everything lives in ROM, zero heap usage
  • Const initialization - Command trees defined at compile time
  • Optional features - Authentication, tab completion, command history, async
  • Flexible I/O - Platform-agnostic character I/O trait
  • Access control - Hierarchical permissions with generic access levels

See EXAMPLES.md for complete usage patterns.

§Optional Features

  • authentication - User login/logout, password hashing, credential providers
  • completion - Tab completion for commands and paths
  • history - Command history with up/down arrow navigation
  • async - Async command execution support

The library provides a #[derive(AccessLevel)] macro that’s always available.

This library is no_std compatible.

Re-exports§

pub use io::CharIo;
pub use config::DefaultConfig;
pub use config::MinimalConfig;
pub use config::ShellConfig;
pub use error::CliError;
pub use tree::CommandKind;
pub use tree::CommandMeta;
pub use tree::Directory;
pub use tree::Node;
pub use auth::AccessLevel;
pub use auth::User;
pub use response::Response;
pub use shell::handler::CommandHandler;
pub use shell::CliState;
pub use shell::HistoryDirection;
pub use shell::Request;
pub use shell::Shell;

Modules§

auth
Authentication and access control.
config
Configuration traits and implementations for buffer sizing.
error
Error types for CLI operations.
io
Character I/O abstraction for platform-agnostic input/output.
response
Response types for command execution.
shell
Shell orchestration and command processing.
tree
Command tree data structures.

Constants§

NAME
Library name
VERSION
Library version

Derive Macros§

AccessLevel
Derives the AccessLevel trait for enums.