Releases: SpdrByte/GemmaCLI
Releases · SpdrByte/GemmaCLI
Gemma CLI v0.5-alpha
1. Major Refactor: Modularization (v0.5.0)
- Decoupled Core Logic: Extracted API orchestration into lib/Api.ps1 and context management into lib/History.ps1.
- State Management: Standardized script-scoping ($script:) for key variables like history, intelligence, Settings, and configDir to ensure consistent behavior across dot-sourced modules.
- Initialization Integrity: Moved core constants and OutputEncoding settings to the absolute top of GemmaCLI.ps1 to prevent Unicode rendering glitches and initialization race conditions.
- Settings Hashtable Fix: Converted $script:Settings loading from ConvertFrom-Json PSCustomObject to a proper hashtable, preventing silent failures when the settings menu attempted to dynamically add new properties.
2. History & API Stability Fixes
- Role Alternation: Refactored Trim-History to drop turns in pairs and implemented a final validation pass in both trimming functions to guarantee strict user/model alternation required by the Gemma API.
- Hashtable Fidelity: Resolved a persistent bug where array slicing corrupted hashtables into nulls; fixed using robust @() wrapping and pure-PowerShell construction logic.
- Prompt Synchronization: Implemented Update-SystemPrompt to rebuild system instructions and tool blocks dynamically whenever a model is switched (e.g., ensuring a 1b model doesn't see tool instructions it can't use).
- API Orchestration: Centralized background job management into Invoke-ModelGeneration within lib/Api.ps1 to support reliable API calls from both the main loop and external tools.
- Dual-Agent Scope Fix: Resolved $history scope bug in Invoke-DualAgent where the function in Api.ps1 could not read or write the main loop's conversation history, causing dual-agent calls to operate on empty context and never update session state.
- Write-ApiLog Path Fix: Fixed $configDir reference in Write-ApiLog (Api.ps1) which was undefined in that scope, causing all API logging to silently fail.
- Invoke-GemmaApi Parameter Fix: Corrected a critical param block bug where param($uri, $script:history, $gConfig) was overwriting the script-scoped history variable on every API call, which was the root cause of the token count discrepancy between debug output and the status bar.
3. Tool System Enhancements
- Code Analyzer Tool: Refactored code_analyzer.ps1 to use the centralized API system with a robust fallback chain: Gemini 3 Flash Preview → Gemini 2.5
Flash → Gemma 27b. - Dialogue Visibility: Updated the main loop to extract and render the model's dialogue/reasoning before executing a tool call, providing a more natural
user experience. - Background Job Context: Upgraded the tool execution engine to pass full script state (API keys, RPM logs, etc.) into background jobs and automatically
skip interactive console checks to prevent crashes in non-interactive sessions. - Encoding Robustness: Fixed tool loading to explicitly force UTF-8 interpretation, resolving "Unexpected token" errors caused by Unicode characters in
tool files. - BlackJack tool: Play blackjack with Gemma (she cheats sometimes, but that's part of the fun)
- Adventure tool: Embark on an epic RPG journey with Gemma as your game master!
4. Testing & Verification
- Comprehensive Test Suite: Created new tests for Sanitization, History, and Api logic.
- Baseline Stabilization: Fixed and updated existing project tests for Parser, ToolLoader, BraveSearch, HTTP Get, etc. to match the new modular
architecture.
Gemma CLI v0.45-alpha
** Tool-calling, secure DPAPI, custom UI

Full Changelog: https://github.com/SpdrByte/GemmaCLI/commits/v0.045