$ show nguyenphutrong/quotio
Quotio is a macOS application for managing AI provider accounts and tracking quota usage. It follows a Clean Architecture with four layers: Domain (core models), Application (business logic), Infrastructure (platform services), and Presentation (SwiftUI UI). The app provides both Local Proxy Mode (running a local proxy server CLIProxyAPI) and Monitor Mode (quota-only tracking) for AI services like Claude, OpenAI Codex, GitHub Copilot, Antigravity, and others. Key features include OAuth authentication flows, secure credential storage (Keychain/YubiKey), menu bar integration, automatic updates via Sparkle, telemetry via PostHog, AI CLI tool configuration, and Cloudflare tunnel management. The application uses modern Swift concurrency, protocol-oriented programming, and actor-based state management.
The LLM identified 8 files worth highlighting for reuse:
Implements atomic file writing with retry logic and secure permissions. Uses file coordination to prevent race conditions, sets secure file permissions, and provides a clean API for writing data safely to disk. Could be extracted for any application needing reliable file persistence.
A robust HTTP client with exponential backoff, timeout handling, and retry mechanisms specifically designed for quota API calls. Handles common error cases and provides consistent error mapping. The retry logic with jitter prevents thundering herd problems.
Provides secure credential storage using YubiKey PIV slots. Implements proper PIN handling, key generation, and attestation verification. Abstracts away the complexity of YubiKey interaction while providing a simple store/retrieve interface.
Handles encoding/decoding of agent configurations to/from JSON with built-in migration support for version transitions. Includes validation and error handling for corrupted configurations.
Provides URLSession adapters that respect system proxy settings. Handles both direct connections and proxied requests with proper authentication support. Essential for applications that need to work in corporate proxy environments.
Discovers existing AI provider credentials from various sources (keychain, CLI tools, IDEs, environment files) to help users migrate to Quotio. Implements provider-specific discovery logic with proper error handling and deduplication.
A reliable background task runner that handles interruptions gracefully. Uses proper cancellation checking and error handling for long-running periodic tasks.
Securely stores and retrieves sensitive tokens with encryption at rest. Uses platform keychain services with proper error handling and fallback mechanisms.