How jaevibing/g-shell works
g-shell is a pre-alpha Unix-like shell. Its main workflow reads terminal input, records commands, dispatches built-ins or external programs, and prints results; help is served from an embedded file. At startup it checks for a newer version, prompts the user, and can download an update. The graph separates shell behavior, update handling, and local state. Source excerpts show the main runtime calls; unsampled installer behavior and future roadmap features are omitted.
Main entry points: main.rs Shell loop · autoupdate.rs Update check · download.rs Binary downloader · saveLastCheck.rs Cache writer
Components 15
Shell runtime
- Shell loop
src/main.rs - Command dispatch
src/main.rs - Help content
src/docs/HELPFILE
Update lifecycle
- Update check
src/autoupdate.rs - Binary downloader
src/download.rs - Installed binary
Local state
- Command history
src/history.rs - Cache check
src/autoupdate.rs - Cache writer
src/saveLastCheck.rs - Update cache
Other components
- Shell user
- Terminal
- External programs
- Version endpoint
- Release assets
Connections 18
- Shell user → Terminal: enters commands
README.md - Terminal → Shell loop: provides input
src/main.rs - Shell loop → Terminal: prints prompt
src/main.rs - Shell loop → Update check: checks version
src/main.rs - Update check → Cache check: checks freshness
src/autoupdate.rs - Cache check → Update cache: reads cache
src/autoupdate.rs - Update check → Version endpoint: fetches version
src/autoupdate.rs - Shell loop → Cache writer: saves declined check
src/main.rs - Cache writer → Update cache: writes cache
src/saveLastCheck.rs - Shell loop → Binary downloader: requests update
src/main.rs - Binary downloader → Release assets: downloads binary
src/download.rs - Binary downloader → Installed binary: writes file
src/download.rs - Shell loop → Command history: records command
src/main.rs - Shell loop → Command dispatch: dispatches command
src/main.rs - Command dispatch → Command history: clears history
src/main.rs - Command dispatch → External programs: runs program
src/main.rs - Command dispatch → Help content: prints help
src/main.rs - Command dispatch → Terminal: prints results
src/main.rs