How abdullahmahfouz/shell works
My Shell is an interactive C# command-line shell. The main workflow reads a line from the terminal, parses it into commands, dispatches built-ins or external programs, and returns output to the terminal; pipelines and redirects extend execution. Separate user-facing capabilities include history navigation and tab completion. The sampled files support the parser, dispatch, history, PATH search, and parts of pipeline execution; the main loop, navigation, and redirection implementation are represented by their paths and documented behavior, but their internal wiring is not assumed beyond the evident workflow.
Main entry points: Builtins.cs Built-in commands · ProcessCommands.cs Command dispatch · Shell.cs Shell loop · AutoCompletion.cs Tab completion
Components 19
Shell interaction
- Shell loop
src/Shell/Shell.cs - Tab completion
src/Shell/AutoCompletion.cs - History navigation
src/Shell/HistoryNavigation.cs
Command parsing
- Command parser
src/Parsing/CommandLineParser.cs - Command model
src/Parsing/Command.cs - Pipeline model
src/Parsing/Pipeline.cs
Command execution
- Command dispatch
src/Shell/ProcessCommands.cs - Pipeline runner
src/Execution/PipelineRunner.cs - Output redirection
src/Execution/OutputRedirection.cs - External process runner
src/Execution/ProcessRunner.cs
Built-in features
- Built-in commands
src/Builtins/Builtins.cs - Directory navigation
src/Builtins/Navigation.cs - Command history
src/Builtins/History.cs
System environment
- Executable search
src/Execution/SearchPath.cs - Prefix matching
src/Utils/LongestPrefix.cs - Terminal
- Filesystem
- External programs
Other components
- Shell user
Connections 28
- Shell user → Shell loop: enters commands
- Shell loop → Tab completion: reads input
- Tab completion → Executable search: searches PATH
- Tab completion → Built-in commands: matches built-ins
- Tab completion → Prefix matching: finds common prefix
- Tab completion → History navigation: handles arrows
- History navigation → Command history: reads history
- Shell loop → Command parser: submits line
- Command parser → Command model: creates commands
- Command parser → Pipeline model: creates pipeline
- Shell loop → Command dispatch: dispatches input
- Command dispatch → Command parser: parses input
- Command dispatch → Pipeline runner: runs pipeline
- Command dispatch → Built-in commands: runs built-ins
- Command dispatch → External process runner: runs external command
- Command dispatch → Output redirection: applies redirects
- Pipeline runner → Built-in commands: runs pipeline built-ins
- Pipeline runner → External programs: starts processes
- External process runner → Executable search: locates executable
- External process runner → External programs: starts program
- Built-in commands → Executable search: resolves type
- Built-in commands → Directory navigation: changes directory
- Built-in commands → Command history: manages history
- Command history → Filesystem: reads and writes
- Output redirection → Filesystem: writes output
- Built-in commands → Filesystem: reads cat files
- Shell loop → Terminal: reads and prints
- External programs → Terminal: produces output