1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! # 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.
extern crate heapless;
// Optional dependencies (feature-gated)
extern crate sha2;
extern crate subtle;
// Re-export derive macro (always available)
pub use AccessLevel;
// ============================================================================
// Module Declarations
// ============================================================================
// I/O & Access Control Foundation
// Authentication module (always present, but with different contents based on features)
// Error handling
// Tree data model
// Response types
// Shell orchestration
// ============================================================================
// Re-exports - Public API
// ============================================================================
// Core I/O
pub use CharIo;
// Configuration
pub use ;
// Error types
pub use CliError;
// Tree types
pub use ;
// Access control (always available, even without authentication feature)
pub use ;
// Response types
pub use Response;
// Shell types
pub use CommandHandler;
pub use ;
// Optional feature re-exports (authentication-only types)
pub use ;
// ============================================================================
// Library Metadata
// ============================================================================
/// Library version
pub const VERSION: &str = env!;
/// Library name
pub const NAME: &str = env!;
// ============================================================================
// Tests
// ============================================================================