How elias-phy-ja/lernperiode-2 works
Shellmate is a terminal-based Gemini chatbot. On launch it loads local configuration, guides first-time users through API-key setup when needed, then routes slash commands or prompts through the chat loop; prompts go to Gemini with conversation history and responses render as Markdown. Settings support changing the model or key, resetting configuration and chat, and restoring the conversation. The README also documents help, usage guidance, chat clearing, and exit. Edges reflect the shown calls and documented Gemini integration; the HTTP service is represented by its implementation, not an inspected remote API.
Main entry points: Program.cs Chat loop · GeminiService.cs Gemini service · CommandHandler.cs Command handler · SettingsMenu.cs Settings menu
Components 12
Terminal runtime
- Chat loop
src/Shellmate/Program.cs - Command handler
src/Shellmate/Commands/CommandHandler.cs
Setup and settings
- App configuration
src/Shellmate/Models/AppConfig.cs - Config persistence
src/Shellmate/Services/ConfigService.cs - Setup wizard
src/Shellmate/UI/SetupWizard.cs - Settings menu
src/Shellmate/UI/SettingsMenu.cs
Gemini conversation
- Gemini service
src/Shellmate/Services/GeminiService.cs - Chat messages
src/Shellmate/Models/ChatMessage.cs - Gemini API
- Gemini errors
src/Shellmate/Services/GeminiException.cs
Terminal presentation
- Markdown renderer
src/Shellmate/UI/MarkdownRenderer.cs
Other components
- Terminal user
Connections 20
- Terminal user → Chat loop: enters input
src/Shellmate/Program.cs - Chat loop → Config persistence: loads config
src/Shellmate/Program.cs - Config persistence → App configuration: deserializes
src/Shellmate/Services/ConfigService.cs - Chat loop → Setup wizard: starts setup
src/Shellmate/Program.cs - Setup wizard → Config persistence: saves config
src/Shellmate/UI/SetupWizard.cs - Setup wizard → Command handler: handles setup commands
src/Shellmate/UI/SetupWizard.cs - Chat loop → Gemini service: creates service
src/Shellmate/Program.cs - Chat loop → Command handler: dispatches commands
src/Shellmate/Program.cs - Chat loop → Gemini service: sends prompts
src/Shellmate/Program.cs - Chat loop → Markdown renderer: renders answers
src/Shellmate/Program.cs - Command handler → Settings menu: opens settings
src/Shellmate/Commands/CommandHandler.cs - Command handler → Gemini service: clears history
src/Shellmate/Commands/CommandHandler.cs - Command handler → Markdown renderer: redraws replies
src/Shellmate/Commands/CommandHandler.cs - Gemini service → Chat messages: stores messages
src/Shellmate/Services/GeminiService.cs - Gemini service → Gemini API: posts prompt history
src/Shellmate/Services/GeminiService.cs - Gemini service → Gemini errors: throws user errors
src/Shellmate/Services/GeminiService.cs - Settings menu → Config persistence: saves or deletes
src/Shellmate/UI/SettingsMenu.cs - Settings menu → Gemini service: applies config
src/Shellmate/UI/SettingsMenu.cs - Settings menu → Setup wizard: restarts setup
src/Shellmate/UI/SettingsMenu.cs - Settings menu → Command handler: restores chat
src/Shellmate/UI/SettingsMenu.cs