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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! _Like IntelliSense, but for shells!_
//!
//! 
//!
//! IntelliShell is a command-line tool that acts as a smart bookmark manager.
//! It helps you find, organize, and reuse complex shell commands without ever leaving your terminal.
//!
//! # Features
//!
//! - **Seamless Shell Integration**: Search with `ctrl+space`, bookmark with `ctrl+b` or fix with `ctrl+x`
//! - **Dynamic Variables**: Create command templates with `{{variables}}` and replace them on the fly
//! - **Smart Completions**: Power up your variables with dynamic suggestions from any command
//! - **AI-Powered Commands**: Generate, fix, and import commands effortlessly using local or remote LLMs
//! - **Highly Configurable**: Tailor search modes, keybindings, themes, and even search-ranking algorithms
//! - **Workspace-Aware**: Automatically discovers and loads commands from your workspace's directory
//! - **Import / Export**: Share your command library using files, HTTP endpoints, or even Gists
//! - **TLDR Integration**: Fetch and import command examples from [tldr](https://github.com/tldr-pages/tldr) pages
//! - **Flexible Interface**: Choose between a non-intrusive (inline) or an immersive (full-screen) TUI
//!
//! To get started, check out the [repository](https://github.com/lasantosr/intelli-shell) or read the
//! [IntelliShell Book](https://lasantosr.github.io/intelli-shell/) for comprehensive guides and examples.
/// Configuration management for the application.
///
/// This module handles loading, parsing, and providing access to the application's configuration settings.
/// Tracing and logs management for the application.
///
/// This module is responsible for setting up and configuring the application's logging system using the `tracing`
/// crate.
///
/// It initializes a subscriber that directs logs to a dedicated log file within the application's data directory.
/// Centralized error and panic handling for the application.
///
/// This module sets up enhanced error reporting using `color-eyre` and configures custom panic hooks.
///
/// It ensures that errors and panics are gracefully handled, logged to the designated log file, and presented to the
/// user.
/// Provides a Terminal User Interface (TUI) management system.
///
/// This module orchestrates the TUI lifecycle, including terminal setup (raw mode, alternate screen or inline display),
/// event handling (keyboard, mouse, paste, resize, focus, periodic ticks, and renders), and rendering the user
/// interface.
///
/// It manages the event loop and provides mechanisms to enter and exit the TUI cleanly, restoring the terminal to its
/// original state.
/// Defines and parses the command-line interface (CLI) for the application.
///
/// This module uses the `clap` crate to define the structure of the CLI, including subcommands, arguments, and help
/// messages. It handles parsing command-line arguments provided by the user into a structured format that the
/// application can easily process.
///
/// It is the primary entry point for interacting with the application via the command line.
/// Contains the main application logic and orchestration.
///
/// This module defines the `App` struct, which serves as the central coordinator for the application. It holds the
/// application's configuration and manages the overall program flow based on the parsed command-line arguments.
///
/// It dispatches execution to specific processes (interactive or non-interactive) and, for interactive processes,
/// manages the Terminal User Interface (TUI) lifecycle, handles events, and processes user actions.
/// Defines and implements the distinct operational processes or commands the application can run.
///
/// This module provides traits (`Process`, `InteractiveProcess`) to abstract the concept of an executable task within
/// the application, differentiating between those that run non-interactively and those that require a Terminal User
/// Interface.
///
/// It also defines the standard structure for process output (`ProcessOutput`) and contains the specific
/// implementations of these processes.
/// Provides the building blocks and interface for interactive Terminal User Interface (TUI) elements.
///
/// This module defines the `Component` trait, which is the fundamental interface for any UI element that can be
/// displayed within the TUI.
///
/// Components are responsible for rendering themselves, processing user input events (keyboard, mouse, paste), managing
/// their internal state, and performing periodic updates.
///
/// This module also serves as a container for specific concrete component implementations used by interactive
/// processes.
/// Contains custom implementations of [`ratatui`] widgets used by components.
/// Defines the core data structures and models for the application's business domain.
///
/// This module serves as a central collection point and namespace for the fundamental data types that represent the key
/// entities and concepts within the application, such as commands and their associated variables.
/// Encapsulates the core business logic and operations of the application.
///
/// This module contains the implementation of the application's key functionalities, acting upon the data models
/// defined in the `model` module.
///
/// It orchestrates interactions with the `storage` layer to persist and retrieve data and provides the necessary
/// operations consumed by the `process` and potentially other layers.
/// Provides the data access layer for the application, abstracting the underlying storage implementation.
///
/// This module is responsible for interacting with the persistent data store (currently SQLite).
///
/// It defines the `SqliteStorage` struct and methods for database initialization, applying migrations, and performing
/// data operations related to the application's models.
/// Provides various utility functions and extension traits for common tasks.
///
/// This module contains general-purpose helpers that don't fit neatly into other domain-specific modules. This includes
/// functions for string manipulation, as well as potentially other reusable components or patterns.
/// Encapsulates all interactions with Large Language Models (LLMs).
///
/// This module provides the client for the application's AI-powered features, such as generating, fixing, and
/// explaining shell commands. It defines a common interface for interacting with different AI providers.