Skip to main content

raps_cli/shell/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2024-2025 Dmytro Yemelianov
3
4//! Interactive shell helper with command completion and hints.
5//!
6//! Provides tab-completion for RAPS commands and subcommands,
7//! as well as inline hints showing required parameters.
8//! Uses reedline's Prompt trait for proper styled/raw separation,
9//! which fixes cursor alignment issues on Windows.
10
11mod command_tree;
12mod completer;
13mod highlighter;
14mod hinter;
15mod prompt;
16#[cfg(test)]
17mod tests;
18
19pub use completer::RapsCompleter;
20pub use highlighter::RapsHighlighter;
21pub use hinter::RapsHinter;
22pub use prompt::RapsPrompt;
23
24use serde::Serialize;
25
26/// Command metadata for completion and hints
27#[derive(Debug, Clone, Serialize)]
28pub struct CommandInfo {
29    /// The command name
30    pub name: &'static str,
31    /// Short description
32    pub description: &'static str,
33    /// Required parameters with placeholders (e.g., `<bucket-key>`)
34    pub params: &'static [&'static str],
35    /// Optional flags
36    pub flags: &'static [&'static str],
37    /// Subcommands (if any)
38    pub subcommands: &'static [CommandInfo],
39}